File tree 4 files changed +10
-5
lines changed
4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 32
32
//
33
33
// Note on IRQ state: you should not need to know the specific
34
34
// value of the state variable, but rather just pass the return
35
- // value from disable_irq back to enable_irq. If you really need
36
- // to know the machine-specific values, see irq.h.
35
+ // value from disable_irq back to enable_irq.
36
+
37
+ // these states correspond to values from query_irq, enable_irq and disable_irq
38
+ #define IRQ_STATE_DISABLED (0x00000001)
39
+ #define IRQ_STATE_ENABLED (0x00000000)
37
40
38
41
#ifndef __disable_irq
39
42
#define __disable_irq () __asm__ volatile ("cpsid i");
@@ -79,6 +82,11 @@ static inline void __set_BASEPRI(uint32_t value) {
79
82
__asm volatile ("msr basepri, %0" : : "r" (value ) : "memory" );
80
83
}
81
84
85
+ __attribute__(( always_inline ))
86
+ static inline uint32_t query_irq (void ) {
87
+ return __get_PRIMASK ();
88
+ }
89
+
82
90
__attribute__(( always_inline ))
83
91
static inline void enable_irq (mp_uint_t state ) {
84
92
__set_PRIMASK (state );
Original file line number Diff line number Diff line change 49
49
#include "telnet.h"
50
50
#include "pybuart.h"
51
51
#include "utils.h"
52
- #include "irq.h"
53
52
54
53
#ifdef USE_FREERTOS
55
54
#include "FreeRTOS.h"
Original file line number Diff line number Diff line change 32
32
#include "py/mphal.h"
33
33
#include "mptask.h"
34
34
#include "task.h"
35
- #include "irq.h"
36
35
37
36
#if MICROPY_PY_THREAD
38
37
Original file line number Diff line number Diff line change 37
37
#include "debug.h"
38
38
#include "serverstask.h"
39
39
#include "genhdr/mpversion.h"
40
- #include "irq.h"
41
40
42
41
/******************************************************************************
43
42
DEFINE PRIVATE CONSTANTS
You can’t perform that action at this time.
0 commit comments