X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fdrv%2Ftimer_cm3.c;h=e5a730bfe381f5d805216606e504d734125396c1;hb=50e04d4861514f5644587b31885bffeb9c4335f3;hp=a4d9668943d35bf186c80d30ce5fcd948efdfe85;hpb=476b69eb75e5eca105bb4b3474df19e6cfdbed68;p=bertos.git diff --git a/bertos/cpu/cortex-m3/drv/timer_cm3.c b/bertos/cpu/cortex-m3/drv/timer_cm3.c index a4d96689..e5a730bf 100644 --- a/bertos/cpu/cortex-m3/drv/timer_cm3.c +++ b/bertos/cpu/cortex-m3/drv/timer_cm3.c @@ -43,18 +43,18 @@ INLINE void timer_hw_setPeriod(unsigned long period) { ASSERT(period < (1 << 24)); - HWREG(NVIC_ST_RELOAD) = period - 1; + NVIC_ST_RELOAD_R = period - 1; } static void timer_hw_enable(void) { - HWREG(NVIC_ST_CTRL) |= + NVIC_ST_CTRL_R |= NVIC_ST_CTRL_CLK_SRC | NVIC_ST_CTRL_ENABLE | NVIC_ST_CTRL_INTEN; } static void timer_hw_disable(void) { - HWREG(NVIC_ST_CTRL) &= ~(NVIC_ST_CTRL_ENABLE | NVIC_ST_CTRL_INTEN); + NVIC_ST_CTRL_R &= ~(NVIC_ST_CTRL_ENABLE | NVIC_ST_CTRL_INTEN); } void timer_hw_init(void)