Change macro name to IRQ_ENABLED.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 23 Oct 2007 13:44:42 +0000 (13:44 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 23 Oct 2007 13:44:42 +0000 (13:44 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@928 38d2e660-2303-0410-9eaa-f027e97ec537

app/at91sam7s/at91sam7s.c
cpu/cpu.h
drv/timer.c

index 4e75cf4e6372fa505bf62125fe3c0f398858fae6..57fdd8fde89a04268585ead10237cf8f5d31df43 100644 (file)
@@ -80,7 +80,7 @@ int main(void)
        timer_init();
 
        proc_init();
-       ASSERT(!IRQ_GETSTATE());
+       ASSERT(!IRQ_ENABLED());
 
 
 
@@ -90,7 +90,7 @@ int main(void)
        ser_setparity(host_port, SER_PARITY_NONE);
 
        IRQ_ENABLE;
-       ASSERT(IRQ_GETSTATE());
+       ASSERT(IRQ_ENABLED());
 
        /* Disable all pullups */
        PIOA_PUDR = 0xffffffff;
index 03a0827df5cf9d7518c772e997edb3f60fedcc19..1e68ac2c2d578e6deadb4e7d778ed6c62c74982d 100644 (file)
--- a/cpu/cpu.h
+++ b/cpu/cpu.h
                        set_CPSR(x); \
                } while (0)
 
-               #define IRQ_GETSTATE() \
+               #define IRQ_ENABLED() \
                        ((bool)(get_CPSR() & 0xb0))
 
                #define BREAKPOINT  /* asm("bkpt 0") DOES NOT WORK */
                        sreg; \
                })
 
-               #define IRQ_GETSTATE() (!((CPU_READ_FLAGS() & 0xc0) == 0xc0))
+               #define IRQ_ENABLED() ((CPU_READ_FLAGS() & 0xc0) != 0xc0)
 
                /**
                 * Initialization value for registers in stack frame.
        #define IRQ_ENABLE          FIXME
        #define IRQ_SAVE_DISABLE(x) FIXME
        #define IRQ_RESTORE(x)      FIXME
-       #define IRQ_GETSTATE()      FIXME
+       #define IRQ_ENABLED()      FIXME
 
        typedef uint32_t cpuflags_t; // FIXME
        typedef uint32_t cpustack_t; // FIXME
        }
        #define IRQ_RUNNING() irq_running()
 
-       static inline bool irq_getstate(void)
+       static inline bool irq_enabled(void)
        {
                uint16_t x;
                asm(move SR,x);
                return !(x & 0x0200);
        }
-       #define IRQ_GETSTATE() irq_getstate()
+       #define IRQ_ENABLED() irq_enabled()
 
        typedef uint16_t cpuflags_t;
        typedef unsigned int cpustack_t;
                ); \
        } while (0)
 
-       #define IRQ_GETSTATE() \
+       #define IRQ_ENABLED() \
        ({ \
                uint8_t sreg; \
                __asm__ __volatile__( \
index b25afba5cc53e75fb76777fa59f6f50f3afd6275..9148d930f2f39d5c6d0bd3d7a9a3669b24b5ed23 100644 (file)
@@ -173,9 +173,9 @@ Timer *timer_abort(Timer *timer)
  */
 void timer_delayTicks(ticks_t delay)
 {
-#if defined(IRQ_GETSTATE)
+#if defined(IRQ_ENABLED)
        /* We shouldn't sleep with interrupts disabled */
-       ASSERT(IRQ_GETSTATE());
+       ASSERT(IRQ_ENABLED());
 #endif
 
 #if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS