|
@@ -40,7 +40,7 @@
|
40
|
40
|
// --------------------------------------------------------------------------
|
41
|
41
|
|
42
|
42
|
#include <stdint.h>
|
43
|
|
-
|
|
43
|
+#include <libmaple/atomic.h>
|
44
|
44
|
#include <Arduino.h>
|
45
|
45
|
|
46
|
46
|
// --------------------------------------------------------------------------
|
|
@@ -119,11 +119,11 @@ void HAL_init();
|
119
|
119
|
#define analogInputToDigitalPin(p) (p)
|
120
|
120
|
#endif
|
121
|
121
|
|
122
|
|
-#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
|
123
|
|
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
|
124
|
|
-#define ISRS_ENABLED() (!__get_PRIMASK())
|
125
|
|
-#define ENABLE_ISRS() __enable_irq()
|
126
|
|
-#define DISABLE_ISRS() __disable_irq()
|
|
122
|
+#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); (void)__iCliRetVal()
|
|
123
|
+#define CRITICAL_SECTION_END if (!primask) (void)__iSeiRetVal()
|
|
124
|
+#define ISRS_ENABLED() (!__get_primask)
|
|
125
|
+#define ENABLE_ISRS() ((void)__iSeiRetVal())
|
|
126
|
+#define DISABLE_ISRS() ((void)__iCliRetVal())
|
127
|
127
|
|
128
|
128
|
// On AVR this is in math.h?
|
129
|
129
|
#define square(x) ((x)*(x))
|