Skip to content

Commit 312e298

Browse files
committed
Fix other ESP builds and arduino_nano_33_iot
1 parent d634481 commit 312e298

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

ports/espressif/common-hal/alarm/pin/PinAlarm.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "py/runtime.h"
2929

30-
#include "supervisor/esp_port.h"
30+
#include "supervisor/port.h"
3131
#include "shared-bindings/alarm/pin/PinAlarm.h"
3232
#include "shared-bindings/microcontroller/Pin.h"
3333
#include "shared-bindings/microcontroller/__init__.h"
@@ -90,11 +90,7 @@ STATIC void gpio_interrupt(void *arg) {
9090
gpio_ll_intr_disable(&GPIO, 32 + i);
9191
}
9292
}
93-
BaseType_t high_task_wakeup;
94-
vTaskNotifyGiveFromISR(circuitpython_task, &high_task_wakeup);
95-
if (high_task_wakeup) {
96-
portYIELD_FROM_ISR();
97-
}
93+
port_wake_main_task_from_isr();
9894
}
9995

10096
bool alarm_pin_pinalarm_woke_this_cycle(void) {

ports/espressif/common-hal/alarm/time/TimeAlarm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "esp_sleep.h"
2828

2929
#include "py/runtime.h"
30-
#include "supervisor/esp_port.h"
30+
#include "supervisor/port.h"
3131

3232
#include "components/esp_timer/include/esp_timer.h"
3333

@@ -66,7 +66,7 @@ STATIC bool woke_up = false;
6666
STATIC void timer_callback(void *arg) {
6767
(void)arg;
6868
woke_up = true;
69-
xTaskNotifyGive(circuitpython_task);
69+
port_wake_main_task();
7070
}
7171

7272
bool alarm_time_timealarm_woke_this_cycle(void) {

ports/espressif/common-hal/alarm/touch/TouchAlarm.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "esp_sleep.h"
3232
#include "peripherals/touch.h"
33-
#include "supervisor/esp_port.h"
33+
#include "supervisor/port.h"
3434

3535
static uint16_t touch_channel_mask;
3636
static volatile bool woke_up = false;
@@ -86,11 +86,7 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) {
8686
STATIC void touch_interrupt(void *arg) {
8787
(void)arg;
8888
woke_up = true;
89-
BaseType_t task_wakeup;
90-
vTaskNotifyGiveFromISR(circuitpython_task, &task_wakeup);
91-
if (task_wakeup) {
92-
portYIELD_FROM_ISR();
93-
}
89+
port_wake_main_task_from_isr();
9490
}
9591

9692
void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms) {

ports/espressif/supervisor/usb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
#include "py/runtime.h"
2929
#include "supervisor/usb.h"
30-
#include "supervisor/esp_port.h"
3130
#include "supervisor/port.h"
3231
#include "shared/runtime/interrupt_char.h"
3332
#include "shared/readline/readline.h"

supervisor/shared/title_bar.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ static bool _forced_dirty = false;
4040
static bool _suspended = false;
4141

4242
static void title_bar_background(void *data) {
43+
#if !CIRCUITPY_STATUS_BAR
44+
return;
45+
#endif
4346
if (_suspended) {
4447
return;
4548
}
@@ -53,7 +56,6 @@ static void title_bar_background(void *data) {
5356
return;
5457
}
5558
_forced_dirty = false;
56-
#if CIRCUITPY_STATUS_BAR
5759
// Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code
5860
// doesn't get terminated after two following characters and the value is invalid.
5961
// This is the OSC command to set the title and the icon text. It can be up to 255 characters
@@ -67,27 +69,38 @@ static void title_bar_background(void *data) {
6769
serial_write(MICROPY_GIT_TAG);
6870
// Send string terminator
6971
serial_write("\x1b" "\\");
70-
#endif
7172
}
7273

7374
void supervisor_title_bar_start(void) {
75+
#if !CIRCUITPY_STATUS_BAR
76+
return;
77+
#endif
7478
title_bar_background_cb.fun = title_bar_background;
7579
title_bar_background_cb.data = NULL;
7680
supervisor_title_bar_request_update(true);
7781
}
7882

7983
void supervisor_title_bar_request_update(bool force_dirty) {
84+
#if !CIRCUITPY_STATUS_BAR
85+
return;
86+
#endif
8087
if (force_dirty) {
8188
_forced_dirty = true;
8289
}
8390
background_callback_add_core(&title_bar_background_cb);
8491
}
8592

8693
void supervisor_title_bar_suspend(void) {
94+
#if !CIRCUITPY_STATUS_BAR
95+
return;
96+
#endif
8797
_suspended = true;
8898
}
8999

90100
void supervisor_title_bar_resume(void) {
101+
#if !CIRCUITPY_STATUS_BAR
102+
return;
103+
#endif
91104
_suspended = false;
92105
supervisor_title_bar_request_update(false);
93106
}

0 commit comments

Comments
 (0)