File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 29
29
#ifndef INCLUDED_MPHALPORT_H
30
30
#define INCLUDED_MPHALPORT_H
31
31
32
+ #include "freertos/FreeRTOS.h"
32
33
#include "py/ringbuf.h"
33
34
#include "lib/utils/interrupt_char.h"
34
35
35
36
extern ringbuf_t stdin_ringbuf ;
36
37
37
- // TODO implement me
38
- #define disable_irq () 0
39
- #define enable_irq (irq_state ) (void)(irq_state)
38
+ // Note: these "critical nested" macros do not ensure cross-CPU exclusion,
39
+ // the only disable interrupts on the current CPU. To full manage exclusion
40
+ // one should use portENTER_CRITICAL/portEXIT_CRITICAL instead.
41
+ #define disable_irq () portENTER_CRITICAL_NESTED()
42
+ #define enable_irq (irq_state ) portEXIT_CRITICAL_NESTED(irq_state)
40
43
41
44
uint32_t mp_hal_ticks_us (void );
42
45
__attribute__((always_inline )) static inline uint32_t mp_hal_ticks_cpu (void ) {
You can’t perform that action at this time.
0 commit comments