Fixed splhigh/splx for the IAR compiler

This commit is contained in:
Niclas Finne 2011-09-23 15:48:05 +02:00
parent dd8576830e
commit bf299b1a07
2 changed files with 12 additions and 12 deletions

View file

@ -275,16 +275,16 @@ splhigh_(void)
/* /*
* Restore previous interrupt mask. * Restore previous interrupt mask.
*/ */
void /* void */
splx_(int sr) /* splx_(int sr) */
{ /* { */
#ifdef __IAR_SYSTEMS_ICC__ /* #ifdef __IAR_SYSTEMS_ICC__ */
__bis_SR_register(sr); /* __bis_SR_register(sr); */
#else /* #else */
/* If GIE was set, restore it. */ /* /\* If GIE was set, restore it. *\/ */
asmv("bis %0, r2" : : "r" (sr)); /* asmv("bis %0, r2" : : "r" (sr)); */
#endif /* #endif */
} /* } */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* this code will always start the TimerB if not already started */ /* this code will always start the TimerB if not already started */
void void

View file

@ -91,12 +91,12 @@ void msp430_sync_dco(void);
void *sbrk(int); void *sbrk(int);
typedef int spl_t; typedef int spl_t;
void splx_(spl_t); /* void splx_(spl_t); */
spl_t splhigh_(void); spl_t splhigh_(void);
#define splhigh() splhigh_() #define splhigh() splhigh_()
#ifdef __IAR_SYSTEMS_ICC__ #ifdef __IAR_SYSTEMS_ICC__
#define splx(sr) sr = __get_SR_register() #define splx(sr) __bis_SR_register(sr)
#else #else
#define splx(sr) __asm__ __volatile__("bis %0, r2" : : "r" (sr)) #define splx(sr) __asm__ __volatile__("bis %0, r2" : : "r" (sr))
#endif #endif