diff --git a/demos/RP/RT-RP2040-PICO/cfg/chconf.h b/demos/RP/RT-RP2040-PICO/cfg/chconf.h index ab5b434f9..04c41a001 100644 --- a/demos/RP/RT-RP2040-PICO/cfg/chconf.h +++ b/demos/RP/RT-RP2040-PICO/cfg/chconf.h @@ -177,7 +177,7 @@ * @note The default is @p TRUE. */ #if !defined(CH_CFG_USE_TM) -#define CH_CFG_USE_TM FALSE +#define CH_CFG_USE_TM TRUE #endif /** diff --git a/os/common/ports/ARMv6-M-RP2/chcore.h b/os/common/ports/ARMv6-M-RP2/chcore.h index 2f85735f1..9fc0f498b 100644 --- a/os/common/ports/ARMv6-M-RP2/chcore.h +++ b/os/common/ports/ARMv6-M-RP2/chcore.h @@ -63,7 +63,7 @@ * @name Port Capabilities and Constants * @{ */ -#define PORT_SUPPORTS_RT FALSE +#define PORT_SUPPORTS_RT TRUE /** * @brief Natural alignment constant. @@ -677,6 +677,18 @@ __STATIC_INLINE void port_wait_for_interrupt(void) { #endif } +/** + * @brief Returns the current value of the realtime counter. + * @note In this port the RT counter is the same counter used for + * system time in tick-less mode, resolution is always 1uS. + * + * @return The realtime counter value. + */ +__STATIC_FORCEINLINE rtcnt_t port_rt_get_counter_value(void) { + + return TIMER->TIMERAWL; +} + /** * @brief Returns a core index. * @return The core index.