Fix other ESP builds and arduino_nano_33_iot

This commit is contained in:
Scott Shawcroft 2022-07-29 11:02:35 -07:00
parent d6344812e8
commit 312e298890
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
5 changed files with 21 additions and 17 deletions

View File

@ -27,7 +27,7 @@
#include "py/runtime.h"
#include "supervisor/esp_port.h"
#include "supervisor/port.h"
#include "shared-bindings/alarm/pin/PinAlarm.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings/microcontroller/__init__.h"
@ -90,11 +90,7 @@ STATIC void gpio_interrupt(void *arg) {
gpio_ll_intr_disable(&GPIO, 32 + i);
}
}
BaseType_t high_task_wakeup;
vTaskNotifyGiveFromISR(circuitpython_task, &high_task_wakeup);
if (high_task_wakeup) {
portYIELD_FROM_ISR();
}
port_wake_main_task_from_isr();
}
bool alarm_pin_pinalarm_woke_this_cycle(void) {

View File

@ -27,7 +27,7 @@
#include "esp_sleep.h"
#include "py/runtime.h"
#include "supervisor/esp_port.h"
#include "supervisor/port.h"
#include "components/esp_timer/include/esp_timer.h"
@ -66,7 +66,7 @@ STATIC bool woke_up = false;
STATIC void timer_callback(void *arg) {
(void)arg;
woke_up = true;
xTaskNotifyGive(circuitpython_task);
port_wake_main_task();
}
bool alarm_time_timealarm_woke_this_cycle(void) {

View File

@ -30,7 +30,7 @@
#include "esp_sleep.h"
#include "peripherals/touch.h"
#include "supervisor/esp_port.h"
#include "supervisor/port.h"
static uint16_t touch_channel_mask;
static volatile bool woke_up = false;
@ -86,11 +86,7 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) {
STATIC void touch_interrupt(void *arg) {
(void)arg;
woke_up = true;
BaseType_t task_wakeup;
vTaskNotifyGiveFromISR(circuitpython_task, &task_wakeup);
if (task_wakeup) {
portYIELD_FROM_ISR();
}
port_wake_main_task_from_isr();
}
void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms) {

View File

@ -27,7 +27,6 @@
#include "py/runtime.h"
#include "supervisor/usb.h"
#include "supervisor/esp_port.h"
#include "supervisor/port.h"
#include "shared/runtime/interrupt_char.h"
#include "shared/readline/readline.h"

View File

@ -40,6 +40,9 @@ static bool _forced_dirty = false;
static bool _suspended = false;
static void title_bar_background(void *data) {
#if !CIRCUITPY_STATUS_BAR
return;
#endif
if (_suspended) {
return;
}
@ -53,7 +56,6 @@ static void title_bar_background(void *data) {
return;
}
_forced_dirty = false;
#if CIRCUITPY_STATUS_BAR
// Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code
// doesn't get terminated after two following characters and the value is invalid.
// This is the OSC command to set the title and the icon text. It can be up to 255 characters
@ -67,16 +69,21 @@ static void title_bar_background(void *data) {
serial_write(MICROPY_GIT_TAG);
// Send string terminator
serial_write("\x1b" "\\");
#endif
}
void supervisor_title_bar_start(void) {
#if !CIRCUITPY_STATUS_BAR
return;
#endif
title_bar_background_cb.fun = title_bar_background;
title_bar_background_cb.data = NULL;
supervisor_title_bar_request_update(true);
}
void supervisor_title_bar_request_update(bool force_dirty) {
#if !CIRCUITPY_STATUS_BAR
return;
#endif
if (force_dirty) {
_forced_dirty = true;
}
@ -84,10 +91,16 @@ void supervisor_title_bar_request_update(bool force_dirty) {
}
void supervisor_title_bar_suspend(void) {
#if !CIRCUITPY_STATUS_BAR
return;
#endif
_suspended = true;
}
void supervisor_title_bar_resume(void) {
#if !CIRCUITPY_STATUS_BAR
return;
#endif
_suspended = false;
supervisor_title_bar_request_update(false);
}