From: arighi Date: Tue, 4 May 2010 08:54:49 +0000 (+0000) Subject: CM3: avoid using HWREG() macro. X-Git-Tag: 2.5.0~309 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=c67c140d701f3f196aed3352f2518cbef5976853;p=bertos.git CM3: avoid using HWREG() macro. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3599 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/cortex-m3/drv/irq_cm3.c b/bertos/cpu/cortex-m3/drv/irq_cm3.c index a21439a7..d71876fe 100644 --- a/bertos/cpu/cortex-m3/drv/irq_cm3.c +++ b/bertos/cpu/cortex-m3/drv/irq_cm3.c @@ -83,9 +83,9 @@ static void sysirq_enable(sysirq_t irq) { /* Enable the IRQ line (only for generic IRQs) */ if (irq >= 16 && irq < 48) - HWREG(NVIC_EN0) = 1 << (irq - 16); + NVIC_EN0_R = 1 << (irq - 16); else if (irq >= 48) - HWREG(NVIC_EN1) = 1 << (irq - 48); + NVIC_EN1_R = 1 << (irq - 48); } void sysirq_setHandler(sysirq_t irq, sysirq_handler_t handler) @@ -122,6 +122,6 @@ void sysirq_init(void) irq_table[i] = unhandled_isr; /* Update NVIC to point to the new vector table */ - HWREG(NVIC_VTABLE) = (size_t)irq_table; + NVIC_VTABLE_R = (size_t)irq_table; IRQ_RESTORE(flags); } 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)