8000 esp32 working after merge · micropython/micropython@f0031ae · GitHub
[go: up one dir, main page]

Skip to content

Commit f0031ae

Browse files
committed
esp32 working after merge
1 parent 1c61594 commit f0031ae

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

extmod/modmachine.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,15 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_deepsleep_obj, 0, 1, machine_deepsle
124124
#endif
125125

126126
#if MICROPY_PY_MACHINE_DISABLE_IRQ_ENABLE_IRQ
127-
uint32_t g_irq_state = 1;
128127
static mp_obj_t machine_disable_irq(void) {
129128
uint32_t state = MICROPY_BEGIN_ATOMIC_SECTION();
130-
g_irq_state = 0;
131129
return mp_obj_new_int(state);
132130
}
133131
static MP_DEFINE_CONST_FUN_OBJ_0(machine_disable_irq_obj, machine_disable_irq);
134132

135133
static mp_obj_t machine_enable_irq(mp_obj_t state_in) {
136-
g_irq_state = mp_obj_get_int(state_in);
137-
MICROPY_END_ATOMIC_SECTION(g_irq_state);
134+
uint32_t irq_state = mp_obj_get_int(state_in);
135+
MICROPY_END_ATOMIC_SECTION(irq_state);
138136
return mp_const_none;
139137
}
140138
static MP_DEFINE_CONST_FUN_OBJ_1(machine_enable_irq_obj, machine_enable_irq);

ports/esp32/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd `dirname $(readlink -f "$0")`
44

5-
export PATH=~/.espressif/python_env/idf5*_env/bin:$PATH
5+
export PATH=~/.espressif/python_env/idf5.2*_env/bin:$PATH
66

77
cd ~/projects/esp-idf
88
source export.sh

ports/esp32/mpthreadport.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,7 @@ void mp_thread_mutex_unlock(mp_thread_mutex_t *mutex) {
222222
// prevent pathological imbalances where a thread unlocks and then
223223
// immediately re-locks a mutex before a context switch can occur, leaving
224224
// another thread waiting for an unbounded period of time.
225-
#if MICROPY_PY_MACHINE_DISABLE_IRQ_ENABLE_IRQ
226-
extern uint32_t g_irq_state;
227-
if(g_irq_state==1)
228-
#endif
229-
taskYIELD();
225+
taskYIELD();
230226
}
231227

232228
void mp_thread_deinit(void) {

0 commit comments

Comments
 (0)
0