File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed
Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 121121
122122#define MP_STATE_PORT MP_STATE_VM
123123
124- // These functions allow nested calls.
125- extern void target_disable_irq (void );
126- extern void target_enable_irq (void );
127-
128- static inline uint32_t disable_irq (void ) {
129- target_disable_irq ();
130- return 0 ;
131- }
132-
133- static inline void enable_irq (uint32_t state ) {
134- (void )state ;
135- target_enable_irq ();
136- }
137-
138- #define MICROPY_BEGIN_ATOMIC_SECTION () disable_irq()
139- #define MICROPY_END_ATOMIC_SECTION (state ) enable_irq(state)
140-
141124#define MICROPY_MAKE_POINTER_CALLABLE (p ) ((void *)((uint32_t)(p) | 1))
142125
143126#define MP_SSIZE_MAX (0x7fffffff)
Original file line number Diff line number Diff line change 2828#include "microbithal.h"
2929#include "nrf.h"
3030
31+ #define MICROPY_BEGIN_ATOMIC_SECTION () disable_irq()
32+ #define MICROPY_END_ATOMIC_SECTION (state ) enable_irq(state)
33+
34+ // These functions allow nested calls.
35+ extern void target_disable_irq (void );
36+ extern void target_enable_irq (void );
37+
38+ static inline uint32_t disable_irq (void ) {
39+ target_disable_irq ();
40+ return 0 ;
41+ }
42+
43+ static inline void enable_irq (uint32_t state ) {
44+ (void )state ;
45+ target_enable_irq ();
46+ }
47+
3148static inline mp_uint_t mp_hal_ticks_cpu (void ) {
3249 if (!(DWT -> CTRL & DWT_CTRL_CYCCNTENA_Msk )) {
3350 CoreDebug -> DEMCR |= CoreDebug_DEMCR_TRCENA_Msk ;
You can’t perform that action at this time.
0 commit comments