From 61e6ca0b100a4eaaf53964c9ac97ac642677036f Mon Sep 17 00:00:00 2001 From: Kelvin Lawson Date: Mon, 21 Jun 2010 21:43:07 +0100 Subject: [PATCH] STM8: Add critical region macros for Raisonance STM8 compiler. --- ports/stm8/atomport.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/stm8/atomport.h b/ports/stm8/atomport.h index a94f80c..119c2b5 100644 --- a/ports/stm8/atomport.h +++ b/ports/stm8/atomport.h @@ -35,6 +35,8 @@ #if defined(__IAR_SYSTEMS_ICC__) #include "intrinsics.h" +#elif defined (__RCSTM8__) +#include #endif @@ -67,6 +69,12 @@ #define CRITICAL_STORE __istate_t _istate #define CRITICAL_START() _istate = __get_interrupt_state(); __disable_interrupt() #define CRITICAL_END() __set_interrupt_state(_istate) + +/* Raisonance: Use intrinsics */ +#elif defined(__RCSTM8__) +#define CRITICAL_STORE unsigned char ccr +#define CRITICAL_START() ccr = _getCC_(); _sim_() +#define CRITICAL_END() _setCC_(ccr) #endif /* Uncomment to enable stack-checking */