diff --git a/MicroPython_BUILD/components/micropython/Kconfig.projbuild b/MicroPython_BUILD/components/micropython/Kconfig.projbuild index b167a4e2..072be2b4 100644 --- a/MicroPython_BUILD/components/micropython/Kconfig.projbuild +++ b/MicroPython_BUILD/components/micropython/Kconfig.projbuild @@ -100,6 +100,14 @@ menu "MicroPython" bool "Verbose" endchoice + config MICROPY_USE_THREADED_REPL + bool "Start REPL in separate thread" + default n + help + Start the REPL in its own thread + Running REPL in thread may solve some issues with uasyncio + and long running or infinite loops + config MICROPY_RX_BUFFER_SIZE int "RX buffer size" range 256 4096 @@ -121,6 +129,7 @@ menu "MicroPython" help Run MicroPython tasks on both cores, if not selected MicroPython tasks are created pinned to one core WARNING: When enabled, it may introduce some issues with uasyncio and threads + not recommended for now! config MICROPY_TASK_PRIORITY int "Main task priority" @@ -131,9 +140,9 @@ menu "MicroPython" config MICROPY_STACK_SIZE int "MicroPython stack size (KB)" - range 8 32 if !SPIRAM_SUPPORT - range 8 64 if SPIRAM_SUPPORT - default 20 + range 6 32 if !SPIRAM_SUPPORT + range 6 64 if SPIRAM_SUPPORT + default 16 help Set the size of the MicroPython stack in Kbytes. diff --git a/MicroPython_BUILD/components/micropython/esp32/machine_rtc.c b/MicroPython_BUILD/components/micropython/esp32/machine_rtc.c index 8b3c1864..f4da3112 100644 --- a/MicroPython_BUILD/components/micropython/esp32/machine_rtc.c +++ b/MicroPython_BUILD/components/micropython/esp32/machine_rtc.c @@ -50,6 +50,8 @@ #define RTC_MEM_INT_SIZE 64 #define RTC_MEM_STR_SIZE 2048 +char mpy_time_zone[64] = {'\0'}; + static int RTC_DATA_ATTR rtc_mem_int[RTC_MEM_INT_SIZE] = { 0 }; static char RTC_DATA_ATTR rtc_mem_str[RTC_MEM_STR_SIZE] = { 0 }; static uint16_t RTC_DATA_ATTR rtc_mem_int_crc; @@ -268,6 +270,29 @@ void sntp_task (void *pvParameters) vTaskDelete(NULL); } +//-------------------------------------------- +void tz_fromto_NVS(char *gettzs, char *settzs) +{ + size_t len = 0; + char value[64] = {'\0'}; + if (gettzs) { + gettzs[0] = '\0'; + esp_err_t ret = nvs_get_str(mpy_nvs_handle, "MpyTimeZone", NULL, &len); + if ((ret == ESP_OK ) && (len > 0) && (len < 64)) { + esp_err_t ret = nvs_get_str(mpy_nvs_handle, "MpyTimeZone", value, &len); + if ((ret == ESP_OK ) && (len > 0) && (len < 64)) { + if (gettzs) strcpy(gettzs, value); + } + } + } + if (settzs) { + esp_err_t esp_err = nvs_set_str(mpy_nvs_handle, "MpyTimeZone", settzs); + if (ESP_OK == esp_err) { + nvs_commit(mpy_nvs_handle); + } + } +} + //--------------------------------------------------------------------------------------------- STATIC mp_obj_t mach_rtc_ntp_sync(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { static const mp_arg_t allowed_args[] = { @@ -291,23 +316,30 @@ STATIC mp_obj_t mach_rtc_ntp_sync(size_t n_args, const mp_obj_t *pos_args, mp_ma if ((strlen(srvn) > 3) && (strlen(srvn) < 64)) sprintf(srv_name, "%s", srvn); } - char tz[64]; - #ifdef MICROPY_TIMEZONE - // ===== Set time zone ====== - sprintf(tz, "%s", MICROPY_TIMEZONE); + if (strlen(mpy_time_zone) == 0) { + // Try to get tz from NVS + tz_fromto_NVS(mpy_time_zone, NULL); + if (strlen(mpy_time_zone) == 0) { + #ifdef MICROPY_TIMEZONE + // ===== Set default time zone ====== + snprintf(mpy_time_zone, sizeof(mpy_time_zone)-1, "%s", MICROPY_TIMEZONE); + #endif + } + } + if (args[2].u_obj != mp_const_none) { + // get TZ argument const char *tzs = mp_obj_str_get_str(args[2].u_obj); - if (strlen(tzs) < 64) { - sprintf(tz, "%s", tzs); + if ((strlen(tzs) < 2) && (strlen(tzs) < 64)) { + sprintf(mpy_time_zone, "%s", tzs); + tz_fromto_NVS(NULL, mpy_time_zone); + } + else { + mp_raise_ValueError("tz string length must be 3 - 64"); } } - setenv("TZ", tz, 1); + setenv("TZ", mpy_time_zone, 1); tzset(); - // ========================== - #else - tz[0] = '\0'; - #endif - if (sntp_mutex == NULL) { // Create sntp mutex diff --git a/MicroPython_BUILD/components/micropython/esp32/machine_rtc.h b/MicroPython_BUILD/components/micropython/esp32/machine_rtc.h index d8b4af65..f1900c3f 100644 --- a/MicroPython_BUILD/components/micropython/esp32/machine_rtc.h +++ b/MicroPython_BUILD/components/micropython/esp32/machine_rtc.h @@ -29,9 +29,11 @@ #ifndef MACHRTC_H_ #define MACHRTC_H_ +extern char mpy_time_zone[64]; extern const mp_obj_type_t mach_rtc_type; extern xSemaphoreHandle sntp_mutex; void rtc_init0(void); +void tz_fromto_NVS(char *gettzs, char *settzs); #endif // MACHRTC_H_ diff --git a/MicroPython_BUILD/components/micropython/esp32/machine_timer.c b/MicroPython_BUILD/components/micropython/esp32/machine_timer.c index 532ac87f..badb7a37 100644 --- a/MicroPython_BUILD/components/micropython/esp32/machine_timer.c +++ b/MicroPython_BUILD/components/micropython/esp32/machine_timer.c @@ -670,7 +670,7 @@ STATIC const mp_map_elem_t machine_timer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_init), (mp_obj_t)&machine_timer_init_obj }, { MP_ROM_QSTR(MP_QSTR_value), (mp_obj_t)&machine_timer_value_obj }, { MP_ROM_QSTR(MP_QSTR_events), (mp_obj_t)&machine_timer_events_obj }, - { MP_ROM_QSTR(MP_QSTR_reshot), (mp_obj_t)&machine_timer_shot_obj }, + { MP_ROM_QSTR(MP_QSTR_reshoot), (mp_obj_t)&machine_timer_shot_obj }, { MP_ROM_QSTR(MP_QSTR_start), (mp_obj_t)&machine_timer_start_obj }, { MP_ROM_QSTR(MP_QSTR_stop), (mp_obj_t)&machine_timer_pause_obj }, { MP_ROM_QSTR(MP_QSTR_pause), (mp_obj_t)&machine_timer_pause_obj }, diff --git a/MicroPython_BUILD/components/micropython/esp32/machine_uart.c b/MicroPython_BUILD/components/micropython/esp32/machine_uart.c index da425885..b0ca9662 100644 --- a/MicroPython_BUILD/components/micropython/esp32/machine_uart.c +++ b/MicroPython_BUILD/components/micropython/esp32/machine_uart.c @@ -63,6 +63,7 @@ typedef struct _machine_uart_obj_t { uint32_t *data_cb; uint32_t *pattern_cb; uint32_t *error_cb; + uint32_t inverted; uint8_t end_task; uint8_t lineend[3]; } machine_uart_obj_t; @@ -149,10 +150,10 @@ static void _sched_callback(mp_obj_t function, int uart, int type, int iarglen, if (!make_carg_entry(carg, 0, MP_SCHED_ENTRY_TYPE_INT, uart, NULL, NULL)) return; if (!make_carg_entry(carg, 1, MP_SCHED_ENTRY_TYPE_INT, type, NULL, NULL)) return; if (sarg) { - if (!make_carg_entry(carg, 2, MP_SCHED_ENTRY_TYPE_INT, iarglen, NULL, NULL)) return; + if (!make_carg_entry(carg, 2, MP_SCHED_ENTRY_TYPE_STR, iarglen, sarg, NULL)) return; } else { - if (!make_carg_entry(carg, 2, MP_SCHED_ENTRY_TYPE_STR, iarglen, sarg, NULL)) return; + if (!make_carg_entry(carg, 2, MP_SCHED_ENTRY_TYPE_INT, iarglen, NULL, NULL)) return; } mp_sched_schedule(function, mp_const_none, carg); } @@ -281,9 +282,10 @@ static const mp_arg_t allowed_args[] = { { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = -1} }, { MP_QSTR_buffer_size, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 512} }, { MP_QSTR_lineend, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_inverted, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_int = -1} }, }; -enum { ARG_baudrate, ARG_bits, ARG_parity, ARG_stop, ARG_tx, ARG_rx, ARG_rts, ARG_cts, ARG_timeout, ARG_buffer_size, ARG_lineend }; +enum { ARG_baudrate, ARG_bits, ARG_parity, ARG_stop, ARG_tx, ARG_rx, ARG_rts, ARG_cts, ARG_timeout, ARG_buffer_size, ARG_lineend, ARG_inverted }; //----------------------------------------------------------------------------------------------- STATIC void machine_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { @@ -314,10 +316,28 @@ STATIC void machine_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_pri lnend_idx++; } } - - mp_printf(print, "UART(%u, baudrate=%u, bits=%u, parity=%s, stop=%s, tx=%d, rx=%d, rts=%d, cts=%d, timeout=%u, buf_size=%u, lineend=b'%s')", + char inverted[24] = {'\0'}; + if (self->inverted & (uint32_t)UART_INVERSE_RXD) { + if (inverted[0] != '\0') strcat(inverted, ", "); + strcat(inverted, "RX"); + } + if (self->inverted & (uint32_t)UART_INVERSE_TXD) { + if (inverted[0] != '\0') strcat(inverted, ", "); + strcat(inverted, "TX"); + } + if (self->inverted & (uint32_t)UART_INVERSE_CTS) { + if (inverted[0] != '\0') strcat(inverted, ", "); + strcat(inverted, "CTS"); + } + if (self->inverted & (uint32_t)UART_INVERSE_RTS) { + if (inverted[0] != '\0') strcat(inverted, ", "); + strcat(inverted, "RTS"); + } + printf("INV %08x, %08x\n", self->inverted, (uint32_t)UART_INVERSE_TXD); + mp_printf(print, "UART(%u, baudrate=%u, bits=%u, parity=%s, stop=%s, tx=%d, rx=%d, rts=%d, cts=%d, inverted: [%s]\n", self->uart_num+1, baudrate, self->bits, _parity_name[self->parity], _stopbits_name[self->stop], - self->tx, self->rx, self->rts, self->cts, self->timeout, self->buffer_size, lnend); + self->tx, self->rx, self->rts, self->cts, inverted); + mp_printf(print, " timeout=%u, buf_size=%u, lineend=b'%s')", self->timeout, self->buffer_size, lnend); if (self->data_cb) { mp_printf(print, "\n data CB: True, on len: %d", self->data_cb_size); } @@ -420,6 +440,12 @@ STATIC void machine_uart_init_helper(machine_uart_obj_t *self, size_t n_args, co } } + // set inverted pins + if ((args[ARG_inverted].u_int > -1) && (args[ARG_inverted].u_int != self->inverted)) { + self->inverted = args[ARG_inverted].u_int & (UART_INVERSE_RXD | UART_INVERSE_TXD | UART_INVERSE_RTS | UART_INVERSE_CTS); + uart_set_line_inverse(self->uart_num+1, self->inverted); + } + // set pins if (((self->tx == -2) && (args[ARG_tx].u_int == UART_PIN_NO_CHANGE)) || ((self->rx == -2) && (args[ARG_rx].u_int == UART_PIN_NO_CHANGE))) { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "Tx&Rx pins must be set: u=machine.UART(uart_num, tx=pin, rx=pin)")); @@ -435,8 +461,16 @@ STATIC void machine_uart_init_helper(machine_uart_obj_t *self, size_t n_args, co if (args[ARG_tx].u_int != UART_PIN_NO_CHANGE) self->tx = args[ARG_tx].u_int; if (args[ARG_rx].u_int != UART_PIN_NO_CHANGE) self->rx = args[ARG_rx].u_int; - if (args[ARG_rts].u_int != UART_PIN_NO_CHANGE) self->rts = args[ARG_rts].u_int; - if (args[ARG_cts].u_int != UART_PIN_NO_CHANGE) self->cts = args[ARG_cts].u_int; + if ((self->rts != args[ARG_rts].u_int) || (self->cts != args[ARG_cts].u_int)) { + if (args[ARG_rts].u_int != UART_PIN_NO_CHANGE) self->rts = args[ARG_rts].u_int; + if (args[ARG_cts].u_int != UART_PIN_NO_CHANGE) self->cts = args[ARG_cts].u_int; + // set flow control + int fwc = 0; + if (self->rts >= 0) fwc |= UART_HW_FLOWCTRL_RTS; + if (self->cts >= 0) fwc |= UART_HW_FLOWCTRL_CTS; + // Only when UART_HW_FLOWCTRL_RTS is set, will the rx_thresh value be set. + uart_set_hw_flow_ctrl(self->uart_num+1, fwc, UART_FIFO_LEN / 4 * 3); + } } // set timeout @@ -496,6 +530,7 @@ STATIC mp_obj_t machine_uart_make_new(const mp_obj_type_t *type, size_t n_args, self->stop = UART_STOP_BITS_1; self->rts = UART_PIN_NO_CHANGE; self->cts = UART_PIN_NO_CHANGE; + self->inverted = UART_INVERSE_DISABLE; self->timeout = 0; self->pattern[0] = 0; self->pattern_len = 0; @@ -773,6 +808,33 @@ STATIC mp_obj_t machine_uart_callback(size_t n_args, const mp_obj_t *pos_args, m } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_uart_callback_obj, 2, machine_uart_callback); +//--------------------------------------------------------------------------- +STATIC mp_obj_t machine_uart_write_break(size_t n_args, const mp_obj_t *args) +{ + machine_uart_obj_t *self = MP_OBJ_TO_PTR(args[0]); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_READ); + + // break signal length + // unit: one BIT time at current_baudrate + int nbreak = nbreak = mp_obj_get_int_truncated(args[2]); + if ((nbreak < 1) || (nbreak > 255)) { + mp_raise_ValueError("values 1 - 255 are allowed"); + } + + int len = bufinfo.len; + if (n_args == 4) { + len = mp_obj_get_int_truncated(args[3]); + if ((len < 0) || (len > bufinfo.len)) len = bufinfo.len;; + } + + int bytes_written = uart_write_bytes_with_break(self->uart_num+1, (const char*)bufinfo.buf, len, nbreak); + + return MP_OBJ_NEW_SMALL_INT(bytes_written); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_uart_write_break_obj, 3, 4, machine_uart_write_break); + //================================================================= STATIC const mp_rom_map_elem_t machine_uart_locals_dict_table[] = { @@ -783,6 +845,7 @@ STATIC const mp_rom_map_elem_t machine_uart_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_write_break), MP_ROM_PTR(&machine_uart_write_break_obj) }, { MP_ROM_QSTR(MP_QSTR_readln), MP_ROM_PTR(&machine_uart_readln_obj) }, { MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&machine_uart_flush_obj) }, { MP_ROM_QSTR(MP_QSTR_callback), MP_ROM_PTR(&machine_uart_callback_obj) }, @@ -791,6 +854,12 @@ STATIC const mp_rom_map_elem_t machine_uart_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_CBTYPE_DATA), MP_ROM_INT(UART_CB_TYPE_DATA) }, { MP_ROM_QSTR(MP_QSTR_CBTYPE_PATTERN), MP_ROM_INT(UART_CB_TYPE_PATTERN) }, { MP_ROM_QSTR(MP_QSTR_CBTYPE_ERROR), MP_ROM_INT(UART_CB_TYPE_ERROR) }, + + { MP_ROM_QSTR(MP_QSTR_INV_RX), MP_ROM_INT(UART_INVERSE_RXD >> 1) }, + { MP_ROM_QSTR(MP_QSTR_INV_TX), MP_ROM_INT(UART_INVERSE_TXD >> 1) }, + { MP_ROM_QSTR(MP_QSTR_INV_CTS), MP_ROM_INT(UART_INVERSE_CTS >> 1) }, + { MP_ROM_QSTR(MP_QSTR_INV_RTS), MP_ROM_INT(UART_INVERSE_RTS >> 1) }, + { MP_ROM_QSTR(MP_QSTR_INV_NONE), MP_ROM_INT(0) }, }; STATIC MP_DEFINE_CONST_DICT(machine_uart_locals_dict, machine_uart_locals_dict_table); diff --git a/MicroPython_BUILD/components/micropython/esp32/main.c b/MicroPython_BUILD/components/micropython/esp32/main.c index b9ff4495..7d586eac 100644 --- a/MicroPython_BUILD/components/micropython/esp32/main.c +++ b/MicroPython_BUILD/components/micropython/esp32/main.c @@ -26,6 +26,7 @@ #include #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -63,6 +64,8 @@ #include "mqtt.h" #endif +#include "driver/uart.h" +#include "rom/uart.h" #include "sdkconfig.h" @@ -72,21 +75,16 @@ #define NVS_NAMESPACE "MPY_NVM" #define MP_TASK_PRIORITY CONFIG_MICROPY_TASK_PRIORITY -#define MP_TASK_STACK_SIZE (CONFIG_MICROPY_STACK_SIZE * 1024) -#define MP_TASK_HEAP_SIZE (CONFIG_MICROPY_HEAP_SIZE * 1024) -#define MP_TASK_STACK_LEN (MP_TASK_STACK_SIZE / sizeof(StackType_t)) - -STATIC TaskHandle_t MainTaskHandle = NULL; +#define MP_TASK_STACK_LEN 3072 -STATIC StaticTask_t DRAM_ATTR mp_task_tcb; -STATIC StackType_t DRAM_ATTR mp_task_stack[MP_TASK_STACK_LEN] __attribute__((aligned (8))); - -STATIC uint8_t *mp_task_heap; +static StaticTask_t DRAM_ATTR mp_task_tcb; +static StackType_t *mp_task_stack; +static uint8_t *mp_task_heap; +static int mp_task_stack_len = 4092; int MainTaskCore = 0; -#include "driver/uart.h" -#include "rom/uart.h" + //=============================== void mp_task(void *pvParameter) { volatile uint32_t sp = (uint32_t)get_sp(); @@ -121,38 +119,34 @@ void mp_task(void *pvParameter) { // ------------------------------------------------------------------------------------------------------------- */ - #ifdef CONFIG_MICROPY_USE_TASK_WDT - // Enable watchdog for MicroPython main task - esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, false); - esp_task_wdt_add(MainTaskHandle); - esp_task_wdt_reset(); - #endif - uart_init(); - // Check and open NVS name space - if (nvs_open(NVS_NAMESPACE, NVS_READWRITE, &mpy_nvs_handle) != ESP_OK) { - mpy_nvs_handle = 0; - printf("Error while opening MicroPython NVS name space\n"); - } + #if CONFIG_BOOT_SET_LED >= 0 + // Deactivate boot led + gpio_pad_select_gpio(CONFIG_BOOT_SET_LED); + GPIO_OUTPUT_SET(CONFIG_BOOT_SET_LED, CONFIG_BOOT_LED_ON ^ 1); + #endif - // Get and print reset & wakeup reasons + // Get and print reset & wakeup reasons mpsleep_init0(); if (mpsleep_get_reset_cause() != MPSLEEP_DEEPSLEEP_RESET) rtc_init0(); - mp_thread_preinit(&mp_task_stack[0], MP_TASK_STACK_LEN); + mp_thread_preinit(&mp_task_stack[0], mp_task_stack_len); -soft_reset: // Thread init mp_thread_init(); // Initialize the stack pointer for the main thread mp_stack_set_top((void *)sp); - mp_stack_set_limit(MP_TASK_STACK_SIZE - 1024); + #ifdef CONFIG_MICROPY_USE_THREADED_REPL + mp_stack_set_limit(mp_task_stack_len - 256); + #else + mp_stack_set_limit(mp_task_stack_len - 1024); + #endif // initialize the mp heap - gc_init(mp_task_heap, mp_task_heap + MP_TASK_HEAP_SIZE); + gc_init(mp_task_heap, mp_task_heap + mpy_heap_size); mp_init(); mp_obj_list_init(mp_sys_path, 0); @@ -168,12 +162,6 @@ void mp_task(void *pvParameter) { // === Mount internal flash file system === int res = mount_vfs(VFS_NATIVE_TYPE_SPIFLASH, VFS_NATIVE_INTERNAL_MP); - #if CONFIG_BOOT_SET_LED >= 0 - // Deactivate boot led - gpio_pad_select_gpio(CONFIG_BOOT_SET_LED); - GPIO_OUTPUT_SET(CONFIG_BOOT_SET_LED, CONFIG_BOOT_LED_ON ^ 1); - #endif - if (res == 0) { // run boot-up script 'boot.py' pyexec_file("boot.py"); @@ -187,7 +175,7 @@ void mp_task(void *pvParameter) { } } } - else printf("Error mounting Flash file system\n"); + else ESP_LOGE("MicroPython", "Error mounting Flash file system"); // === Print some info === char sbuff[24] = { 0 }; @@ -225,7 +213,11 @@ void mp_task(void *pvParameter) { printf("Wakeup source: %s\n", sbuff); } - printf(" uPY stack: %d bytes\n", MP_TASK_STACK_LEN-1024); + #ifdef CONFIG_MICROPY_USE_THREADED_REPL + printf(" REPL stack: %d bytes\n", mpy_repl_stack_size); + #else + printf(" uPY stack: %d bytes\n", mp_task_stack_len); + #endif #if CONFIG_SPIRAM_SUPPORT // ## USING SPI RAM FOR HEAP ## @@ -242,32 +234,63 @@ void mp_task(void *pvParameter) { #endif // === Main loop ================================== - for (;;) { - if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) { - if (pyexec_raw_repl() != 0) { - break; - } - } - else { - if (pyexec_friendly_repl() != 0) { - break; - } - } - } + MP_THREAD_GIL_EXIT(); + + #ifdef CONFIG_MICROPY_USE_TASK_WDT + // Enable watchdog for MicroPython main task + esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, false); + esp_task_wdt_add(MainTaskHandle); + esp_task_wdt_reset(); + #endif + + #ifdef CONFIG_MICROPY_USE_THREADED_REPL + // === Start REPL in separate thread === + pyexec_frozen_module("modREPL.py"); + #ifdef CONFIG_MICROPY_USE_TASK_WDT + if (ReplTaskHandle) { + // Enable watchdog for MicroPython main task + esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, false); + esp_task_wdt_add(ReplTaskHandle); + esp_task_wdt_reset(); + } + #endif + if (!ReplTaskHandle) { + printf("!! Error starting threaded REPL, Halted. !!\n"); + } + while (1) { + // Main task just waits doing nothing + vTaskDelay(CONFIG_TASK_WDT_TIMEOUT_S * 500 / portTICK_RATE_MS); + #ifdef CONFIG_MICROPY_USE_TASK_WDT + esp_task_wdt_reset(); + #endif + } + #else + // === Start REPL in main task === + ReplTaskHandle = MainTaskHandle; + for (;;) { + if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) { + if (pyexec_raw_repl() != 0) { + break; + } + } + else { + if (pyexec_friendly_repl() != 0) { + break; + } + } + } + #endif // ================================================ - //ToDo: Remember the REPL mode !! + //ToDo: Remember the REPL mode (is it needed ?) !! prepareSleepReset(0, "ESP32: soft reboot\r\n"); - esp_restart(); - - goto soft_reset; + esp_restart(); // no return !! } //============================ -void micropython_entry(void) { - ESP_LOGI("MicroPython", "[=== Started ===]"); - +void micropython_entry(void) +{ // === Set esp32 log levels while running MicroPython === if (CONFIG_MICRO_PY_LOG_LEVEL < CONFIG_LOG_DEFAULT_LEVEL) esp_log_level_set("*", CONFIG_MICRO_PY_LOG_LEVEL); if ((CONFIG_LOG_DEFAULT_LEVEL > ESP_LOG_WARN) && (CONFIG_MICRO_PY_LOG_LEVEL > ESP_LOG_WARN)){ @@ -285,8 +308,6 @@ void micropython_entry(void) { else esp_log_level_set("OTA_UPDATE", CONFIG_LOG_DEFAULT_LEVEL); #endif - nvs_flash_init(); - #ifdef CONFIG_MICROPY_USE_MQTT esp_log_level_set(MQTT_TAG, CONFIG_MQTT_LOG_LEVEL); #endif @@ -294,19 +315,77 @@ void micropython_entry(void) { esp_log_level_set(FTP_TAG, CONFIG_FTPSERVER_LOG_LEVEL); #endif + nvs_flash_init(); + + // === Check and allocate stack === + // Open NVS name space + if (nvs_open(NVS_NAMESPACE, NVS_READWRITE, &mpy_nvs_handle) != ESP_OK) { + mpy_nvs_handle = 0; + ESP_LOGE("MicroPython","Error while opening MicroPython NVS name space"); + } + if (mpy_nvs_handle != 0) { + // Get stack size from NVS + if (ESP_ERR_NVS_NOT_FOUND == nvs_get_i32(mpy_nvs_handle, "MPY_StackSize", &mpy_repl_stack_size)) { + mpy_repl_stack_size = CONFIG_MICROPY_STACK_SIZE * 1024; + } + else { + if ((mpy_repl_stack_size < MPY_MIN_STACK_SIZE) || (mpy_repl_stack_size > MPY_MAX_STACK_SIZE)) { + mpy_repl_stack_size = CONFIG_MICROPY_STACK_SIZE * 1024; + ESP_LOGE("MicroPython","Wrong Stack size set in NVS: %d (set to configured: %d)", mpy_heap_size, CONFIG_MICROPY_HEAP_SIZE * 1024); + } + else { + ESP_LOGW("MicroPython","Stack size set from NVS: %d (configured: %d)", mpy_repl_stack_size, CONFIG_MICROPY_STACK_SIZE * 1024); + } + } + // restore time zone + tz_fromto_NVS(mpy_time_zone, NULL); + if (strlen(mpy_time_zone) > 0) { + setenv("TZ", mpy_time_zone, 1); + tzset(); + } + } + mpy_repl_stack_size &= 0x7FFFFFFC; + + #ifdef CONFIG_MICROPY_USE_THREADED_REPL + mp_task_stack_len = MP_TASK_STACK_LEN; + #else + mp_task_stack_len = mpy_repl_stack_size; + #endif + mp_task_stack = heap_caps_malloc(mp_task_stack_len, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); + if (mp_task_stack == NULL) { + printf("Error allocating stack, Halted.\n"); + return; + } + // ==== Allocate heap memory ==== + if (mpy_nvs_handle != 0) { + // Get heap size from NVS + if (ESP_ERR_NVS_NOT_FOUND == nvs_get_i32(mpy_nvs_handle, "MPY_HeapSize", &mpy_heap_size)) { + mpy_heap_size = CONFIG_MICROPY_HEAP_SIZE * 1024; + } + else { + if ((mpy_heap_size < MPY_MIN_HEAP_SIZE) || (mpy_heap_size > MPY_MAX_HEAP_SIZE)) { + mpy_heap_size = CONFIG_MICROPY_HEAP_SIZE * 1024; + ESP_LOGE("MicroPython","Wrong Heap size set in NVS: %d (set to configured: %d)", mpy_heap_size, CONFIG_MICROPY_HEAP_SIZE * 1024); + } + else { + ESP_LOGW("MicroPython","Heap size set from NVS: %d (configured: %d)", mpy_heap_size, CONFIG_MICROPY_HEAP_SIZE * 1024); + } + } + } + mpy_heap_size &= 0x7FFFFFFC; #if CONFIG_SPIRAM_SUPPORT // ## USING SPI RAM FOR HEAP ## #if CONFIG_SPIRAM_USE_CAPS_ALLOC - mp_task_heap = heap_caps_malloc(MP_TASK_HEAP_SIZE, MALLOC_CAP_SPIRAM); + mp_task_heap = heap_caps_malloc(mpy_heap_size, MALLOC_CAP_SPIRAM); #elif SPIRAM_USE_MEMMAP mp_task_heap = (uint8_t *)0x3f800000; #else - mp_task_heap = malloc(MP_TASK_HEAP_SIZE); + mp_task_heap = malloc(mpy_heap_size); #endif #else // ## USING DRAM FOR HEAP ## - mp_task_heap = malloc(MP_TASK_HEAP_SIZE); + mp_task_heap = malloc(mpy_heap_size); #endif if (mp_task_heap == NULL) { @@ -318,16 +397,17 @@ void micropython_entry(void) { periph_module_disable(PERIPH_I2C0_MODULE); periph_module_enable(PERIPH_I2C0_MODULE); + printf("\n[=== MicroPython started ===]\n"); // ==== Create and start main MicroPython task ==== #if CONFIG_FREERTOS_UNICORE MainTaskCore = 0; - MainTaskHandle = xTaskCreateStaticPinnedToCore(&mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 0); + MainTaskHandle = xTaskCreateStaticPinnedToCore(&mp_task, "mp_task", mp_task_stack_len, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 0); #else MainTaskCore = 1; #if CONFIG_MICROPY_USE_BOTH_CORES - MainTaskHandle = xTaskCreateStatic(&mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb); + MainTaskHandle = xTaskCreateStatic(&mp_task, "mp_task", mp_task_stack_len, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb); #else - MainTaskHandle = xTaskCreateStaticPinnedToCore(&mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 1); + MainTaskHandle = xTaskCreateStaticPinnedToCore(&mp_task, "mp_task", mp_task_stack_len, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 1); #endif #endif } diff --git a/MicroPython_BUILD/components/micropython/esp32/modmachine.c b/MicroPython_BUILD/components/micropython/esp32/modmachine.c index 96280556..bcdae4b0 100644 --- a/MicroPython_BUILD/components/micropython/esp32/modmachine.c +++ b/MicroPython_BUILD/components/micropython/esp32/modmachine.c @@ -72,6 +72,8 @@ nvs_handle mpy_nvs_handle = 0; machine_rtc_config_t RTC_DATA_ATTR machine_rtc_config = {0}; +int mpy_repl_stack_size = CONFIG_MICROPY_STACK_SIZE * 1024; +int mpy_heap_size = CONFIG_MICROPY_HEAP_SIZE * 1024; // === Variables stored in RTC_SLOW_MEM === @@ -862,6 +864,47 @@ STATIC mp_obj_t mod_machine_set_wdt() { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_machine_set_wdt_obj, mod_machine_set_wdt); +//----------------------------------------------------------------------- +static void _set_stack_heap(char *key, int value, int valmin, int valmax) +{ + checkNVS(); + + if ((value != 0) && ((value < valmin) || (value > valmax))) { + mp_raise_msg(&mp_type_OSError, "Invalid size"); + } + + esp_err_t esp_err = nvs_set_i32(mpy_nvs_handle, key, value); + if (ESP_OK == esp_err) { + nvs_commit(mpy_nvs_handle); + } + else if (ESP_ERR_NVS_NOT_ENOUGH_SPACE == esp_err || ESP_ERR_NVS_PAGE_FULL == esp_err || ESP_ERR_NVS_NO_FREE_PAGES == esp_err) { + mp_raise_msg(&mp_type_OSError, "No space available for NVS variable."); + } + else if (ESP_ERR_NVS_INVALID_NAME == esp_err || ESP_ERR_NVS_KEY_TOO_LONG == esp_err) { + mp_raise_msg(&mp_type_OSError, "NVS Key invalid or too long"); + } +} + +//---------------------------------------------------------- +STATIC mp_obj_t mod_machine_set_stack_size (mp_obj_t _value) +{ + int value = mp_obj_get_int_truncated(_value); + value &= 0x7FFFFFFC; + _set_stack_heap("MPY_StackSize", value, MPY_MIN_STACK_SIZE, MPY_MAX_STACK_SIZE); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_machine_set_stack_size_obj, mod_machine_set_stack_size); + +//----------------------------------------------------------- +STATIC mp_obj_t mod_machine_set_heap_size (mp_obj_t _value) +{ + int value = mp_obj_get_int_truncated(_value); + value &= 0x7FFFFFFC; + _set_stack_heap("MPY_HeapSize", value, MPY_MIN_HEAP_SIZE, MPY_MAX_HEAP_SIZE); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_machine_set_heap_size_obj, mod_machine_set_heap_size); + //=============================================================== STATIC const mp_rom_map_elem_t machine_module_globals_table[] = { @@ -882,6 +925,8 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_wake_description), MP_ROM_PTR(&machine_wake_desc_obj) }, { MP_ROM_QSTR(MP_QSTR_heap_info), MP_ROM_PTR(&machine_heap_info_obj) }, { MP_ROM_QSTR(MP_QSTR_stdin_disable), MP_ROM_PTR(&mod_machine_stdin_disable_obj) }, + { MP_ROM_QSTR(MP_QSTR_SetStackSize), MP_ROM_PTR(&mod_machine_set_stack_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_SetHeapSize), MP_ROM_PTR(&mod_machine_set_heap_size_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_nvs_setint), MP_ROM_PTR(&mod_machine_nvs_set_int_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_nvs_getint), MP_ROM_PTR(&mod_machine_nvs_get_int_obj) }, diff --git a/MicroPython_BUILD/components/micropython/esp32/modmachine.h b/MicroPython_BUILD/components/micropython/esp32/modmachine.h index 71dafdc5..8015b770 100644 --- a/MicroPython_BUILD/components/micropython/esp32/modmachine.h +++ b/MicroPython_BUILD/components/micropython/esp32/modmachine.h @@ -31,11 +31,27 @@ #ifndef MICROPY_INCLUDED_ESP32_MODMACHINE_H #define MICROPY_INCLUDED_ESP32_MODMACHINE_H +#include "sdkconfig.h" #include "nvs_flash.h" #include "nvs.h" #include "py/obj.h" #include "driver/rtc_io.h" +#define MPY_MIN_STACK_SIZE (6*1024) +#if CONFIG_SPIRAM_SUPPORT +#define MPY_MAX_STACK_SIZE (64*1024) +#define MPY_MIN_HEAP_SIZE (128*1024) +#define MPY_MAX_HEAP_SIZE (3584*1024) +#else +#define MPY_MAX_STACK_SIZE (32*1024) +#define MPY_MIN_HEAP_SIZE (48*1024) +#if defined(CONFIG_MICROPY_USE_CURL) && defined(CONFIG_MICROPY_USE_CURL_TLS) +#define MPY_MAX_HEAP_SIZE (72*1024) +#else +#define MPY_MAX_HEAP_SIZE (96*1024) +#endif +#endif + #define EXT1_WAKEUP_ALL_HIGH 2 //!< Wake the chip when all selected GPIOs go high #define EXT1_WAKEUP_MAX_PINS 4 @@ -76,6 +92,8 @@ extern const mp_obj_type_t machine_onewire_type; extern const mp_obj_type_t machine_ds18x20_type; extern nvs_handle mpy_nvs_handle; +extern int mpy_repl_stack_size; +extern int mpy_heap_size; void machine_pins_init(void); void machine_pins_deinit(void); diff --git a/MicroPython_BUILD/components/micropython/esp32/modules/modREPL.py b/MicroPython_BUILD/components/micropython/esp32/modules/modREPL.py new file mode 100644 index 00000000..f0f43921 --- /dev/null +++ b/MicroPython_BUILD/components/micropython/esp32/modules/modREPL.py @@ -0,0 +1,11 @@ +import _thread +import sys + +def thREPL(): + while True: + print(">>> Starting REPL in thread <<<\n") + sys.REPL() + +_thread.stack_size(sys.stackSize()) +REPLthread = _thread.start_new_thread("REPLthread", thREPL, ()) +_thread.stack_size(4096) diff --git a/MicroPython_BUILD/components/micropython/esp32/mpthreadport.c b/MicroPython_BUILD/components/micropython/esp32/mpthreadport.c index 665814cd..660a5824 100644 --- a/MicroPython_BUILD/components/micropython/esp32/mpthreadport.c +++ b/MicroPython_BUILD/components/micropython/esp32/mpthreadport.c @@ -63,6 +63,7 @@ extern TaskHandle_t FtpTaskHandle; extern int MainTaskCore; TaskHandle_t MainTaskHandle = NULL; +TaskHandle_t ReplTaskHandle = NULL; uint8_t main_accept_msg = 1; @@ -200,7 +201,13 @@ STATIC void freertos_entry(void *arg) { //------------------------------------------------------------------------------------------------------------------------------ TaskHandle_t mp_thread_create_ex(void *(*entry)(void*), void *arg, size_t *stack_size, int priority, char *name, bool same_core) { - // store thread entry function into a global variable so we can access it + bool is_repl = (strcmp(name, "REPLthread") == 0); + if (is_repl) { + if (ReplTaskHandle) { + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "REPL thread already started")); + } + } + // store thread entry function into a global variable so we can access it ext_thread_entry = entry; // Check thread stack size @@ -247,6 +254,7 @@ TaskHandle_t mp_thread_create_ex(void *(*entry)(void*), void *arg, size_t *stack nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "can't create thread")); } + if (is_repl) ReplTaskHandle = id; // adjust the stack_size to provide room to recover from hitting the limit //*stack_size -= 1024; @@ -265,7 +273,8 @@ TaskHandle_t mp_thread_create_ex(void *(*entry)(void*), void *arg, size_t *stack th->waiting = 0; th->deleted = 0; th->notifyed = 0; - th->type = THREAD_TYPE_PYTHON; + if (is_repl) th->type = THREAD_TYPE_REPL; + else th->type = THREAD_TYPE_PYTHON; thread = th; mp_thread_mutex_unlock(&thread_mutex); @@ -682,6 +691,23 @@ int mp_thread_list(thread_list_t *list) { int mp_thread_replAcceptMsg(int8_t accept) { int res = main_accept_msg; mp_thread_mutex_lock(&thread_mutex, 1); + for (thread_t *th = thread; th != NULL; th = th->next) { + if (th->id == xTaskGetCurrentTaskHandle()) { + if ((th->id == ReplTaskHandle) && (accept >= 0)) { + main_accept_msg = accept & 1; + } + break; + } + } + mp_thread_mutex_unlock(&thread_mutex); + + return res; +} + +//------------------------------------------ +int mp_thread_mainAcceptMsg(int8_t accept) { + int res = main_accept_msg; + mp_thread_mutex_lock(&thread_mutex, 1); for (thread_t *th = thread; th != NULL; th = th->next) { if (th->id == xTaskGetCurrentTaskHandle()) { if ((th->id == MainTaskHandle) && (accept >= 0)) { diff --git a/MicroPython_BUILD/components/micropython/esp32/mpthreadport.h b/MicroPython_BUILD/components/micropython/esp32/mpthreadport.h index a8900902..ab3348f6 100644 --- a/MicroPython_BUILD/components/micropython/esp32/mpthreadport.h +++ b/MicroPython_BUILD/components/micropython/esp32/mpthreadport.h @@ -39,6 +39,7 @@ #define THREAD_TYPE_MAIN 1 #define THREAD_TYPE_PYTHON 2 #define THREAD_TYPE_SERVICE 3 +#define THREAD_TYPE_REPL 3 // Reserved thread notification constants #define THREAD_NOTIFY_PAUSE 0x01000000 @@ -112,6 +113,9 @@ typedef struct _thread_list_t { threadlistitem_t *threads; // pointer to thread info } thread_list_t; +extern TaskHandle_t MainTaskHandle; +extern TaskHandle_t ReplTaskHandle; + thread_msg_t thread_messages[MAX_THREAD_MESSAGES]; uint8_t main_accept_msg; @@ -140,6 +144,7 @@ int mp_thread_getSelfname(char *name); int mp_thread_getname(TaskHandle_t id, char *name); int mp_thread_list(thread_list_t *list); int mp_thread_replAcceptMsg(int8_t accept); +int mp_thread_mainAcceptMsg(int8_t accept); #ifdef CONFIG_MICROPY_USE_TELNET uintptr_t mp_thread_createTelnetTask(size_t stack_size); diff --git a/MicroPython_BUILD/components/micropython/esp32/mpversion.h b/MicroPython_BUILD/components/micropython/esp32/mpversion.h index 48298436..81c77efc 100644 --- a/MicroPython_BUILD/components/micropython/esp32/mpversion.h +++ b/MicroPython_BUILD/components/micropython/esp32/mpversion.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#define MICROPY_GIT_TAG "ESP32_LoBo_v3.2.11" +#define MICROPY_GIT_TAG "ESP32_LoBo_v3.2.12" #define MICROPY_GIT_HASH "gbae9709a" -#define MICROPY_BUILD_DATE "2018-04-16" +#define MICROPY_BUILD_DATE "2018-04-18" #define MICROPY_VERSION_MAJOR (3) #define MICROPY_VERSION_MINOR (2) -#define MICROPY_VERSION_MICRO (11) -#define MICROPY_VERSION_STRING "3.2.11" +#define MICROPY_VERSION_MICRO (12) +#define MICROPY_VERSION_STRING "3.2.12" #define MICROPY_CORE_VERSION "59dda71" #define MICROPY_CORE_DATE "2018-04-10" diff --git a/MicroPython_BUILD/components/micropython/genhdr/qstrdefs.generated.h b/MicroPython_BUILD/components/micropython/genhdr/qstrdefs.generated.h new file mode 100644 index 00000000..1649d4de --- /dev/null +++ b/MicroPython_BUILD/components/micropython/genhdr/qstrdefs.generated.h @@ -0,0 +1,1155 @@ +// This file was automatically generated by makeqstrdata.py + +QDEF(MP_QSTR_NULL, (const byte*)"\x00\x00\x00" "") +QDEF(MP_QSTR_, (const byte*)"\x05\x15\x00" "") +QDEF(MP_QSTR___abs__, (const byte*)"\x95\xd6\x07" "__abs__") +QDEF(MP_QSTR___add__, (const byte*)"\xc4\x82\x07" "__add__") +QDEF(MP_QSTR___aenter__, (const byte*)"\x4c\x84\x0a" "__aenter__") +QDEF(MP_QSTR___aexit__, (const byte*)"\xc4\xcf\x09" "__aexit__") +QDEF(MP_QSTR___aiter__, (const byte*)"\x4e\x2b\x09" "__aiter__") +QDEF(MP_QSTR___and__, (const byte*)"\x0e\xdb\x07" "__and__") +QDEF(MP_QSTR___anext__, (const byte*)"\x83\xb4\x09" "__anext__") +QDEF(MP_QSTR___bool__, (const byte*)"\x2b\x65\x08" "__bool__") +QDEF(MP_QSTR___build_class__, (const byte*)"\x42\x88\x0f" "__build_class__") +QDEF(MP_QSTR___call__, (const byte*)"\xa7\xf9\x08" "__call__") +QDEF(MP_QSTR___class__, (const byte*)"\x2b\xc5\x09" "__class__") +QDEF(MP_QSTR___contains__, (const byte*)"\xc6\x5f\x0c" "__contains__") +QDEF(MP_QSTR___del__, (const byte*)"\x68\x37\x07" "__del__") +QDEF(MP_QSTR___delitem__, (const byte*)"\xfd\x35\x0b" "__delitem__") +QDEF(MP_QSTR___dict__, (const byte*)"\x7f\x54\x08" "__dict__") +QDEF(MP_QSTR___divmod__, (const byte*)"\x78\x11\x0a" "__divmod__") +QDEF(MP_QSTR___enter__, (const byte*)"\x6d\xba\x09" "__enter__") +QDEF(MP_QSTR___eq__, (const byte*)"\x71\x3e\x06" "__eq__") +QDEF(MP_QSTR___exit__, (const byte*)"\x45\xf8\x08" "__exit__") +QDEF(MP_QSTR___file__, (const byte*)"\x03\x54\x08" "__file__") +QDEF(MP_QSTR___floordiv__, (const byte*)"\x46\x5f\x0c" "__floordiv__") +QDEF(MP_QSTR___ge__, (const byte*)"\xa7\x46\x06" "__ge__") +QDEF(MP_QSTR___getattr__, (const byte*)"\x40\xf8\x0b" "__getattr__") +QDEF(MP_QSTR___getitem__, (const byte*)"\x26\x39\x0b" "__getitem__") +QDEF(MP_QSTR___gt__, (const byte*)"\xb6\x82\x06" "__gt__") +QDEF(MP_QSTR___hash__, (const byte*)"\xf7\xc8\x08" "__hash__") +QDEF(MP_QSTR___iadd__, (const byte*)"\x6d\x4a\x08" "__iadd__") +QDEF(MP_QSTR___import__, (const byte*)"\x38\x3e\x0a" "__import__") +QDEF(MP_QSTR___init__, (const byte*)"\x5f\xa5\x08" "__init__") +QDEF(MP_QSTR___invert__, (const byte*)"\xf7\x77\x0a" "__invert__") +QDEF(MP_QSTR___isub__, (const byte*)"\x08\x78\x08" "__isub__") +QDEF(MP_QSTR___iter__, (const byte*)"\xcf\x32\x08" "__iter__") +QDEF(MP_QSTR___le__, (const byte*)"\xcc\x13\x06" "__le__") +QDEF(MP_QSTR___len__, (const byte*)"\xe2\xb0\x07" "__len__") +QDEF(MP_QSTR___lshift__, (const byte*)"\x09\x88\x0a" "__lshift__") +QDEF(MP_QSTR___lt__, (const byte*)"\x5d\x68\x06" "__lt__") +QDEF(MP_QSTR___main__, (const byte*)"\x8e\x13\x08" "__main__") +QDEF(MP_QSTR___mod__, (const byte*)"\x63\x37\x07" "__mod__") +QDEF(MP_QSTR___module__, (const byte*)"\xff\x30\x0a" "__module__") +QDEF(MP_QSTR___mul__, (const byte*)"\x31\x42\x07" "__mul__") +QDEF(MP_QSTR___name__, (const byte*)"\xe2\x38\x08" "__name__") +QDEF(MP_QSTR___neg__, (const byte*)"\x69\xd5\x07" "__neg__") +QDEF(MP_QSTR___new__, (const byte*)"\x79\x15\x07" "__new__") +QDEF(MP_QSTR___next__, (const byte*)"\x02\x73\x08" "__next__") +QDEF(MP_QSTR___or__, (const byte*)"\x38\xbb\x06" "__or__") +QDEF(MP_QSTR___path__, (const byte*)"\xc8\x23\x08" "__path__") +QDEF(MP_QSTR___pos__, (const byte*)"\x29\xf0\x07" "__pos__") +QDEF(MP_QSTR___pow__, (const byte*)"\x2d\x00\x07" "__pow__") +QDEF(MP_QSTR___qualname__, (const byte*)"\x6b\x00\x0c" "__qualname__") +QDEF(MP_QSTR___repl_print__, (const byte*)"\x00\xbb\x0e" "__repl_print__") +QDEF(MP_QSTR___repr__, (const byte*)"\x10\x0b\x08" "__repr__") +QDEF(MP_QSTR___reversed__, (const byte*)"\x61\xff\x0c" "__reversed__") +QDEF(MP_QSTR___rshift__, (const byte*)"\x57\x98\x0a" "__rshift__") +QDEF(MP_QSTR___setitem__, (const byte*)"\x32\x3e\x0b" "__setitem__") +QDEF(MP_QSTR___str__, (const byte*)"\xd0\xcd\x07" "__str__") +QDEF(MP_QSTR___sub__, (const byte*)"\x21\x09\x07" "__sub__") +QDEF(MP_QSTR___traceback__, (const byte*)"\x4f\xcf\x0d" "__traceback__") +QDEF(MP_QSTR___truediv__, (const byte*)"\x88\xef\x0b" "__truediv__") +QDEF(MP_QSTR___xor__, (const byte*)"\x20\xec\x07" "__xor__") +QDEF(MP_QSTR__star_, (const byte*)"\x8f\xb5\x01" "*") +QDEF(MP_QSTR__, (const byte*)"\xfa\xb5\x01" "_") +QDEF(MP_QSTR__slash_, (const byte*)"\x8a\xb5\x01" "/") +QDEF(MP_QSTR__percent__hash_o, (const byte*)"\x6c\x1a\x03" "%#o") +QDEF(MP_QSTR__percent__hash_x, (const byte*)"\x7b\x1a\x03" "%#x") +QDEF(MP_QSTR__brace_open__colon__hash_b_brace_close_, (const byte*)"\x58\x37\x05" "{:#b}") +QDEF(MP_QSTR__space_, (const byte*)"\x85\xb5\x01" " ") +QDEF(MP_QSTR__0x0a_, (const byte*)"\xaf\xb5\x01" "\x0a") +QDEF(MP_QSTR_maximum_space_recursion_space_depth_space_exceeded, (const byte*)"\x73\x1e\x20" "maximum recursion depth exceeded") +QDEF(MP_QSTR__lt_module_gt_, (const byte*)"\xbd\x94\x08" "") +QDEF(MP_QSTR__lt_lambda_gt_, (const byte*)"\x80\x8c\x08" "") +QDEF(MP_QSTR__lt_listcomp_gt_, (const byte*)"\xd4\x15\x0a" "") +QDEF(MP_QSTR__lt_dictcomp_gt_, (const byte*)"\xcc\x8d\x0a" "") +QDEF(MP_QSTR__lt_setcomp_gt_, (const byte*)"\x54\x51\x09" "") +QDEF(MP_QSTR__lt_genexpr_gt_, (const byte*)"\x34\x6a\x09" "") +QDEF(MP_QSTR__lt_string_gt_, (const byte*)"\x52\x53\x08" "") +QDEF(MP_QSTR__lt_stdin_gt_, (const byte*)"\xe3\x63\x07" "") +QDEF(MP_QSTR_utf_hyphen_8, (const byte*)"\xb7\x82\x05" "utf-8") +QDEF(MP_QSTR__slash_lib, (const byte*)"\x8d\x9c\x04" "/lib") +QDEF(MP_QSTR_ADC, (const byte*)"\x63\xb6\x03" "ADC") +QDEF(MP_QSTR_AF_INET, (const byte*)"\xeb\xb7\x07" "AF_INET") +QDEF(MP_QSTR_AF_INET6, (const byte*)"\x7d\xb5\x08" "AF_INET6") +QDEF(MP_QSTR_AP_IF, (const byte*)"\x04\x96\x05" "AP_IF") +QDEF(MP_QSTR_ARRAY, (const byte*)"\x5c\x7a\x05" "ARRAY") +QDEF(MP_QSTR_ATTN_0DB, (const byte*)"\x23\x45\x08" "ATTN_0DB") +QDEF(MP_QSTR_ATTN_11DB, (const byte*)"\x13\x1d\x09" "ATTN_11DB") +QDEF(MP_QSTR_ATTN_2_5DB, (const byte*)"\xeb\xf6\x0a" "ATTN_2_5DB") +QDEF(MP_QSTR_ATTN_6DB, (const byte*)"\x25\x2d\x08" "ATTN_6DB") +QDEF(MP_QSTR_AUTH_OPEN, (const byte*)"\x46\xb3\x09" "AUTH_OPEN") +QDEF(MP_QSTR_AUTH_WEP, (const byte*)"\xf0\x0d\x08" "AUTH_WEP") +QDEF(MP_QSTR_AUTH_WPA2_PSK, (const byte*)"\xf1\xfe\x0d" "AUTH_WPA2_PSK") +QDEF(MP_QSTR_AUTH_WPA_PSK, (const byte*)"\xc3\x6c\x0c" "AUTH_WPA_PSK") +QDEF(MP_QSTR_AUTH_WPA_WPA2_PSK, (const byte*)"\xe8\x79\x11" "AUTH_WPA_WPA2_PSK") +QDEF(MP_QSTR_ArithmeticError, (const byte*)"\x2d\x8c\x0f" "ArithmeticError") +QDEF(MP_QSTR_AssertionError, (const byte*)"\x97\x5a\x0e" "AssertionError") +QDEF(MP_QSTR_AttributeError, (const byte*)"\x21\xde\x0e" "AttributeError") +QDEF(MP_QSTR_BFINT16, (const byte*)"\x95\xe2\x07" "BFINT16") +QDEF(MP_QSTR_BFINT32, (const byte*)"\x53\xe2\x07" "BFINT32") +QDEF(MP_QSTR_BFINT8, (const byte*)"\x4a\x9a\x06" "BFINT8") +QDEF(MP_QSTR_BFUINT16, (const byte*)"\x40\xa6\x08" "BFUINT16") +QDEF(MP_QSTR_BFUINT32, (const byte*)"\x06\xa6\x08" "BFUINT32") +QDEF(MP_QSTR_BFUINT8, (const byte*)"\xbf\xaf\x07" "BFUINT8") +QDEF(MP_QSTR_BF_LEN, (const byte*)"\x19\xb0\x06" "BF_LEN") +QDEF(MP_QSTR_BF_POS, (const byte*)"\x52\x9d\x06" "BF_POS") +QDEF(MP_QSTR_BIG_ENDIAN, (const byte*)"\xff\x51\x0a" "BIG_ENDIAN") +QDEF(MP_QSTR_BLACK, (const byte*)"\x82\x4d\x05" "BLACK") +QDEF(MP_QSTR_BLUE, (const byte*)"\x3b\x3b\x04" "BLUE") +QDEF(MP_QSTR_BMP, (const byte*)"\x9a\xc3\x03" "BMP") +QDEF(MP_QSTR_BOTTOM, (const byte*)"\x6a\x29\x06" "BOTTOM") +QDEF(MP_QSTR_BaseException, (const byte*)"\x07\x92\x0d" "BaseException") +QDEF(MP_QSTR_BufferedWriter, (const byte*)"\xeb\x2c\x0e" "BufferedWriter") +QDEF(MP_QSTR_BytesIO, (const byte*)"\x1a\xb7\x07" "BytesIO") +QDEF(MP_QSTR_CBTYPE_DATA, (const byte*)"\xb3\x6c\x0b" "CBTYPE_DATA") +QDEF(MP_QSTR_CBTYPE_ERROR, (const byte*)"\xbb\xe6\x0c" "CBTYPE_ERROR") +QDEF(MP_QSTR_CBTYPE_PATTERN, (const byte*)"\xab\xb3\x0e" "CBTYPE_PATTERN") +QDEF(MP_QSTR_CB_DATA, (const byte*)"\x6b\x50\x07" "CB_DATA") +QDEF(MP_QSTR_CB_READ, (const byte*)"\x49\x33\x07" "CB_READ") +QDEF(MP_QSTR_CB_WRITE, (const byte*)"\xc6\xca\x08" "CB_WRITE") +QDEF(MP_QSTR_CENTER, (const byte*)"\x8e\xdb\x06" "CENTER") +QDEF(MP_QSTR_CHRONO, (const byte*)"\x32\xd2\x06" "CHRONO") +QDEF(MP_QSTR_COLOR_BITS16, (const byte*)"\x8c\x23\x0c" "COLOR_BITS16") +QDEF(MP_QSTR_COLOR_BITS24, (const byte*)"\xad\x23\x0c" "COLOR_BITS24") +QDEF(MP_QSTR_CYAN, (const byte*)"\x10\x26\x04" "CYAN") +QDEF(MP_QSTR_DAC, (const byte*)"\x03\xba\x03" "DAC") +QDEF(MP_QSTR_DARKCYAN, (const byte*)"\x0c\xab\x08" "DARKCYAN") +QDEF(MP_QSTR_DARKGREEN, (const byte*)"\x42\x23\x09" "DARKGREEN") +QDEF(MP_QSTR_DARKGREY, (const byte*)"\x90\xf1\x08" "DARKGREY") +QDEF(MP_QSTR_DEBUG, (const byte*)"\x34\x6d\x05" "DEBUG") +QDEF(MP_QSTR_DESC, (const byte*)"\x34\x0d\x04" "DESC") +QDEF(MP_QSTR_DHT, (const byte*)"\x3d\xbb\x03" "DHT") +QDEF(MP_QSTR_DHT11, (const byte*)"\x5d\x80\x05" "DHT11") +QDEF(MP_QSTR_DHT2X, (const byte*)"\x97\x80\x05" "DHT2X") +QDEF(MP_QSTR_DecompIO, (const byte*)"\x93\xb7\x08" "DecompIO") +QDEF(MP_QSTR_EACCES, (const byte*)"\x37\xc2\x06" "EACCES") +QDEF(MP_QSTR_EADDRINUSE, (const byte*)"\x17\x11\x0a" "EADDRINUSE") +QDEF(MP_QSTR_EAGAIN, (const byte*)"\x20\xec\x06" "EAGAIN") +QDEF(MP_QSTR_EALREADY, (const byte*)"\x46\x15\x08" "EALREADY") +QDEF(MP_QSTR_EBADF, (const byte*)"\x61\xa3\x05" "EBADF") +QDEF(MP_QSTR_ECONNABORTED, (const byte*)"\x27\xab\x0c" "ECONNABORTED") +QDEF(MP_QSTR_ECONNREFUSED, (const byte*)"\x3a\x2c\x0c" "ECONNREFUSED") +QDEF(MP_QSTR_ECONNRESET, (const byte*)"\x19\xfb\x0a" "ECONNRESET") +QDEF(MP_QSTR_EEXIST, (const byte*)"\x53\xad\x06" "EEXIST") +QDEF(MP_QSTR_EHOSTUNREACH, (const byte*)"\x86\x25\x0c" "EHOSTUNREACH") +QDEF(MP_QSTR_EINPROGRESS, (const byte*)"\x9a\xa0\x0b" "EINPROGRESS") +QDEF(MP_QSTR_EINVAL, (const byte*)"\x5c\xff\x06" "EINVAL") +QDEF(MP_QSTR_EIO, (const byte*)"\x86\xa6\x03" "EIO") +QDEF(MP_QSTR_EISDIR, (const byte*)"\xa5\x4f\x06" "EISDIR") +QDEF(MP_QSTR_ENOBUFS, (const byte*)"\xe3\x87\x07" "ENOBUFS") +QDEF(MP_QSTR_ENODEV, (const byte*)"\xb6\x67\x06" "ENODEV") +QDEF(MP_QSTR_ENOENT, (const byte*)"\x5e\x65\x06" "ENOENT") +QDEF(MP_QSTR_ENOMEM, (const byte*)"\xa4\x85\x06" "ENOMEM") +QDEF(MP_QSTR_ENOTCONN, (const byte*)"\x79\xd7\x08" "ENOTCONN") +QDEF(MP_QSTR_EOFError, (const byte*)"\x91\xbf\x08" "EOFError") +QDEF(MP_QSTR_EOPNOTSUPP, (const byte*)"\xac\x97\x0a" "EOPNOTSUPP") +QDEF(MP_QSTR_EPERM, (const byte*)"\xea\x7f\x05" "EPERM") +QDEF(MP_QSTR_ETIMEDOUT, (const byte*)"\xff\xf8\x09" "ETIMEDOUT") +QDEF(MP_QSTR_EXIT, (const byte*)"\x45\xc7\x04" "EXIT") +QDEF(MP_QSTR_EXT1_ALLHIGH, (const byte*)"\x0d\x4a\x0c" "EXT1_ALLHIGH") +QDEF(MP_QSTR_EXT1_ALLLOW, (const byte*)"\x77\xa6\x0b" "EXT1_ALLLOW") +QDEF(MP_QSTR_EXT1_ANYHIGH, (const byte*)"\x1a\xc2\x0c" "EXT1_ANYHIGH") +QDEF(MP_QSTR_EXT1_ANYLOW, (const byte*)"\x40\xb0\x0b" "EXT1_ANYLOW") +QDEF(MP_QSTR_EXTBASE, (const byte*)"\x19\x3d\x07" "EXTBASE") +QDEF(MP_QSTR_EXTENDED, (const byte*)"\x42\x69\x08" "EXTENDED") +QDEF(MP_QSTR_Ellipsis, (const byte*)"\xf0\xe0\x08" "Ellipsis") +QDEF(MP_QSTR_Exception, (const byte*)"\xf2\x29\x09" "Exception") +QDEF(MP_QSTR_FLOAT32, (const byte*)"\xb4\x87\x07" "FLOAT32") +QDEF(MP_QSTR_FLOAT64, (const byte*)"\x17\x87\x07" "FLOAT64") +QDEF(MP_QSTR_FONT_7seg, (const byte*)"\x0f\x87\x09" "FONT_7seg") +QDEF(MP_QSTR_FONT_Comic, (const byte*)"\xa2\xd2\x0a" "FONT_Comic") +QDEF(MP_QSTR_FONT_Default, (const byte*)"\x22\xdc\x0c" "FONT_Default") +QDEF(MP_QSTR_FONT_DefaultSmall, (const byte*)"\x5d\x0b\x11" "FONT_DefaultSmall") +QDEF(MP_QSTR_FONT_DejaVu18, (const byte*)"\xa9\xa8\x0d" "FONT_DejaVu18") +QDEF(MP_QSTR_FONT_DejaVu24, (const byte*)"\x86\xa8\x0d" "FONT_DejaVu24") +QDEF(MP_QSTR_FONT_Minya, (const byte*)"\x3b\xc1\x0a" "FONT_Minya") +QDEF(MP_QSTR_FONT_Small, (const byte*)"\x16\x43\x0a" "FONT_Small") +QDEF(MP_QSTR_FONT_Tooney, (const byte*)"\xef\xf6\x0b" "FONT_Tooney") +QDEF(MP_QSTR_FONT_Ubuntu, (const byte*)"\xa4\xfb\x0b" "FONT_Ubuntu") +QDEF(MP_QSTR_FileIO, (const byte*)"\xc5\x15\x06" "FileIO") +QDEF(MP_QSTR_FrameBuffer, (const byte*)"\xd8\xbe\x0b" "FrameBuffer") +QDEF(MP_QSTR_FrameBuffer1, (const byte*)"\xe9\x99\x0c" "FrameBuffer1") +QDEF(MP_QSTR_GENERIC, (const byte*)"\x54\x0c\x07" "GENERIC") +QDEF(MP_QSTR_GRAY, (const byte*)"\x08\xc6\x04" "GRAY") +QDEF(MP_QSTR_GREEN, (const byte*)"\xde\x98\x05" "GREEN") +QDEF(MP_QSTR_GREENYELLOW, (const byte*)"\xda\x02\x0b" "GREENYELLOW") +QDEF(MP_QSTR_GS2_HMSB, (const byte*)"\x28\xc3\x08" "GS2_HMSB") +QDEF(MP_QSTR_GS4_HMSB, (const byte*)"\x6e\x73\x08" "GS4_HMSB") +QDEF(MP_QSTR_GS8, (const byte*)"\xa9\xc0\x03" "GS8") +QDEF(MP_QSTR_GeneratorExit, (const byte*)"\x16\x62\x0d" "GeneratorExit") +QDEF(MP_QSTR_HALL, (const byte*)"\x4c\x8d\x04" "HALL") +QDEF(MP_QSTR_HSBtoRGB, (const byte*)"\xd0\x92\x08" "HSBtoRGB") +QDEF(MP_QSTR_HSBtoRGBint, (const byte*)"\xe3\xfa\x0b" "HSBtoRGBint") +QDEF(MP_QSTR_HSPI, (const byte*)"\xc7\xe9\x04" "HSPI") +QDEF(MP_QSTR_I2C, (const byte*)"\x5d\xdf\x03" "I2C") +QDEF(MP_QSTR_ILI9341, (const byte*)"\x86\x05\x07" "ILI9341") +QDEF(MP_QSTR_ILI9488, (const byte*)"\x84\x12\x07" "ILI9488") +QDEF(MP_QSTR_IN, (const byte*)"\x22\x73\x02" "IN") +QDEF(MP_QSTR_INCL, (const byte*)"\x0d\xbb\x04" "INCL") +QDEF(MP_QSTR_INOUT, (const byte*)"\xcc\x4f\x05" "INOUT") +QDEF(MP_QSTR_INOUT_OD, (const byte*)"\xf8\xd2\x08" "INOUT_OD") +QDEF(MP_QSTR_INT16, (const byte*)"\x91\x76\x05" "INT16") +QDEF(MP_QSTR_INT32, (const byte*)"\x57\x76\x05" "INT32") +QDEF(MP_QSTR_INT64, (const byte*)"\xf4\x75\x05" "INT64") +QDEF(MP_QSTR_INT8, (const byte*)"\xce\xbd\x04" "INT8") +QDEF(MP_QSTR_INV_CTS, (const byte*)"\x8f\x67\x07" "INV_CTS") +QDEF(MP_QSTR_INV_NONE, (const byte*)"\xa1\x85\x08" "INV_NONE") +QDEF(MP_QSTR_INV_RTS, (const byte*)"\x5e\xac\x07" "INV_RTS") +QDEF(MP_QSTR_INV_RX, (const byte*)"\x61\xde\x06" "INV_RX") +QDEF(MP_QSTR_INV_TX, (const byte*)"\xa7\xde\x06" "INV_TX") +QDEF(MP_QSTR_IPPROTO_IP, (const byte*)"\x0c\x8e\x0a" "IPPROTO_IP") +QDEF(MP_QSTR_IPPROTO_TCP, (const byte*)"\xb2\xde\x0b" "IPPROTO_TCP") +QDEF(MP_QSTR_IPPROTO_UDP, (const byte*)"\x54\xdb\x0b" "IPPROTO_UDP") +QDEF(MP_QSTR_IP_ADD_MEMBERSHIP, (const byte*)"\x6f\x5b\x11" "IP_ADD_MEMBERSHIP") +QDEF(MP_QSTR_IRQ, (const byte*)"\xaf\xda\x03" "IRQ") +QDEF(MP_QSTR_IRQ_ANYEDGE, (const byte*)"\x05\x5a\x0b" "IRQ_ANYEDGE") +QDEF(MP_QSTR_IRQ_FALLING, (const byte*)"\x37\xc0\x0b" "IRQ_FALLING") +QDEF(MP_QSTR_IRQ_HILEVEL, (const byte*)"\xe7\x05\x0b" "IRQ_HILEVEL") +QDEF(MP_QSTR_IRQ_LOLEVEL, (const byte*)"\x25\xb6\x0b" "IRQ_LOLEVEL") +QDEF(MP_QSTR_IRQ_RISING, (const byte*)"\x78\xed\x0a" "IRQ_RISING") +QDEF(MP_QSTR_ImportError, (const byte*)"\x20\x9c\x0b" "ImportError") +QDEF(MP_QSTR_IndentationError, (const byte*)"\x5c\x20\x10" "IndentationError") +QDEF(MP_QSTR_IndexError, (const byte*)"\x83\xad\x0a" "IndexError") +QDEF(MP_QSTR_JPG, (const byte*)"\x38\xe7\x03" "JPG") +QDEF(MP_QSTR_KeyError, (const byte*)"\xea\x00\x08" "KeyError") +QDEF(MP_QSTR_KeyboardInterrupt, (const byte*)"\xaf\xe2\x11" "KeyboardInterrupt") +QDEF(MP_QSTR_LANDSCAPE, (const byte*)"\xa6\x7b\x09" "LANDSCAPE") +QDEF(MP_QSTR_LANDSCAPE_FLIP, (const byte*)"\xca\x5c\x0e" "LANDSCAPE_FLIP") +QDEF(MP_QSTR_LASTX, (const byte*)"\x57\x45\x05" "LASTX") +QDEF(MP_QSTR_LASTY, (const byte*)"\x56\x45\x05" "LASTY") +QDEF(MP_QSTR_LIGHTGREY, (const byte*)"\xd2\x77\x09" "LIGHTGREY") +QDEF(MP_QSTR_LIME, (const byte*)"\xe8\x3c\x04" "LIME") +QDEF(MP_QSTR_LITTLE_ENDIAN, (const byte*)"\xbf\x5b\x0d" "LITTLE_ENDIAN") +QDEF(MP_QSTR_LOG_DEBUG, (const byte*)"\x6f\xdb\x09" "LOG_DEBUG") +QDEF(MP_QSTR_LOG_ERROR, (const byte*)"\x06\xce\x09" "LOG_ERROR") +QDEF(MP_QSTR_LOG_INFO, (const byte*)"\xd0\x75\x08" "LOG_INFO") +QDEF(MP_QSTR_LOG_NONE, (const byte*)"\xf4\xd3\x08" "LOG_NONE") +QDEF(MP_QSTR_LOG_VERBOSE, (const byte*)"\x24\xbd\x0b" "LOG_VERBOSE") +QDEF(MP_QSTR_LOG_WARN, (const byte*)"\x54\xad\x08" "LOG_WARN") +QDEF(MP_QSTR_LSB, (const byte*)"\xd8\xde\x03" "LSB") +QDEF(MP_QSTR_LookupError, (const byte*)"\xff\x69\x0b" "LookupError") +QDEF(MP_QSTR_M5STACK, (const byte*)"\x13\xad\x07" "M5STACK") +QDEF(MP_QSTR_MAGENTA, (const byte*)"\xf0\xf0\x07" "MAGENTA") +QDEF(MP_QSTR_MAROON, (const byte*)"\x95\x40\x06" "MAROON") +QDEF(MP_QSTR_MASTER, (const byte*)"\x39\x8d\x06" "MASTER") +QDEF(MP_QSTR_MODE_11B, (const byte*)"\xfb\x44\x08" "MODE_11B") +QDEF(MP_QSTR_MODE_11G, (const byte*)"\xfe\x44\x08" "MODE_11G") +QDEF(MP_QSTR_MODE_11N, (const byte*)"\xf7\x44\x08" "MODE_11N") +QDEF(MP_QSTR_MONO_HLSB, (const byte*)"\x4c\x98\x09" "MONO_HLSB") +QDEF(MP_QSTR_MONO_HMSB, (const byte*)"\xcd\x83\x09" "MONO_HMSB") +QDEF(MP_QSTR_MONO_VLSB, (const byte*)"\x12\xfc\x09" "MONO_VLSB") +QDEF(MP_QSTR_MSB, (const byte*)"\x59\xca\x03" "MSB") +QDEF(MP_QSTR_MVLSB, (const byte*)"\x03\x14\x05" "MVLSB") +QDEF(MP_QSTR_MemoryError, (const byte*)"\xdc\x83\x0b" "MemoryError") +QDEF(MP_QSTR_Message, (const byte*)"\x8e\x9c\x07" "Message") +QDEF(MP_QSTR_Mqtt, (const byte*)"\x19\x7f\x04" "Mqtt") +QDEF(MP_QSTR_NATIVE, (const byte*)"\x04\x8e\x06" "NATIVE") +QDEF(MP_QSTR_NAVY, (const byte*)"\xc5\x57\x04" "NAVY") +QDEF(MP_QSTR_NameError, (const byte*)"\xba\x2d\x09" "NameError") +QDEF(MP_QSTR_Neopixel, (const byte*)"\x49\x42\x08" "Neopixel") +QDEF(MP_QSTR_NoneType, (const byte*)"\x17\x68\x08" "NoneType") +QDEF(MP_QSTR_NotImplemented, (const byte*)"\x3e\xc6\x0e" "NotImplemented") +QDEF(MP_QSTR_NotImplementedError, (const byte*)"\xc6\x98\x13" "NotImplementedError") +QDEF(MP_QSTR_OLIVE, (const byte*)"\x7c\xb1\x05" "OLIVE") +QDEF(MP_QSTR_ONE_SHOT, (const byte*)"\x5e\xff\x08" "ONE_SHOT") +QDEF(MP_QSTR_ORANGE, (const byte*)"\xf5\xc1\x06" "ORANGE") +QDEF(MP_QSTR_OSError, (const byte*)"\xa1\x65\x07" "OSError") +QDEF(MP_QSTR_OUT, (const byte*)"\x0b\xe3\x03" "OUT") +QDEF(MP_QSTR_OUT_OD, (const byte*)"\x1f\x2a\x06" "OUT_OD") +QDEF(MP_QSTR_Onewire, (const byte*)"\x48\x3b\x07" "Onewire") +QDEF(MP_QSTR_OrderedDict, (const byte*)"\xf0\x7e\x0b" "OrderedDict") +QDEF(MP_QSTR_OverflowError, (const byte*)"\x81\xe1\x0d" "OverflowError") +QDEF(MP_QSTR_PAUSE, (const byte*)"\xf7\xdd\x05" "PAUSE") +QDEF(MP_QSTR_PERIODIC, (const byte*)"\x0a\x35\x08" "PERIODIC") +QDEF(MP_QSTR_PINK, (const byte*)"\x19\x12\x04" "PINK") +QDEF(MP_QSTR_POLLERR, (const byte*)"\xdf\xc0\x07" "POLLERR") +QDEF(MP_QSTR_POLLHUP, (const byte*)"\x77\x8a\x07" "POLLHUP") +QDEF(MP_QSTR_POLLIN, (const byte*)"\x7d\x61\x06" "POLLIN") +QDEF(MP_QSTR_POLLOUT, (const byte*)"\x74\x85\x07" "POLLOUT") +QDEF(MP_QSTR_PORTRAIT, (const byte*)"\xf2\xcd\x08" "PORTRAIT") +QDEF(MP_QSTR_PORTRAIT_FLIP, (const byte*)"\x1e\xf2\x0d" "PORTRAIT_FLIP") +QDEF(MP_QSTR_PTR, (const byte*)"\xb3\x0c\x03" "PTR") +QDEF(MP_QSTR_PULL_DOWN, (const byte*)"\xad\xfb\x09" "PULL_DOWN") +QDEF(MP_QSTR_PULL_FLOAT, (const byte*)"\x0f\x42\x0a" "PULL_FLOAT") +QDEF(MP_QSTR_PULL_UP, (const byte*)"\xba\x5e\x07" "PULL_UP") +QDEF(MP_QSTR_PULL_UPDOWN, (const byte*)"\x88\xf3\x0b" "PULL_UPDOWN") +QDEF(MP_QSTR_PURPLE, (const byte*)"\x0b\x40\x06" "PURPLE") +QDEF(MP_QSTR_PWM, (const byte*)"\x4f\x0d\x03" "PWM") +QDEF(MP_QSTR_Pin, (const byte*)"\x12\x14\x03" "Pin") +QDEF(MP_QSTR_PinBase, (const byte*)"\x47\x43\x07" "PinBase") +QDEF(MP_QSTR_READ, (const byte*)"\xb7\xd8\x04" "READ") +QDEF(MP_QSTR_RED, (const byte*)"\x96\x06\x03" "RED") +QDEF(MP_QSTR_RESUME, (const byte*)"\x1c\x5c\x06" "RESUME") +QDEF(MP_QSTR_RGB565, (const byte*)"\x64\xcc\x06" "RGB565") +QDEF(MP_QSTR_RGBtoHSB, (const byte*)"\x10\x1d\x08" "RGBtoHSB") +QDEF(MP_QSTR_RIGHT, (const byte*)"\xc5\x79\x05" "RIGHT") +QDEF(MP_QSTR_RTC, (const byte*)"\xa0\x04\x03" "RTC") +QDEF(MP_QSTR_RUNNING, (const byte*)"\x42\x45\x07" "RUNNING") +QDEF(MP_QSTR_RuntimeError, (const byte*)"\x61\xf1\x0c" "RuntimeError") +QDEF(MP_QSTR_SDMODE_1LINE, (const byte*)"\x91\xff\x0c" "SDMODE_1LINE") +QDEF(MP_QSTR_SDMODE_4LINE, (const byte*)"\x94\xbe\x0c" "SDMODE_4LINE") +QDEF(MP_QSTR_SDMODE_SPI, (const byte*)"\x24\xb9\x0a" "SDMODE_SPI") +QDEF(MP_QSTR_SILVER, (const byte*)"\x52\xdb\x06" "SILVER") +QDEF(MP_QSTR_SLAVE, (const byte*)"\x68\x15\x05" "SLAVE") +QDEF(MP_QSTR_SMS_ALL, (const byte*)"\xf6\x3e\x07" "SMS_ALL") +QDEF(MP_QSTR_SMS_READ, (const byte*)"\x65\x95\x08" "SMS_READ") +QDEF(MP_QSTR_SMS_UNREAD, (const byte*)"\xde\x94\x0a" "SMS_UNREAD") +QDEF(MP_QSTR_SMTP, (const byte*)"\xbf\x95\x04" "SMTP") +QDEF(MP_QSTR_SMTPS, (const byte*)"\xcc\x4d\x05" "SMTPS") +QDEF(MP_QSTR_SOCK_DGRAM, (const byte*)"\xb3\x14\x0a" "SOCK_DGRAM") +QDEF(MP_QSTR_SOCK_RAW, (const byte*)"\xca\x96\x08" "SOCK_RAW") +QDEF(MP_QSTR_SOCK_STREAM, (const byte*)"\x32\xbe\x0b" "SOCK_STREAM") +QDEF(MP_QSTR_SOL_SOCKET, (const byte*)"\x0f\xdf\x0a" "SOL_SOCKET") +QDEF(MP_QSTR_SORT_ASC, (const byte*)"\xb1\x7b\x08" "SORT_ASC") +QDEF(MP_QSTR_SORT_DESC, (const byte*)"\xf1\x54\x09" "SORT_DESC") +QDEF(MP_QSTR_SORT_NONE, (const byte*)"\xca\xb5\x09" "SORT_NONE") +QDEF(MP_QSTR_SO_REUSEADDR, (const byte*)"\x21\x53\x0c" "SO_REUSEADDR") +QDEF(MP_QSTR_SPI, (const byte*)"\xef\x11\x03" "SPI") +QDEF(MP_QSTR_ST7735, (const byte*)"\x24\x22\x06" "ST7735") +QDEF(MP_QSTR_ST7735B, (const byte*)"\xe6\x66\x07" "ST7735B") +QDEF(MP_QSTR_ST7735R, (const byte*)"\xf6\x66\x07" "ST7735R") +QDEF(MP_QSTR_ST7789, (const byte*)"\x03\x23\x06" "ST7789") +QDEF(MP_QSTR_STATUS, (const byte*)"\x31\xf4\x06" "STATUS") +QDEF(MP_QSTR_STA_IF, (const byte*)"\xb3\x1b\x06" "STA_IF") +QDEF(MP_QSTR_STOP, (const byte*)"\x5d\x3f\x04" "STOP") +QDEF(MP_QSTR_SUSPEND, (const byte*)"\x0f\x79\x07" "SUSPEND") +QDEF(MP_QSTR_SUSPENDED, (const byte*)"\xae\xef\x09" "SUSPENDED") +QDEF(MP_QSTR_SetHeapSize, (const byte*)"\x1e\x9f\x0b" "SetHeapSize") +QDEF(MP_QSTR_SetStackSize, (const byte*)"\xcc\x52\x0c" "SetStackSize") +QDEF(MP_QSTR_Signal, (const byte*)"\x9b\xe4\x06" "Signal") +QDEF(MP_QSTR_StopAsyncIteration, (const byte*)"\xec\xf0\x12" "StopAsyncIteration") +QDEF(MP_QSTR_StopIteration, (const byte*)"\xea\x1c\x0d" "StopIteration") +QDEF(MP_QSTR_StringIO, (const byte*)"\x76\x76\x08" "StringIO") +QDEF(MP_QSTR_SyntaxError, (const byte*)"\x94\x8f\x0b" "SyntaxError") +QDEF(MP_QSTR_SystemExit, (const byte*)"\x20\xff\x0a" "SystemExit") +QDEF(MP_QSTR_TEAL, (const byte*)"\x79\xd1\x04" "TEAL") +QDEF(MP_QSTR_TERMINATED, (const byte*)"\x78\xca\x0a" "TERMINATED") +QDEF(MP_QSTR_TFT, (const byte*)"\x63\xff\x03" "TFT") +QDEF(MP_QSTR_TOUCH_NONE, (const byte*)"\xb5\x0a\x0a" "TOUCH_NONE") +QDEF(MP_QSTR_TOUCH_STMPE, (const byte*)"\xc0\x76\x0b" "TOUCH_STMPE") +QDEF(MP_QSTR_TOUCH_XPT, (const byte*)"\x43\x32\x09" "TOUCH_XPT") +QDEF(MP_QSTR_TRACE_ALL, (const byte*)"\xba\x6e\x09" "TRACE_ALL") +QDEF(MP_QSTR_TRACE_AUTH, (const byte*)"\xf3\x39\x0a" "TRACE_AUTH") +QDEF(MP_QSTR_TRACE_CONN, (const byte*)"\x77\x5a\x0a" "TRACE_CONN") +QDEF(MP_QSTR_TRACE_ERROR, (const byte*)"\xc3\x1c\x0b" "TRACE_ERROR") +QDEF(MP_QSTR_TRACE_KEX, (const byte*)"\x4d\x56\x09" "TRACE_KEX") +QDEF(MP_QSTR_TRACE_NONE, (const byte*)"\x51\xad\x0a" "TRACE_NONE") +QDEF(MP_QSTR_TRACE_PUBLICKEY, (const byte*)"\xcd\x1a\x0f" "TRACE_PUBLICKEY") +QDEF(MP_QSTR_TRACE_SCP, (const byte*)"\x9b\x33\x09" "TRACE_SCP") +QDEF(MP_QSTR_TRACE_SFTP, (const byte*)"\xea\xc3\x0a" "TRACE_SFTP") +QDEF(MP_QSTR_TRACE_SOCKET, (const byte*)"\x7e\xcb\x0c" "TRACE_SOCKET") +QDEF(MP_QSTR_TRACE_TRANS, (const byte*)"\xe1\xf8\x0b" "TRACE_TRANS") +QDEF(MP_QSTR_TYPE_RGB, (const byte*)"\x95\xd4\x08" "TYPE_RGB") +QDEF(MP_QSTR_TYPE_RGBW, (const byte*)"\x62\x67\x09" "TYPE_RGBW") +QDEF(MP_QSTR_TextIOWrapper, (const byte*)"\xad\x8d\x0d" "TextIOWrapper") +QDEF(MP_QSTR_ThreadID, (const byte*)"\x26\x9d\x08" "ThreadID") +QDEF(MP_QSTR_TimeoutError, (const byte*)"\x66\x4b\x0c" "TimeoutError") +QDEF(MP_QSTR_Timer, (const byte*)"\xa2\x1f\x05" "Timer") +QDEF(MP_QSTR_TouchPad, (const byte*)"\xd5\x8a\x08" "TouchPad") +QDEF(MP_QSTR_TypeError, (const byte*)"\x25\x96\x09" "TypeError") +QDEF(MP_QSTR_UART, (const byte*)"\xb7\x19\x04" "UART") +QDEF(MP_QSTR_UINT16, (const byte*)"\xc4\x17\x06" "UINT16") +QDEF(MP_QSTR_UINT32, (const byte*)"\x82\x17\x06" "UINT32") +QDEF(MP_QSTR_UINT64, (const byte*)"\x61\x18\x06" "UINT64") +QDEF(MP_QSTR_UINT8, (const byte*)"\xbb\xe1\x05" "UINT8") +QDEF(MP_QSTR_UnicodeError, (const byte*)"\x22\xd1\x0c" "UnicodeError") +QDEF(MP_QSTR_VOID, (const byte*)"\x31\xf2\x04" "VOID") +QDEF(MP_QSTR_VSPI, (const byte*)"\x19\x7e\x04" "VSPI") +QDEF(MP_QSTR_ValueError, (const byte*)"\x96\x87\x0a" "ValueError") +QDEF(MP_QSTR_VfsNative, (const byte*)"\x07\xdf\x09" "VfsNative") +QDEF(MP_QSTR_WAITING, (const byte*)"\x8e\xdc\x07" "WAITING") +QDEF(MP_QSTR_WHITE, (const byte*)"\xa2\xc2\x05" "WHITE") +QDEF(MP_QSTR_WIDTH_10BIT, (const byte*)"\xc2\x7c\x0b" "WIDTH_10BIT") +QDEF(MP_QSTR_WIDTH_11BIT, (const byte*)"\xa3\xdf\x0b" "WIDTH_11BIT") +QDEF(MP_QSTR_WIDTH_12BIT, (const byte*)"\x80\xa4\x0b" "WIDTH_12BIT") +QDEF(MP_QSTR_WIDTH_9BIT, (const byte*)"\x5a\x2c\x0a" "WIDTH_9BIT") +QDEF(MP_QSTR_WLAN, (const byte*)"\x11\x94\x04" "WLAN") +QDEF(MP_QSTR_WLANcallback, (const byte*)"\x58\x3c\x0c" "WLANcallback") +QDEF(MP_QSTR_WRITE, (const byte*)"\xf8\xa8\x05" "WRITE") +QDEF(MP_QSTR_YELLOW, (const byte*)"\x41\x49\x06" "YELLOW") +QDEF(MP_QSTR_ZeroDivisionError, (const byte*)"\xb6\x27\x11" "ZeroDivisionError") +QDEF(MP_QSTR__thread, (const byte*)"\xd4\x02\x07" "_thread") +QDEF(MP_QSTR_a2b_base64, (const byte*)"\x3c\x0b\x0a" "a2b_base64") +QDEF(MP_QSTR_abs, (const byte*)"\x95\x32\x03" "abs") +QDEF(MP_QSTR_accept, (const byte*)"\x85\x89\x06" "accept") +QDEF(MP_QSTR_accepted, (const byte*)"\x24\x02\x08" "accepted") +QDEF(MP_QSTR_acos, (const byte*)"\x1b\xa0\x04" "acos") +QDEF(MP_QSTR_acosh, (const byte*)"\x13\xa3\x05" "acosh") +QDEF(MP_QSTR_active, (const byte*)"\x69\xea\x06" "active") +QDEF(MP_QSTR_add, (const byte*)"\x44\x32\x03" "add") +QDEF(MP_QSTR_addService, (const byte*)"\xd9\x55\x0a" "addService") +QDEF(MP_QSTR_addr, (const byte*)"\xb6\x7a\x04" "addr") +QDEF(MP_QSTR_address, (const byte*)"\x73\x53\x07" "address") +QDEF(MP_QSTR_addressof, (const byte*)"\x5a\xf9\x09" "addressof") +QDEF(MP_QSTR_addrlen, (const byte*)"\x71\x7c\x07" "addrlen") +QDEF(MP_QSTR_adrlen, (const byte*)"\x55\xb8\x06" "adrlen") +QDEF(MP_QSTR_all, (const byte*)"\x44\x33\x03" "all") +QDEF(MP_QSTR_alloc_emergency_exception_buf, (const byte*)"\x78\x2a\x1d" "alloc_emergency_exception_buf") +QDEF(MP_QSTR_allowsuspend, (const byte*)"\x76\xc3\x0c" "allowsuspend") +QDEF(MP_QSTR_angle, (const byte*)"\x84\x2c\x05" "angle") +QDEF(MP_QSTR_any, (const byte*)"\x13\x33\x03" "any") +QDEF(MP_QSTR_apn, (const byte*)"\xda\x34\x03" "apn") +QDEF(MP_QSTR_append, (const byte*)"\x6b\x97\x06" "append") +QDEF(MP_QSTR_arc, (const byte*)"\x95\x34\x03" "arc") +QDEF(MP_QSTR_arg, (const byte*)"\x91\x34\x03" "arg") +QDEF(MP_QSTR_args, (const byte*)"\xc2\xc6\x04" "args") +QDEF(MP_QSTR_argv, (const byte*)"\xc7\xc6\x04" "argv") +QDEF(MP_QSTR_array, (const byte*)"\x7c\x72\x05" "array") +QDEF(MP_QSTR_asin, (const byte*)"\x50\xe5\x04" "asin") +QDEF(MP_QSTR_asinh, (const byte*)"\x38\x8f\x05" "asinh") +QDEF(MP_QSTR_asnum, (const byte*)"\x01\x82\x05" "asnum") +QDEF(MP_QSTR_atan, (const byte*)"\x1f\xbe\x04" "atan") +QDEF(MP_QSTR_atan2, (const byte*)"\xcd\x81\x05" "atan2") +QDEF(MP_QSTR_atanh, (const byte*)"\x97\x81\x05" "atanh") +QDEF(MP_QSTR_atcmd, (const byte*)"\xfa\x9a\x05" "atcmd") +QDEF(MP_QSTR_attach, (const byte*)"\x8e\x75\x06" "attach") +QDEF(MP_QSTR_atten, (const byte*)"\xaf\x50\x05" "atten") +QDEF(MP_QSTR_attrib7seg, (const byte*)"\xdb\x79\x0a" "attrib7seg") +QDEF(MP_QSTR_authmode, (const byte*)"\xce\x65\x08" "authmode") +QDEF(MP_QSTR_autoreconnect, (const byte*)"\xe3\x51\x0d" "autoreconnect") +QDEF(MP_QSTR_b2a_base64, (const byte*)"\x3c\x8f\x0a" "b2a_base64") +QDEF(MP_QSTR_backl_on, (const byte*)"\xbc\x78\x08" "backl_on") +QDEF(MP_QSTR_backl_pin, (const byte*)"\xaa\x80\x09" "backl_pin") +QDEF(MP_QSTR_backlight, (const byte*)"\xb0\x86\x09" "backlight") +QDEF(MP_QSTR_baudrate, (const byte*)"\xf5\xd8\x08" "baudrate") +QDEF(MP_QSTR_bcc, (const byte*)"\x27\x47\x03" "bcc") +QDEF(MP_QSTR_begin, (const byte*)"\x82\xc1\x05" "begin") +QDEF(MP_QSTR_bgcolor, (const byte*)"\xbd\xb6\x07" "bgcolor") +QDEF(MP_QSTR_bgr, (const byte*)"\xb2\x46\x03" "bgr") +QDEF(MP_QSTR_bin, (const byte*)"\xe0\x48\x03" "bin") +QDEF(MP_QSTR_binascii, (const byte*)"\x91\x3c\x08" "binascii") +QDEF(MP_QSTR_bind, (const byte*)"\x84\x64\x04" "bind") +QDEF(MP_QSTR_bits, (const byte*)"\x49\x68\x04" "bits") +QDEF(MP_QSTR_blit, (const byte*)"\xf6\x50\x04" "blit") +QDEF(MP_QSTR_block_sleep, (const byte*)"\x1c\x02\x0b" "block_sleep") +QDEF(MP_QSTR_bodylen, (const byte*)"\x32\x36\x07" "bodylen") +QDEF(MP_QSTR_bool, (const byte*)"\xeb\x3c\x04" "bool") +QDEF(MP_QSTR_bound_method, (const byte*)"\x97\xa2\x0c" "bound_method") +QDEF(MP_QSTR_brightness, (const byte*)"\x4c\xc6\x0a" "brightness") +QDEF(MP_QSTR_btree, (const byte*)"\xe1\x91\x05" "btree") +QDEF(MP_QSTR_buf, (const byte*)"\x74\x49\x03" "buf") +QDEF(MP_QSTR_buffer, (const byte*)"\xe5\xa0\x06" "buffer") +QDEF(MP_QSTR_buffer_size, (const byte*)"\xbf\xd5\x0b" "buffer_size") +QDEF(MP_QSTR_buffering, (const byte*)"\x25\xdb\x09" "buffering") +QDEF(MP_QSTR_buffsize, (const byte*)"\x77\xad\x08" "buffsize") +QDEF(MP_QSTR_builtins, (const byte*)"\xf7\x31\x08" "builtins") +QDEF(MP_QSTR_bytearray, (const byte*)"\x76\xa3\x09" "bytearray") +QDEF(MP_QSTR_bytearray_at, (const byte*)"\x9c\x5c\x0c" "bytearray_at") +QDEF(MP_QSTR_bytecode, (const byte*)"\x22\x7d\x08" "bytecode") +QDEF(MP_QSTR_byteorder, (const byte*)"\x61\x99\x09" "byteorder") +QDEF(MP_QSTR_bytes, (const byte*)"\x5c\xb2\x05" "bytes") +QDEF(MP_QSTR_bytes_at, (const byte*)"\xb6\x5d\x08" "bytes_at") +QDEF(MP_QSTR_cachesize, (const byte*)"\xcc\x78\x09" "cachesize") +QDEF(MP_QSTR_calcsize, (const byte*)"\x4d\x38\x08" "calcsize") +QDEF(MP_QSTR_callable, (const byte*)"\x0d\x70\x08" "callable") +QDEF(MP_QSTR_callback, (const byte*)"\x4c\xf0\x08" "callback") +QDEF(MP_QSTR_calx, (const byte*)"\x73\xc1\x04" "calx") +QDEF(MP_QSTR_caly, (const byte*)"\x72\xc1\x04" "caly") +QDEF(MP_QSTR_cc, (const byte*)"\xe5\x6e\x02" "cc") +QDEF(MP_QSTR_ceil, (const byte*)"\x06\xb0\x04" "ceil") +QDEF(MP_QSTR_center, (const byte*)"\x4e\xbf\x06" "center") +QDEF(MP_QSTR_cert, (const byte*)"\x25\xb1\x04" "cert") +QDEF(MP_QSTR_channel, (const byte*)"\x26\x91\x07" "channel") +QDEF(MP_QSTR_chdir, (const byte*)"\xb1\xb2\x05" "chdir") +QDEF(MP_QSTR_checkSMS, (const byte*)"\x6e\xc1\x08" "checkSMS") +QDEF(MP_QSTR_choice, (const byte*)"\x2e\x33\x06" "choice") +QDEF(MP_QSTR_chr, (const byte*)"\xdc\x4c\x03" "chr") +QDEF(MP_QSTR_circle, (const byte*)"\xb7\xdd\x06" "circle") +QDEF(MP_QSTR_classmethod, (const byte*)"\xb4\x8c\x0b" "classmethod") +QDEF(MP_QSTR_cleansession, (const byte*)"\x7e\x01\x0c" "cleansession") +QDEF(MP_QSTR_clear, (const byte*)"\x7c\xa0\x05" "clear") +QDEF(MP_QSTR_clearwin, (const byte*)"\xac\xb0\x08" "clearwin") +QDEF(MP_QSTR_clientid, (const byte*)"\x71\x4d\x08" "clientid") +QDEF(MP_QSTR_clk, (const byte*)"\x41\x4c\x03" "clk") +QDEF(MP_QSTR_close, (const byte*)"\x33\x67\x05" "close") +QDEF(MP_QSTR_closure, (const byte*)"\x74\xca\x07" "closure") +QDEF(MP_QSTR_cmath, (const byte*)"\xb6\xf4\x05" "cmath") +QDEF(MP_QSTR_cmd, (const byte*)"\x2f\x4c\x03" "cmd") +QDEF(MP_QSTR_cmddata, (const byte*)"\x3f\xa8\x07" "cmddata") +QDEF(MP_QSTR_code, (const byte*)"\x68\xda\x04" "code") +QDEF(MP_QSTR_collect, (const byte*)"\x9b\x65\x07" "collect") +QDEF(MP_QSTR_collections, (const byte*)"\xe0\xc8\x0b" "collections") +QDEF(MP_QSTR_color, (const byte*)"\xd8\x06\x05" "color") +QDEF(MP_QSTR_color_bits, (const byte*)"\x4b\x33\x0a" "color_bits") +QDEF(MP_QSTR_color_order, (const byte*)"\x29\xfe\x0b" "color_order") +QDEF(MP_QSTR_compile, (const byte*)"\xf4\xc9\x07" "compile") +QDEF(MP_QSTR_compileFont, (const byte*)"\x47\x0c\x0b" "compileFont") +QDEF(MP_QSTR_complex, (const byte*)"\xc5\x9d\x07" "complex") +QDEF(MP_QSTR_config, (const byte*)"\x4f\xa2\x06" "config") +QDEF(MP_QSTR_connect, (const byte*)"\xdb\x3d\x07" "connect") +QDEF(MP_QSTR_connected_cb, (const byte*)"\xc4\xae\x0c" "connected_cb") +QDEF(MP_QSTR_const, (const byte*)"\xc0\xff\x05" "const") +QDEF(MP_QSTR_conv_time, (const byte*)"\x3b\x1d\x09" "conv_time") +QDEF(MP_QSTR_convert, (const byte*)"\xf2\x9e\x07" "convert") +QDEF(MP_QSTR_convert_read, (const byte*)"\x1f\x45\x0c" "convert_read") +QDEF(MP_QSTR_convert_readint, (const byte*)"\x4c\x62\x0f" "convert_readint") +QDEF(MP_QSTR_copy, (const byte*)"\xe0\xdb\x04" "copy") +QDEF(MP_QSTR_copysign, (const byte*)"\x33\x14\x08" "copysign") +QDEF(MP_QSTR_cos, (const byte*)"\x7a\x4c\x03" "cos") +QDEF(MP_QSTR_cosh, (const byte*)"\xd2\xdb\x04" "cosh") +QDEF(MP_QSTR_count, (const byte*)"\xa6\x4d\x05" "count") +QDEF(MP_QSTR_crc32, (const byte*)"\x76\xe8\x05" "crc32") +QDEF(MP_QSTR_crc8, (const byte*)"\xcf\xef\x04" "crc8") +QDEF(MP_QSTR_cs, (const byte*)"\xf5\x6e\x02" "cs") +QDEF(MP_QSTR_cts, (const byte*)"\x41\x4d\x03" "cts") +QDEF(MP_QSTR_curl, (const byte*)"\x2d\xf1\x04" "curl") +QDEF(MP_QSTR_data_cb, (const byte*)"\x0b\xc5\x07" "data_cb") +QDEF(MP_QSTR_data_len, (const byte*)"\xad\x71\x08" "data_len") +QDEF(MP_QSTR_dbgpin, (const byte*)"\x53\x30\x06" "dbgpin") +QDEF(MP_QSTR_dbgpinmode, (const byte*)"\x70\x24\x0a" "dbgpinmode") +QDEF(MP_QSTR_dc, (const byte*)"\x82\x6d\x02" "dc") +QDEF(MP_QSTR_debug, (const byte*)"\xd4\x55\x05" "debug") +QDEF(MP_QSTR_decode, (const byte*)"\xa9\x59\x06" "decode") +QDEF(MP_QSTR_decompress, (const byte*)"\x62\xfb\x0a" "decompress") +QDEF(MP_QSTR_deepsleep, (const byte*)"\x9e\xd2\x09" "deepsleep") +QDEF(MP_QSTR_default, (const byte*)"\xce\x7d\x07" "default") +QDEF(MP_QSTR_degrees, (const byte*)"\x02\x41\x07" "degrees") +QDEF(MP_QSTR_deinit, (const byte*)"\x9e\x8d\x06" "deinit") +QDEF(MP_QSTR_delattr, (const byte*)"\xdb\xc8\x07" "delattr") +QDEF(MP_QSTR_deleteSMS, (const byte*)"\xf1\xf1\x09" "deleteSMS") +QDEF(MP_QSTR_deleter, (const byte*)"\x6e\xdb\x07" "deleter") +QDEF(MP_QSTR_deque, (const byte*)"\x05\x99\x05" "deque") +QDEF(MP_QSTR_deselect, (const byte*)"\x0c\x9d\x08" "deselect") +QDEF(MP_QSTR_device, (const byte*)"\x3d\x93\x06" "device") +QDEF(MP_QSTR_dhcp_hostname, (const byte*)"\xa2\x49\x0d" "dhcp_hostname") +QDEF(MP_QSTR_dict, (const byte*)"\x3f\xfc\x04" "dict") +QDEF(MP_QSTR_dict_view, (const byte*)"\x2d\xa9\x09" "dict_view") +QDEF(MP_QSTR_difference, (const byte*)"\x72\x24\x0a" "difference") +QDEF(MP_QSTR_difference_update, (const byte*)"\x9c\xfa\x11" "difference_update") +QDEF(MP_QSTR_digest, (const byte*)"\xcd\xc4\x06" "digest") +QDEF(MP_QSTR_dir, (const byte*)"\xfa\x1e\x03" "dir") +QDEF(MP_QSTR_disable, (const byte*)"\x91\x76\x07" "disable") +QDEF(MP_QSTR_disable_irq, (const byte*)"\x04\x3a\x0b" "disable_irq") +QDEF(MP_QSTR_discard, (const byte*)"\x0f\x71\x07" "discard") +QDEF(MP_QSTR_disconnect, (const byte*)"\xa5\x85\x0a" "disconnect") +QDEF(MP_QSTR_disconnected_cb, (const byte*)"\xfa\x4c\x0f" "disconnected_cb") +QDEF(MP_QSTR_display, (const byte*)"\x1f\x55\x07" "display") +QDEF(MP_QSTR_dist, (const byte*)"\x2f\xfe\x04" "dist") +QDEF(MP_QSTR_divmod, (const byte*)"\xb8\x04\x06" "divmod") +QDEF(MP_QSTR_doc, (const byte*)"\x2d\x1f\x03" "doc") +QDEF(MP_QSTR_ds18x20, (const byte*)"\x61\x26\x07" "ds18x20") +QDEF(MP_QSTR_dump, (const byte*)"\xe9\x2f\x04" "dump") +QDEF(MP_QSTR_dumps, (const byte*)"\x7a\x2d\x05" "dumps") +QDEF(MP_QSTR_duplex, (const byte*)"\xf5\x7b\x06" "duplex") +QDEF(MP_QSTR_duty, (const byte*)"\x19\x2c\x04" "duty") +QDEF(MP_QSTR_e, (const byte*)"\xc0\xb5\x01" "e") +QDEF(MP_QSTR_ellipse, (const byte*)"\x0f\xdc\x07" "ellipse") +QDEF(MP_QSTR_enable, (const byte*)"\x04\xde\x06" "enable") +QDEF(MP_QSTR_enable_irq, (const byte*)"\x91\x60\x0a" "enable_irq") +QDEF(MP_QSTR_encode, (const byte*)"\x43\xca\x06" "encode") +QDEF(MP_QSTR_encoding, (const byte*)"\x06\x9c\x08" "encoding") +QDEF(MP_QSTR_end, (const byte*)"\x0a\x23\x03" "end") +QDEF(MP_QSTR_endswith, (const byte*)"\x1b\xa3\x08" "endswith") +QDEF(MP_QSTR_endtask, (const byte*)"\xe7\x60\x07" "endtask") +QDEF(MP_QSTR_enumerate, (const byte*)"\x71\xba\x09" "enumerate") +QDEF(MP_QSTR_erf, (const byte*)"\x94\x23\x03" "erf") +QDEF(MP_QSTR_erfc, (const byte*)"\x77\x96\x04" "erfc") +QDEF(MP_QSTR_errno, (const byte*)"\xc1\x11\x05" "errno") +QDEF(MP_QSTR_errorcode, (const byte*)"\x10\xdd\x09" "errorcode") +QDEF(MP_QSTR_essid, (const byte*)"\x4d\xb1\x05" "essid") +QDEF(MP_QSTR_eval, (const byte*)"\x9b\xa6\x04" "eval") +QDEF(MP_QSTR_eventCB, (const byte*)"\xa8\xf7\x07" "eventCB") +QDEF(MP_QSTR_events, (const byte*)"\x9a\xa2\x06" "events") +QDEF(MP_QSTR_exc_info, (const byte*)"\x0a\xff\x08" "exc_info") +QDEF(MP_QSTR_exec, (const byte*)"\x1e\xc0\x04" "exec") +QDEF(MP_QSTR_execfile, (const byte*)"\x58\x28\x08" "execfile") +QDEF(MP_QSTR_exit, (const byte*)"\x85\xbe\x04" "exit") +QDEF(MP_QSTR_exp, (const byte*)"\xc8\x24\x03" "exp") +QDEF(MP_QSTR_expm1, (const byte*)"\x74\x72\x05" "expm1") +QDEF(MP_QSTR_extend, (const byte*)"\x63\xe8\x06" "extend") +QDEF(MP_QSTR_fabs, (const byte*)"\x93\x12\x04" "fabs") +QDEF(MP_QSTR_factorial, (const byte*)"\xcc\x32\x09" "factorial") +QDEF(MP_QSTR_file, (const byte*)"\xc3\x34\x04" "file") +QDEF(MP_QSTR_fileno, (const byte*)"\x82\x76\x06" "fileno") +QDEF(MP_QSTR_fill, (const byte*)"\xca\x34\x04" "fill") +QDEF(MP_QSTR_fill_rect, (const byte*)"\x35\xed\x09" "fill_rect") +QDEF(MP_QSTR_fillcolor, (const byte*)"\x77\x7f\x09" "fillcolor") +QDEF(MP_QSTR_filter, (const byte*)"\x25\xbe\x06" "filter") +QDEF(MP_QSTR_find, (const byte*)"\x00\x34\x04" "find") +QDEF(MP_QSTR_firstbit, (const byte*)"\x20\x39\x08" "firstbit") +QDEF(MP_QSTR_fixedwidth, (const byte*)"\x35\x36\x0a" "fixedwidth") +QDEF(MP_QSTR_flags, (const byte*)"\xfa\x8f\x05" "flags") +QDEF(MP_QSTR_float, (const byte*)"\x35\x44\x05" "float") +QDEF(MP_QSTR_floor, (const byte*)"\x7d\x46\x05" "floor") +QDEF(MP_QSTR_flush, (const byte*)"\x61\xc1\x05" "flush") +QDEF(MP_QSTR_fmod, (const byte*)"\xe5\x44\x04" "fmod") +QDEF(MP_QSTR_font, (const byte*)"\x96\x2b\x04" "font") +QDEF(MP_QSTR_fontSize, (const byte*)"\x93\x3e\x08" "fontSize") +QDEF(MP_QSTR_format, (const byte*)"\x26\x33\x06" "format") +QDEF(MP_QSTR_framebuf, (const byte*)"\x69\x82\x08" "framebuf") +QDEF(MP_QSTR_free, (const byte*)"\xf1\x3a\x04" "free") +QDEF(MP_QSTR_freq, (const byte*)"\xe5\x3a\x04" "freq") +QDEF(MP_QSTR_frexp, (const byte*)"\x1c\x98\x05" "frexp") +QDEF(MP_QSTR_from_bytes, (const byte*)"\x35\x74\x0a" "from_bytes") +QDEF(MP_QSTR_from_nvs, (const byte*)"\x67\x62\x08" "from_nvs") +QDEF(MP_QSTR_fromkeys, (const byte*)"\x37\xbd\x08" "fromkeys") +QDEF(MP_QSTR_frozenset, (const byte*)"\xed\x9c\x09" "frozenset") +QDEF(MP_QSTR_ftp, (const byte*)"\x47\x39\x03" "ftp") +QDEF(MP_QSTR_ftp_get, (const byte*)"\xae\x67\x07" "ftp_get") +QDEF(MP_QSTR_ftp_list, (const byte*)"\xda\xd1\x08" "ftp_list") +QDEF(MP_QSTR_ftp_put, (const byte*)"\x69\x22\x07" "ftp_put") +QDEF(MP_QSTR_func, (const byte*)"\x1b\x68\x04" "func") +QDEF(MP_QSTR_function, (const byte*)"\x27\x02\x08" "function") +QDEF(MP_QSTR_gamma, (const byte*)"\x02\x90\x05" "gamma") +QDEF(MP_QSTR_gc, (const byte*)"\x61\x6e\x02" "gc") +QDEF(MP_QSTR_generator, (const byte*)"\x96\xc3\x09" "generator") +QDEF(MP_QSTR_get, (const byte*)"\x33\x3b\x03" "get") +QDEF(MP_QSTR_getCalib, (const byte*)"\xd6\xaf\x08" "getCalib") +QDEF(MP_QSTR_getMainID, (const byte*)"\x35\xc1\x09" "getMainID") +QDEF(MP_QSTR_getReplID, (const byte*)"\xb5\xe5\x09" "getReplID") +QDEF(MP_QSTR_getSelfName, (const byte*)"\x68\xaf\x0b" "getSelfName") +QDEF(MP_QSTR_getThreadName, (const byte*)"\xba\xa7\x0d" "getThreadName") +QDEF(MP_QSTR_getTouchType, (const byte*)"\x2e\x4a\x0c" "getTouchType") +QDEF(MP_QSTR_get_bg, (const byte*)"\x89\x40\x06" "get_bg") +QDEF(MP_QSTR_get_fg, (const byte*)"\x0d\x40\x06" "get_fg") +QDEF(MP_QSTR_get_pwrmode, (const byte*)"\x7a\x71\x0b" "get_pwrmode") +QDEF(MP_QSTR_get_res, (const byte*)"\x88\x95\x07" "get_res") +QDEF(MP_QSTR_getaddrinfo, (const byte*)"\x6e\x18\x0b" "getaddrinfo") +QDEF(MP_QSTR_getattr, (const byte*)"\xc0\x17\x07" "getattr") +QDEF(MP_QSTR_getcwd, (const byte*)"\x03\xd0\x06" "getcwd") +QDEF(MP_QSTR_getdata, (const byte*)"\x23\xd7\x07" "getdata") +QDEF(MP_QSTR_getdrive, (const byte*)"\x7f\xf6\x08" "getdrive") +QDEF(MP_QSTR_getmsg, (const byte*)"\x0a\x1b\x06" "getmsg") +QDEF(MP_QSTR_getnotification, (const byte*)"\x3e\xa6\x0f" "getnotification") +QDEF(MP_QSTR_getpeercert, (const byte*)"\xb1\x92\x0b" "getpeercert") +QDEF(MP_QSTR_getrandbits, (const byte*)"\x66\x7d\x0b" "getrandbits") +QDEF(MP_QSTR_getter, (const byte*)"\x90\xb2\x06" "getter") +QDEF(MP_QSTR_gettouch, (const byte*)"\xb6\x12\x08" "gettouch") +QDEF(MP_QSTR_getvalue, (const byte*)"\x78\xac\x08" "getvalue") +QDEF(MP_QSTR_globals, (const byte*)"\x9d\x49\x07" "globals") +QDEF(MP_QSTR_gmtime, (const byte*)"\x5a\x8e\x06" "gmtime") +QDEF(MP_QSTR_group, (const byte*)"\xba\xb0\x05" "group") +QDEF(MP_QSTR_gsm, (const byte*)"\xfc\x3c\x03" "gsm") +QDEF(MP_QSTR_gsmnum, (const byte*)"\x6a\x23\x06" "gsmnum") +QDEF(MP_QSTR_handler, (const byte*)"\xdd\x5d\x07" "handler") +QDEF(MP_QSTR_hasattr, (const byte*)"\x8c\xb0\x07" "hasattr") +QDEF(MP_QSTR_hash, (const byte*)"\xb7\x70\x04" "hash") +QDEF(MP_QSTR_hashlib, (const byte*)"\x10\x6d\x07" "hashlib") +QDEF(MP_QSTR_hastouch, (const byte*)"\x7a\x3f\x08" "hastouch") +QDEF(MP_QSTR_hdrlen, (const byte*)"\x7c\xb1\x06" "hdrlen") +QDEF(MP_QSTR_heap_info, (const byte*)"\x68\x1d\x09" "heap_info") +QDEF(MP_QSTR_heap_lock, (const byte*)"\xad\x8c\x09" "heap_lock") +QDEF(MP_QSTR_heap_unlock, (const byte*)"\x56\x2d\x0b" "heap_unlock") +QDEF(MP_QSTR_heapify, (const byte*)"\xaf\x2d\x07" "heapify") +QDEF(MP_QSTR_heappop, (const byte*)"\xd6\x27\x07" "heappop") +QDEF(MP_QSTR_heappush, (const byte*)"\x87\x6b\x08" "heappush") +QDEF(MP_QSTR_heapq, (const byte*)"\x68\x1d\x05" "heapq") +QDEF(MP_QSTR_height, (const byte*)"\xfa\x33\x06" "height") +QDEF(MP_QSTR_help, (const byte*)"\x94\x5c\x04" "help") +QDEF(MP_QSTR_hex, (const byte*)"\x70\x50\x03" "hex") +QDEF(MP_QSTR_hexlify, (const byte*)"\x2a\x7f\x07" "hexlify") +QDEF(MP_QSTR_hidden, (const byte*)"\xef\x48\x06" "hidden") +QDEF(MP_QSTR_hline, (const byte*)"\x83\x3c\x05" "hline") +QDEF(MP_QSTR_hostname, (const byte*)"\xc2\x95\x08" "hostname") +QDEF(MP_QSTR_hsb2rgb, (const byte*)"\xd9\xce\x07" "hsb2rgb") +QDEF(MP_QSTR_hue, (const byte*)"\x7d\x52\x03" "hue") +QDEF(MP_QSTR_hypot, (const byte*)"\x1f\x4f\x05" "hypot") +QDEF(MP_QSTR_id, (const byte*)"\x28\x6f\x02" "id") +QDEF(MP_QSTR_idle, (const byte*)"\xa1\xdc\x04" "idle") +QDEF(MP_QSTR_ifconfig, (const byte*)"\xe0\x41\x08" "ifconfig") +QDEF(MP_QSTR_ilistdir, (const byte*)"\x71\x6a\x08" "ilistdir") +QDEF(MP_QSTR_imag, (const byte*)"\x47\xb7\x04" "imag") +QDEF(MP_QSTR_image, (const byte*)"\x42\xa0\x05" "image") +QDEF(MP_QSTR_implementation, (const byte*)"\x17\x2d\x0e" "implementation") +QDEF(MP_QSTR_index, (const byte*)"\x7b\x28\x05" "index") +QDEF(MP_QSTR_info, (const byte*)"\xeb\xb3\x04" "info") +QDEF(MP_QSTR_init, (const byte*)"\x1f\xb4\x04" "init") +QDEF(MP_QSTR_input, (const byte*)"\x73\x5a\x05" "input") +QDEF(MP_QSTR_insert, (const byte*)"\x12\x54\x06" "insert") +QDEF(MP_QSTR_instance, (const byte*)"\x8c\x54\x08" "instance") +QDEF(MP_QSTR_int, (const byte*)"\x16\x53\x03" "int") +QDEF(MP_QSTR_internal_temp, (const byte*)"\xf1\x46\x0d" "internal_temp") +QDEF(MP_QSTR_intersection, (const byte*)"\x28\x2a\x0c" "intersection") +QDEF(MP_QSTR_intersection_update, (const byte*)"\x06\xdd\x13" "intersection_update") +QDEF(MP_QSTR_invert, (const byte*)"\xb7\x00\x06" "invert") +QDEF(MP_QSTR_inverted, (const byte*)"\x56\x16\x08" "inverted") +QDEF(MP_QSTR_invrot, (const byte*)"\x9d\xcb\x06" "invrot") +QDEF(MP_QSTR_io, (const byte*)"\x23\x6f\x02" "io") +QDEF(MP_QSTR_ioctl, (const byte*)"\x78\xc2\x05" "ioctl") +QDEF(MP_QSTR_ipoll, (const byte*)"\x53\x5d\x05" "ipoll") +QDEF(MP_QSTR_irq, (const byte*)"\x8f\x56\x03" "irq") +QDEF(MP_QSTR_isalpha, (const byte*)"\xeb\x37\x07" "isalpha") +QDEF(MP_QSTR_isconnected, (const byte*)"\x80\x99\x0b" "isconnected") +QDEF(MP_QSTR_isdigit, (const byte*)"\xa8\x9a\x07" "isdigit") +QDEF(MP_QSTR_isdisjoint, (const byte*)"\xf7\x68\x0a" "isdisjoint") +QDEF(MP_QSTR_isenabled, (const byte*)"\x9a\xe5\x09" "isenabled") +QDEF(MP_QSTR_isfinite, (const byte*)"\xa6\xab\x08" "isfinite") +QDEF(MP_QSTR_isinf, (const byte*)"\x3e\x11\x05" "isinf") +QDEF(MP_QSTR_isinstance, (const byte*)"\xb6\xbe\x0a" "isinstance") +QDEF(MP_QSTR_islower, (const byte*)"\xfc\x80\x07" "islower") +QDEF(MP_QSTR_isnan, (const byte*)"\x9e\x03\x05" "isnan") +QDEF(MP_QSTR_isnotified, (const byte*)"\x8d\xde\x0a" "isnotified") +QDEF(MP_QSTR_isrunning, (const byte*)"\x18\xfb\x09" "isrunning") +QDEF(MP_QSTR_isspace, (const byte*)"\x5b\xf8\x07" "isspace") +QDEF(MP_QSTR_issubclass, (const byte*)"\xb5\x7f\x0a" "issubclass") +QDEF(MP_QSTR_issubset, (const byte*)"\xb9\xc1\x08" "issubset") +QDEF(MP_QSTR_issuperset, (const byte*)"\xfc\xec\x0a" "issuperset") +QDEF(MP_QSTR_isupper, (const byte*)"\xdd\xa7\x07" "isupper") +QDEF(MP_QSTR_items, (const byte*)"\xe3\x53\x05" "items") +QDEF(MP_QSTR_iter, (const byte*)"\x8f\x21\x04" "iter") +QDEF(MP_QSTR_iterable, (const byte*)"\x25\x92\x08" "iterable") +QDEF(MP_QSTR_iterator, (const byte*)"\x47\xbe\x08" "iterator") +QDEF(MP_QSTR_join, (const byte*)"\xa7\x5c\x04" "join") +QDEF(MP_QSTR_json, (const byte*)"\xfd\xd1\x04" "json") +QDEF(MP_QSTR_kbd_intr, (const byte*)"\xf6\x13\x08" "kbd_intr") +QDEF(MP_QSTR_keepalive, (const byte*)"\x69\x05\x09" "keepalive") +QDEF(MP_QSTR_keepends, (const byte*)"\x62\x8b\x08" "keepends") +QDEF(MP_QSTR_key, (const byte*)"\x32\x6d\x03" "key") +QDEF(MP_QSTR_keys, (const byte*)"\x01\x13\x04" "keys") +QDEF(MP_QSTR_kwarg, (const byte*)"\x2d\x1f\x05" "kwarg") +QDEF(MP_QSTR_ldexp, (const byte*)"\x40\x6f\x05" "ldexp") +QDEF(MP_QSTR_len, (const byte*)"\x62\x40\x03" "len") +QDEF(MP_QSTR_length, (const byte*)"\x59\x87\x06" "length") +QDEF(MP_QSTR_level, (const byte*)"\xd3\x4b\x05" "level") +QDEF(MP_QSTR_lgamma, (const byte*)"\xce\x6c\x06" "lgamma") +QDEF(MP_QSTR_line, (const byte*)"\xcb\x1c\x04" "line") +QDEF(MP_QSTR_lineByAngle, (const byte*)"\x71\x01\x0b" "lineByAngle") +QDEF(MP_QSTR_lineend, (const byte*)"\x04\x8c\x07" "lineend") +QDEF(MP_QSTR_list, (const byte*)"\x27\x1d\x04" "list") +QDEF(MP_QSTR_listdir, (const byte*)"\x98\xe3\x07" "listdir") +QDEF(MP_QSTR_listen, (const byte*)"\xcc\x0e\x06" "listen") +QDEF(MP_QSTR_little, (const byte*)"\x89\x6a\x06" "little") +QDEF(MP_QSTR_llist, (const byte*)"\xeb\x40\x05" "llist") +QDEF(MP_QSTR_load, (const byte*)"\x63\x24\x04" "load") +QDEF(MP_QSTR_loads, (const byte*)"\xb0\xb0\x05" "loads") +QDEF(MP_QSTR_locals, (const byte*)"\x3b\xa1\x06" "locals") +QDEF(MP_QSTR_localtime, (const byte*)"\x7d\x46\x09" "localtime") +QDEF(MP_QSTR_lock, (const byte*)"\xae\x23\x04" "lock") +QDEF(MP_QSTR_log, (const byte*)"\x21\x3f\x03" "log") +QDEF(MP_QSTR_log10, (const byte*)"\x40\x91\x05" "log10") +QDEF(MP_QSTR_log2, (const byte*)"\x73\x23\x04" "log2") +QDEF(MP_QSTR_loglevel, (const byte*)"\x37\x99\x08" "loglevel") +QDEF(MP_QSTR_lower, (const byte*)"\xc6\xcb\x05" "lower") +QDEF(MP_QSTR_lstrip, (const byte*)"\xe5\xb9\x06" "lstrip") +QDEF(MP_QSTR_mDNS, (const byte*)"\xd1\x48\x04" "mDNS") +QDEF(MP_QSTR_mac, (const byte*)"\xaa\x43\x03" "mac") +QDEF(MP_QSTR_machine, (const byte*)"\x60\xab\x07" "machine") +QDEF(MP_QSTR_mainAcceptMsg, (const byte*)"\xd7\x44\x0d" "mainAcceptMsg") +QDEF(MP_QSTR_makefile, (const byte*)"\xc1\xd5\x08" "makefile") +QDEF(MP_QSTR_map, (const byte*)"\xb9\x43\x03" "map") +QDEF(MP_QSTR_match, (const byte*)"\x96\x22\x05" "match") +QDEF(MP_QSTR_math, (const byte*)"\x35\xbb\x04" "math") +QDEF(MP_QSTR_max, (const byte*)"\xb1\x43\x03" "max") +QDEF(MP_QSTR_maxfsize, (const byte*)"\xd2\x89\x08" "maxfsize") +QDEF(MP_QSTR_maxres, (const byte*)"\x55\xbb\x06" "maxres") +QDEF(MP_QSTR_maxsize, (const byte*)"\xd4\x70\x07" "maxsize") +QDEF(MP_QSTR_mem, (const byte*)"\x20\x44\x03" "mem") +QDEF(MP_QSTR_mem16, (const byte*)"\x07\xca\x05" "mem16") +QDEF(MP_QSTR_mem32, (const byte*)"\x41\xca\x05" "mem32") +QDEF(MP_QSTR_mem8, (const byte*)"\x18\xc8\x04" "mem8") +QDEF(MP_QSTR_mem_alloc, (const byte*)"\x52\x2b\x09" "mem_alloc") +QDEF(MP_QSTR_mem_free, (const byte*)"\xcb\x62\x08" "mem_free") +QDEF(MP_QSTR_mem_info, (const byte*)"\xd1\xf1\x08" "mem_info") +QDEF(MP_QSTR_memaddr, (const byte*)"\x93\xe8\x07" "memaddr") +QDEF(MP_QSTR_memoryview, (const byte*)"\x69\x44\x0a" "memoryview") +QDEF(MP_QSTR_micropython, (const byte*)"\x0b\x7c\x0b" "micropython") +QDEF(MP_QSTR_min, (const byte*)"\xaf\x42\x03" "min") +QDEF(MP_QSTR_minkeypage, (const byte*)"\xab\x6f\x0a" "minkeypage") +QDEF(MP_QSTR_miso, (const byte*)"\x9d\x98\x04" "miso") +QDEF(MP_QSTR_mkdir, (const byte*)"\x9c\xb5\x05" "mkdir") +QDEF(MP_QSTR_mkfs, (const byte*)"\x76\xb0\x04" "mkfs") +QDEF(MP_QSTR_mktime, (const byte*)"\x96\x2b\x06" "mktime") +QDEF(MP_QSTR_mode, (const byte*)"\x26\xc0\x04" "mode") +QDEF(MP_QSTR_modf, (const byte*)"\x25\xc0\x04" "modf") +QDEF(MP_QSTR_modify, (const byte*)"\xf5\x66\x06" "modify") +QDEF(MP_QSTR_module, (const byte*)"\xbf\x99\x06" "module") +QDEF(MP_QSTR_modules, (const byte*)"\xec\xd1\x07" "modules") +QDEF(MP_QSTR_mosi, (const byte*)"\x1d\xc2\x04" "mosi") +QDEF(MP_QSTR_mount, (const byte*)"\xa8\x0d\x05" "mount") +QDEF(MP_QSTR_mountsd, (const byte*)"\x5f\x1e\x07" "mountsd") +QDEF(MP_QSTR_mpycore, (const byte*)"\x7a\xcb\x07" "mpycore") +QDEF(MP_QSTR_mqtt, (const byte*)"\x39\xfb\x04" "mqtt") +QDEF(MP_QSTR_msg, (const byte*)"\x7c\x46\x03" "msg") +QDEF(MP_QSTR_name, (const byte*)"\xa2\x75\x04" "name") +QDEF(MP_QSTR_namedtuple, (const byte*)"\x1e\x16\x0a" "namedtuple") +QDEF(MP_QSTR_nbytes, (const byte*)"\xd2\x76\x06" "nbytes") +QDEF(MP_QSTR_network, (const byte*)"\x5b\x28\x07" "network") +QDEF(MP_QSTR_next, (const byte*)"\x42\x88\x04" "next") +QDEF(MP_QSTR_nodecode, (const byte*)"\x28\x0f\x08" "nodecode") +QDEF(MP_QSTR_nodename, (const byte*)"\x62\xab\x08" "nodename") +QDEF(MP_QSTR_notify, (const byte*)"\x06\x1c\x06" "notify") +QDEF(MP_QSTR_now, (const byte*)"\xb3\x57\x03" "now") +QDEF(MP_QSTR_ntp_state, (const byte*)"\x07\xec\x09" "ntp_state") +QDEF(MP_QSTR_ntp_sync, (const byte*)"\xd7\xfc\x08" "ntp_sync") +QDEF(MP_QSTR_num, (const byte*)"\x73\x5b\x03" "num") +QDEF(MP_QSTR_nvs_erase, (const byte*)"\x71\x60\x09" "nvs_erase") +QDEF(MP_QSTR_nvs_erase_all, (const byte*)"\x6f\x3b\x0d" "nvs_erase_all") +QDEF(MP_QSTR_nvs_getint, (const byte*)"\xb4\x12\x0a" "nvs_getint") +QDEF(MP_QSTR_nvs_getstr, (const byte*)"\x72\x1b\x0a" "nvs_getstr") +QDEF(MP_QSTR_nvs_setint, (const byte*)"\x20\xd4\x0a" "nvs_setint") +QDEF(MP_QSTR_nvs_setstr, (const byte*)"\xe6\x58\x0a" "nvs_setstr") +QDEF(MP_QSTR_object, (const byte*)"\x90\x8d\x06" "object") +QDEF(MP_QSTR_oct, (const byte*)"\xfd\x5c\x03" "oct") +QDEF(MP_QSTR_off, (const byte*)"\x8a\x5c\x03" "off") +QDEF(MP_QSTR_on, (const byte*)"\x64\x6f\x02" "on") +QDEF(MP_QSTR_open, (const byte*)"\xd1\x3a\x04" "open") +QDEF(MP_QSTR_opt, (const byte*)"\xce\x5e\x03" "opt") +QDEF(MP_QSTR_opt_level, (const byte*)"\x87\x67\x09" "opt_level") +QDEF(MP_QSTR_options, (const byte*)"\xf5\x63\x07" "options") +QDEF(MP_QSTR_ord, (const byte*)"\x1c\x5e\x03" "ord") +QDEF(MP_QSTR_orient, (const byte*)"\x8e\x81\x06" "orient") +QDEF(MP_QSTR_os, (const byte*)"\x79\x6f\x02" "os") +QDEF(MP_QSTR_outline, (const byte*)"\x65\xf7\x07" "outline") +QDEF(MP_QSTR_owb, (const byte*)"\x7f\x5f\x03" "owb") +QDEF(MP_QSTR_pack, (const byte*)"\xbc\xd1\x04" "pack") +QDEF(MP_QSTR_pack_into, (const byte*)"\x1f\xa9\x09" "pack_into") +QDEF(MP_QSTR_pagesize, (const byte*)"\x13\x28\x08" "pagesize") +QDEF(MP_QSTR_params, (const byte*)"\x79\xe2\x06" "params") +QDEF(MP_QSTR_parity, (const byte*)"\x42\x05\x06" "parity") +QDEF(MP_QSTR_partition, (const byte*)"\x87\xe5\x09" "partition") +QDEF(MP_QSTR_password, (const byte*)"\x9a\x6f\x08" "password") +QDEF(MP_QSTR_path, (const byte*)"\x88\xce\x04" "path") +QDEF(MP_QSTR_pattern, (const byte*)"\x2d\xcc\x07" "pattern") +QDEF(MP_QSTR_pause, (const byte*)"\xd7\xbd\x05" "pause") +QDEF(MP_QSTR_peektime, (const byte*)"\x8b\x5c\x08" "peektime") +QDEF(MP_QSTR_pend_throw, (const byte*)"\xf3\x74\x0a" "pend_throw") +QDEF(MP_QSTR_period, (const byte*)"\xa0\xa0\x06" "period") +QDEF(MP_QSTR_phase, (const byte*)"\x6a\xd5\x05" "phase") +QDEF(MP_QSTR_phy_mode, (const byte*)"\x38\xa0\x08" "phy_mode") +QDEF(MP_QSTR_pi, (const byte*)"\x1c\x70\x02" "pi") +QDEF(MP_QSTR_pin, (const byte*)"\xf2\x73\x03" "pin") +QDEF(MP_QSTR_pins, (const byte*)"\x41\xf2\x04" "pins") +QDEF(MP_QSTR_pixel, (const byte*)"\x4d\xf0\x05" "pixel") +QDEF(MP_QSTR_pixels, (const byte*)"\x9e\xf9\x06" "pixels") +QDEF(MP_QSTR_platform, (const byte*)"\x3a\x19\x08" "platform") +QDEF(MP_QSTR_polar, (const byte*)"\x05\x0c\x05" "polar") +QDEF(MP_QSTR_polarity, (const byte*)"\x41\xed\x08" "polarity") +QDEF(MP_QSTR_poll, (const byte*)"\x9a\xd9\x04" "poll") +QDEF(MP_QSTR_polygon, (const byte*)"\x29\xf9\x07" "polygon") +QDEF(MP_QSTR_pop, (const byte*)"\x2a\x73\x03" "pop") +QDEF(MP_QSTR_popitem, (const byte*)"\xbf\x2c\x07" "popitem") +QDEF(MP_QSTR_popleft, (const byte*)"\x71\x9a\x07" "popleft") +QDEF(MP_QSTR_port, (const byte*)"\x5c\xd8\x04" "port") +QDEF(MP_QSTR_pos, (const byte*)"\x29\x73\x03" "pos") +QDEF(MP_QSTR_post, (const byte*)"\x3d\xd8\x04" "post") +QDEF(MP_QSTR_pow, (const byte*)"\x2d\x73\x03" "pow") +QDEF(MP_QSTR_print, (const byte*)"\x54\xc6\x05" "print") +QDEF(MP_QSTR_print_exception, (const byte*)"\x1c\x22\x0f" "print_exception") +QDEF(MP_QSTR_printable, (const byte*)"\xbe\x5d\x09" "printable") +QDEF(MP_QSTR_probereqCB, (const byte*)"\xc8\x0e\x0a" "probereqCB") +QDEF(MP_QSTR_progress, (const byte*)"\xd8\x67\x08" "progress") +QDEF(MP_QSTR_property, (const byte*)"\xc2\x29\x08" "property") +QDEF(MP_QSTR_protocol, (const byte*)"\x33\xf5\x08" "protocol") +QDEF(MP_QSTR_publish, (const byte*)"\x5c\x6a\x07" "publish") +QDEF(MP_QSTR_published_cb, (const byte*)"\x23\x08\x0c" "published_cb") +QDEF(MP_QSTR_pull, (const byte*)"\x80\x7d\x04" "pull") +QDEF(MP_QSTR_push, (const byte*)"\xbb\x7e\x04" "push") +QDEF(MP_QSTR_put, (const byte*)"\x74\x70\x03" "put") +QDEF(MP_QSTR_qos, (const byte*)"\xe8\x77\x03" "qos") +QDEF(MP_QSTR_qstr_info, (const byte*)"\xb0\x81\x09" "qstr_info") +QDEF(MP_QSTR_queryHost, (const byte*)"\xaf\x72\x09" "queryHost") +QDEF(MP_QSTR_queryService, (const byte*)"\x52\x9b\x0c" "queryService") +QDEF(MP_QSTR_r, (const byte*)"\xd7\xb5\x01" "r") +QDEF(MP_QSTR_radians, (const byte*)"\x87\x3f\x07" "radians") +QDEF(MP_QSTR_rainbow, (const byte*)"\x8b\xc7\x07" "rainbow") +QDEF(MP_QSTR_randint, (const byte*)"\xaf\xdc\x07" "randint") +QDEF(MP_QSTR_random, (const byte*)"\xbe\x2c\x06" "random") +QDEF(MP_QSTR_randrange, (const byte*)"\xa3\x3e\x09" "randrange") +QDEF(MP_QSTR_range, (const byte*)"\x1a\x5e\x05" "range") +QDEF(MP_QSTR_raw, (const byte*)"\xe1\x8b\x03" "raw") +QDEF(MP_QSTR_re, (const byte*)"\xd2\x70\x02" "re") +QDEF(MP_QSTR_read, (const byte*)"\xb7\xf9\x04" "read") +QDEF(MP_QSTR_readPixel, (const byte*)"\x5f\x5d\x09" "readPixel") +QDEF(MP_QSTR_readSMS, (const byte*)"\x7a\x6a\x07" "readSMS") +QDEF(MP_QSTR_read_byte, (const byte*)"\x02\x61\x09" "read_byte") +QDEF(MP_QSTR_read_bytes, (const byte*)"\x31\x81\x0a" "read_bytes") +QDEF(MP_QSTR_read_string, (const byte*)"\xfd\x18\x0b" "read_string") +QDEF(MP_QSTR_read_temp, (const byte*)"\xe4\x2e\x09" "read_temp") +QDEF(MP_QSTR_read_tempint, (const byte*)"\x57\x05\x0c" "read_tempint") +QDEF(MP_QSTR_readbyte, (const byte*)"\x7d\xf0\x08" "readbyte") +QDEF(MP_QSTR_readbytes, (const byte*)"\x6e\x00\x09" "readbytes") +QDEF(MP_QSTR_readfrom, (const byte*)"\x41\xb1\x08" "readfrom") +QDEF(MP_QSTR_readfrom_into, (const byte*)"\x82\x3f\x0d" "readfrom_into") +QDEF(MP_QSTR_readfrom_mem, (const byte*)"\x3b\x65\x0c" "readfrom_mem") +QDEF(MP_QSTR_readfrom_mem_into, (const byte*)"\x38\x8e\x11" "readfrom_mem_into") +QDEF(MP_QSTR_readinto, (const byte*)"\x4b\xbf\x08" "readinto") +QDEF(MP_QSTR_readline, (const byte*)"\xf9\x19\x08" "readline") +QDEF(MP_QSTR_readlines, (const byte*)"\x6a\x59\x09" "readlines") +QDEF(MP_QSTR_readln, (const byte*)"\x35\x50\x06" "readln") +QDEF(MP_QSTR_readonly, (const byte*)"\x03\x89\x08" "readonly") +QDEF(MP_QSTR_readraw, (const byte*)"\x13\x0a\x07" "readraw") +QDEF(MP_QSTR_real, (const byte*)"\xbf\xf9\x04" "real") +QDEF(MP_QSTR_rect, (const byte*)"\xe5\xf9\x04" "rect") +QDEF(MP_QSTR_recv, (const byte*)"\xe7\xf9\x04" "recv") +QDEF(MP_QSTR_recvfrom, (const byte*)"\x91\x90\x08" "recvfrom") +QDEF(MP_QSTR_redirectlog, (const byte*)"\x5b\x4c\x0b" "redirectlog") +QDEF(MP_QSTR_register, (const byte*)"\xac\xa1\x08" "register") +QDEF(MP_QSTR_release, (const byte*)"\xec\x8f\x07" "release") +QDEF(MP_QSTR_remove, (const byte*)"\x63\x8a\x06" "remove") +QDEF(MP_QSTR_removeService, (const byte*)"\x5e\xed\x0d" "removeService") +QDEF(MP_QSTR_rename, (const byte*)"\x35\x18\x06" "rename") +QDEF(MP_QSTR_replAcceptMsg, (const byte*)"\xd7\x84\x0d" "replAcceptMsg") +QDEF(MP_QSTR_replace, (const byte*)"\x49\x25\x07" "replace") +QDEF(MP_QSTR_repr, (const byte*)"\xd0\xf7\x04" "repr") +QDEF(MP_QSTR_reset, (const byte*)"\x10\xf4\x05" "reset") +QDEF(MP_QSTR_resetWDT, (const byte*)"\x97\x2b\x08" "resetWDT") +QDEF(MP_QSTR_resetwin, (const byte*)"\x80\xa8\x08" "resetwin") +QDEF(MP_QSTR_reshoot, (const byte*)"\x1d\xeb\x07" "reshoot") +QDEF(MP_QSTR_response, (const byte*)"\xe6\x94\x08" "response") +QDEF(MP_QSTR_restorelog, (const byte*)"\x09\x2e\x0a" "restorelog") +QDEF(MP_QSTR_restorewin, (const byte*)"\x9d\x8d\x0a" "restorewin") +QDEF(MP_QSTR_resume, (const byte*)"\x5c\xb9\x06" "resume") +QDEF(MP_QSTR_retain, (const byte*)"\x60\x2b\x06" "retain") +QDEF(MP_QSTR_reverse, (const byte*)"\x25\x2a\x07" "reverse") +QDEF(MP_QSTR_reversed, (const byte*)"\xa1\x6e\x08" "reversed") +QDEF(MP_QSTR_rfind, (const byte*)"\xd2\x9c\x05" "rfind") +QDEF(MP_QSTR_rfoff, (const byte*)"\x5e\xa5\x05" "rfoff") +QDEF(MP_QSTR_rindex, (const byte*)"\xe9\x2b\x06" "rindex") +QDEF(MP_QSTR_rmdir, (const byte*)"\x45\xa7\x05" "rmdir") +QDEF(MP_QSTR_rom_code, (const byte*)"\xa7\x3c\x08" "rom_code") +QDEF(MP_QSTR_rot, (const byte*)"\xac\x8b\x03" "rot") +QDEF(MP_QSTR_rotate, (const byte*)"\xdc\x7d\x06" "rotate") +QDEF(MP_QSTR_round, (const byte*)"\xe7\x25\x05" "round") +QDEF(MP_QSTR_roundrect, (const byte*)"\xc7\x49\x09" "roundrect") +QDEF(MP_QSTR_rpartition, (const byte*)"\x15\xd0\x0a" "rpartition") +QDEF(MP_QSTR_rsplit, (const byte*)"\xa5\x00\x06" "rsplit") +QDEF(MP_QSTR_rst_pin, (const byte*)"\x58\xf4\x07" "rst_pin") +QDEF(MP_QSTR_rstrip, (const byte*)"\x3b\x95\x06" "rstrip") +QDEF(MP_QSTR_rts, (const byte*)"\x50\x89\x03" "rts") +QDEF(MP_QSTR_rx, (const byte*)"\xcf\x70\x02" "rx") +QDEF(MP_QSTR_ry, (const byte*)"\xce\x70\x02" "ry") +QDEF(MP_QSTR_samecore, (const byte*)"\x24\xe0\x08" "samecore") +QDEF(MP_QSTR_saturation, (const byte*)"\x59\x68\x0a" "saturation") +QDEF(MP_QSTR_savewin, (const byte*)"\x74\x5e\x07" "savewin") +QDEF(MP_QSTR_scale, (const byte*)"\x7d\x51\x05" "scale") +QDEF(MP_QSTR_scan, (const byte*)"\x1a\x8e\x04" "scan") +QDEF(MP_QSTR_schedule, (const byte*)"\xe0\xac\x08" "schedule") +QDEF(MP_QSTR_sck, (const byte*)"\xfe\x8f\x03" "sck") +QDEF(MP_QSTR_scl, (const byte*)"\xf9\x8f\x03" "scl") +QDEF(MP_QSTR_screensize, (const byte*)"\x2c\xe1\x0a" "screensize") +QDEF(MP_QSTR_scroll, (const byte*)"\x28\x5a\x06" "scroll") +QDEF(MP_QSTR_sda, (const byte*)"\x53\x8f\x03" "sda") +QDEF(MP_QSTR_sdconfig, (const byte*)"\xb8\x4d\x08" "sdconfig") +QDEF(MP_QSTR_search, (const byte*)"\xab\xc1\x06" "search") +QDEF(MP_QSTR_secs, (const byte*)"\x43\x75\x04" "secs") +QDEF(MP_QSTR_secure, (const byte*)"\x12\xd0\x06" "secure") +QDEF(MP_QSTR_seed, (const byte*)"\x92\x75\x04" "seed") +QDEF(MP_QSTR_seek, (const byte*)"\x9d\x75\x04" "seek") +QDEF(MP_QSTR_select, (const byte*)"\x8d\x41\x06" "select") +QDEF(MP_QSTR_send, (const byte*)"\xb9\x76\x04" "send") +QDEF(MP_QSTR_sendSMS, (const byte*)"\x34\xcf\x07" "sendSMS") +QDEF(MP_QSTR_sendall, (const byte*)"\x38\x9f\x07" "sendall") +QDEF(MP_QSTR_sendmail, (const byte*)"\x70\x62\x08" "sendmail") +QDEF(MP_QSTR_sendmsg, (const byte*)"\x40\x8d\x07" "sendmsg") +QDEF(MP_QSTR_sendto, (const byte*)"\x22\x03\x06" "sendto") +QDEF(MP_QSTR_sep, (const byte*)"\x23\x8f\x03" "sep") +QDEF(MP_QSTR_seq, (const byte*)"\x22\x8f\x03" "seq") +QDEF(MP_QSTR_server, (const byte*)"\xc0\x28\x06" "server") +QDEF(MP_QSTR_server_hostname, (const byte*)"\x58\xef\x0f" "server_hostname") +QDEF(MP_QSTR_server_side, (const byte*)"\x64\xef\x0b" "server_side") +QDEF(MP_QSTR_service, (const byte*)"\x98\x75\x07" "service") +QDEF(MP_QSTR_set, (const byte*)"\x27\x8f\x03" "set") +QDEF(MP_QSTR_setCalib, (const byte*)"\x42\x7a\x08" "setCalib") +QDEF(MP_QSTR_setHSB, (const byte*)"\xbe\xcd\x06" "setHSB") +QDEF(MP_QSTR_setHSBint, (const byte*)"\xcd\x1a\x09" "setHSBint") +QDEF(MP_QSTR_setWDT, (const byte*)"\xc0\xc0\x06" "setWDT") +QDEF(MP_QSTR_setWhite, (const byte*)"\xc0\x4f\x08" "setWhite") +QDEF(MP_QSTR_set_bg, (const byte*)"\x1d\xe6\x06" "set_bg") +QDEF(MP_QSTR_set_fg, (const byte*)"\x99\xe6\x06" "set_fg") +QDEF(MP_QSTR_set_res, (const byte*)"\x9c\x65\x07" "set_res") +QDEF(MP_QSTR_setattr, (const byte*)"\xd4\xa8\x07" "setattr") +QDEF(MP_QSTR_setblocking, (const byte*)"\x6e\x18\x0b" "setblocking") +QDEF(MP_QSTR_setdata, (const byte*)"\x37\xa7\x07" "setdata") +QDEF(MP_QSTR_setdefault, (const byte*)"\x6c\xa3\x0a" "setdefault") +QDEF(MP_QSTR_setsockopt, (const byte*)"\x38\xe8\x0a" "setsockopt") +QDEF(MP_QSTR_setter, (const byte*)"\x04\x59\x06" "setter") +QDEF(MP_QSTR_settimeout, (const byte*)"\xdc\x8a\x0a" "settimeout") +QDEF(MP_QSTR_setwin, (const byte*)"\x57\x45\x06" "setwin") +QDEF(MP_QSTR_sha1, (const byte*)"\x8e\xac\x04" "sha1") +QDEF(MP_QSTR_sha256, (const byte*)"\x2e\x01\x06" "sha256") +QDEF(MP_QSTR_show, (const byte*)"\x86\xaa\x04" "show") +QDEF(MP_QSTR_sides, (const byte*)"\x4d\xb8\x05" "sides") +QDEF(MP_QSTR_sin, (const byte*)"\xb1\x90\x03" "sin") +QDEF(MP_QSTR_single, (const byte*)"\x3f\x20\x06" "single") +QDEF(MP_QSTR_sinh, (const byte*)"\xb9\xa6\x04" "sinh") +QDEF(MP_QSTR_sizeof, (const byte*)"\x49\x73\x06" "sizeof") +QDEF(MP_QSTR_slave_addr, (const byte*)"\xe4\x95\x0a" "slave_addr") +QDEF(MP_QSTR_slave_bufflen, (const byte*)"\x07\x8f\x0d" "slave_bufflen") +QDEF(MP_QSTR_slavewrite, (const byte*)"\x35\xca\x0a" "slavewrite") +QDEF(MP_QSTR_sleep, (const byte*)"\xea\x27\x05" "sleep") +QDEF(MP_QSTR_sleep_ms, (const byte*)"\x0b\x63\x08" "sleep_ms") +QDEF(MP_QSTR_sleep_us, (const byte*)"\x13\x60\x08" "sleep_us") +QDEF(MP_QSTR_slice, (const byte*)"\xb5\xf4\x05" "slice") +QDEF(MP_QSTR_sms_cb, (const byte*)"\xd6\xca\x06" "sms_cb") +QDEF(MP_QSTR_socket, (const byte*)"\x60\xcc\x06" "socket") +QDEF(MP_QSTR_sort, (const byte*)"\xbf\x9d\x04" "sort") +QDEF(MP_QSTR_sorted, (const byte*)"\x5e\x15\x06" "sorted") +QDEF(MP_QSTR_speed, (const byte*)"\x62\x0f\x05" "speed") +QDEF(MP_QSTR_spihost, (const byte*)"\x6f\x91\x07" "spihost") +QDEF(MP_QSTR_splash, (const byte*)"\xd0\xcb\x06" "splash") +QDEF(MP_QSTR_split, (const byte*)"\xb7\x33\x05" "split") +QDEF(MP_QSTR_splitlines, (const byte*)"\x6a\xd3\x0a" "splitlines") +QDEF(MP_QSTR_sqrt, (const byte*)"\x21\x44\x04" "sqrt") +QDEF(MP_QSTR_ssh, (const byte*)"\xed\x8d\x03" "ssh") +QDEF(MP_QSTR_ssl, (const byte*)"\xe9\x8d\x03" "ssl") +QDEF(MP_QSTR_stack, (const byte*)"\xab\xed\x05" "stack") +QDEF(MP_QSTR_stack_size, (const byte*)"\x31\x3b\x0a" "stack_size") +QDEF(MP_QSTR_stack_use, (const byte*)"\x97\xf7\x09" "stack_use") +QDEF(MP_QSTR_stacksize, (const byte*)"\xce\xdd\x09" "stacksize") +QDEF(MP_QSTR_start, (const byte*)"\x85\xef\x05" "start") +QDEF(MP_QSTR_start_new_thread, (const byte*)"\xd7\x25\x10" "start_new_thread") +QDEF(MP_QSTR_startswith, (const byte*)"\x74\xe8\x0a" "startswith") +QDEF(MP_QSTR_stat, (const byte*)"\xd7\x35\x04" "stat") +QDEF(MP_QSTR_staticmethod, (const byte*)"\x62\xaf\x0c" "staticmethod") +QDEF(MP_QSTR_stations, (const byte*)"\x2c\x1b\x08" "stations") +QDEF(MP_QSTR_status, (const byte*)"\x71\x09\x06" "status") +QDEF(MP_QSTR_statvfs, (const byte*)"\x14\x19\x07" "statvfs") +QDEF(MP_QSTR_stderr, (const byte*)"\xa3\x58\x06" "stderr") +QDEF(MP_QSTR_stdin, (const byte*)"\x21\x04\x05" "stdin") +QDEF(MP_QSTR_stdin_disable, (const byte*)"\xea\x63\x0d" "stdin_disable") +QDEF(MP_QSTR_stdin_get, (const byte*)"\x48\x5a\x09" "stdin_get") +QDEF(MP_QSTR_stdout, (const byte*)"\x08\x83\x06" "stdout") +QDEF(MP_QSTR_stdout_put, (const byte*)"\xe6\x62\x0a" "stdout_put") +QDEF(MP_QSTR_step, (const byte*)"\x57\x36\x04" "step") +QDEF(MP_QSTR_stop, (const byte*)"\x9d\x36\x04" "stop") +QDEF(MP_QSTR_str, (const byte*)"\x50\x8d\x03" "str") +QDEF(MP_QSTR_strftime, (const byte*)"\x43\xf0\x08" "strftime") +QDEF(MP_QSTR_strip, (const byte*)"\x29\x1e\x05" "strip") +QDEF(MP_QSTR_struct, (const byte*)"\x12\x90\x06" "struct") +QDEF(MP_QSTR_stub_led, (const byte*)"\xe7\x8c\x08" "stub_led") +QDEF(MP_QSTR_stub_ledlevel, (const byte*)"\xb1\xff\x0d" "stub_ledlevel") +QDEF(MP_QSTR_stub_ms, (const byte*)"\x14\x88\x07" "stub_ms") +QDEF(MP_QSTR_stub_wait, (const byte*)"\x21\xcd\x09" "stub_wait") +QDEF(MP_QSTR_subject, (const byte*)"\x19\xce\x07" "subject") +QDEF(MP_QSTR_subscribe, (const byte*)"\x0d\x08\x09" "subscribe") +QDEF(MP_QSTR_subscribed_cb, (const byte*)"\xd7\xbb\x0d" "subscribed_cb") +QDEF(MP_QSTR_sum, (const byte*)"\x2e\x8d\x03" "sum") +QDEF(MP_QSTR_super, (const byte*)"\xc4\xb2\x05" "super") +QDEF(MP_QSTR_suspend, (const byte*)"\x6f\xf5\x07" "suspend") +QDEF(MP_QSTR_symmetric_difference, (const byte*)"\xce\x67\x14" "symmetric_difference") +QDEF(MP_QSTR_symmetric_difference_update, (const byte*)"\x60\xf8\x1b" "symmetric_difference_update") +QDEF(MP_QSTR_synced, (const byte*)"\x03\x87\x06" "synced") +QDEF(MP_QSTR_sys, (const byte*)"\xbc\x8e\x03" "sys") +QDEF(MP_QSTR_sysname, (const byte*)"\x9b\x36\x07" "sysname") +QDEF(MP_QSTR_tan, (const byte*)"\xfe\x61\x03" "tan") +QDEF(MP_QSTR_tanh, (const byte*)"\xd6\xa1\x04" "tanh") +QDEF(MP_QSTR_tcs, (const byte*)"\xa1\x61\x03" "tcs") +QDEF(MP_QSTR_tell, (const byte*)"\x14\xb1\x04" "tell") +QDEF(MP_QSTR_telnet, (const byte*)"\x67\x4a\x06" "telnet") +QDEF(MP_QSTR_text, (const byte*)"\x98\xaf\x04" "text") +QDEF(MP_QSTR_textClear, (const byte*)"\x21\x72\x09" "textClear") +QDEF(MP_QSTR_textWidth, (const byte*)"\x7e\x9d\x09" "textWidth") +QDEF(MP_QSTR_tft_deselect, (const byte*)"\x35\x87\x0c" "tft_deselect") +QDEF(MP_QSTR_tft_readcmd, (const byte*)"\x44\x21\x0b" "tft_readcmd") +QDEF(MP_QSTR_tft_select, (const byte*)"\xb4\xea\x0a" "tft_select") +QDEF(MP_QSTR_tft_setspeed, (const byte*)"\xb9\xbc\x0c" "tft_setspeed") +QDEF(MP_QSTR_tft_writecmd, (const byte*)"\x2b\x33\x0c" "tft_writecmd") +QDEF(MP_QSTR_tft_writecmddata, (const byte*)"\x3b\x0f\x10" "tft_writecmddata") +QDEF(MP_QSTR_thick, (const byte*)"\x78\x53\x05" "thick") +QDEF(MP_QSTR_threshold, (const byte*)"\xf2\x2f\x09" "threshold") +QDEF(MP_QSTR_throw, (const byte*)"\xb3\x44\x05" "throw") +QDEF(MP_QSTR_ticks_add, (const byte*)"\x9d\xae\x09" "ticks_add") +QDEF(MP_QSTR_ticks_base, (const byte*)"\x09\x29\x0a" "ticks_base") +QDEF(MP_QSTR_ticks_cpu, (const byte*)"\x1a\xa5\x09" "ticks_cpu") +QDEF(MP_QSTR_ticks_diff, (const byte*)"\xb1\xe0\x0a" "ticks_diff") +QDEF(MP_QSTR_ticks_ms, (const byte*)"\x42\x32\x08" "ticks_ms") +QDEF(MP_QSTR_ticks_us, (const byte*)"\x5a\x31\x08" "ticks_us") +QDEF(MP_QSTR_tickscpu_diff, (const byte*)"\x77\x17\x0d" "tickscpu_diff") +QDEF(MP_QSTR_time, (const byte*)"\xf0\xc1\x04" "time") +QDEF(MP_QSTR_time_pulse_us, (const byte*)"\x89\x0c\x0d" "time_pulse_us") +QDEF(MP_QSTR_timeout, (const byte*)"\x3e\x54\x07" "timeout") +QDEF(MP_QSTR_timer, (const byte*)"\x82\xff\x05" "timer") +QDEF(MP_QSTR_timernum, (const byte*)"\x14\x90\x08" "timernum") +QDEF(MP_QSTR_timings, (const byte*)"\xa6\x89\x07" "timings") +QDEF(MP_QSTR_to, (const byte*)"\x9e\x6f\x02" "to") +QDEF(MP_QSTR_to_bytes, (const byte*)"\xd8\x3e\x08" "to_bytes") +QDEF(MP_QSTR_trace, (const byte*)"\xa4\x43\x05" "trace") +QDEF(MP_QSTR_transparent, (const byte*)"\xc3\xc2\x0b" "transparent") +QDEF(MP_QSTR_triangle, (const byte*)"\xeb\x99\x08" "triangle") +QDEF(MP_QSTR_trigger, (const byte*)"\x9d\x8c\x07" "trigger") +QDEF(MP_QSTR_trunc, (const byte*)"\x5b\x99\x05" "trunc") +QDEF(MP_QSTR_tuple, (const byte*)"\xfd\x41\x05" "tuple") +QDEF(MP_QSTR_tx, (const byte*)"\x89\x6f\x02" "tx") +QDEF(MP_QSTR_txdata, (const byte*)"\x99\x3a\x06" "txdata") +QDEF(MP_QSTR_type, (const byte*)"\x9d\x7f\x04" "type") +QDEF(MP_QSTR_tz, (const byte*)"\x8b\x6f\x02" "tz") +QDEF(MP_QSTR_ubinascii, (const byte*)"\xc4\x88\x09" "ubinascii") +QDEF(MP_QSTR_ucollections, (const byte*)"\x15\x9a\x0c" "ucollections") +QDEF(MP_QSTR_uctypes, (const byte*)"\xf8\x71\x07" "uctypes") +QDEF(MP_QSTR_uerrno, (const byte*)"\xb4\xe9\x06" "uerrno") +QDEF(MP_QSTR_uhashlib, (const byte*)"\x65\x9d\x08" "uhashlib") +QDEF(MP_QSTR_uheapq, (const byte*)"\x1d\x43\x06" "uheapq") +QDEF(MP_QSTR_uio, (const byte*)"\xb6\x66\x03" "uio") +QDEF(MP_QSTR_ujson, (const byte*)"\xe8\x30\x05" "ujson") +QDEF(MP_QSTR_umachine, (const byte*)"\x95\x7f\x08" "umachine") +QDEF(MP_QSTR_umount, (const byte*)"\xdd\x9e\x06" "umount") +QDEF(MP_QSTR_umountsd, (const byte*)"\xaa\xbb\x08" "umountsd") +QDEF(MP_QSTR_uname, (const byte*)"\xb7\x9c\x05" "uname") +QDEF(MP_QSTR_unhexlify, (const byte*)"\xb1\xb9\x09" "unhexlify") +QDEF(MP_QSTR_uniform, (const byte*)"\x01\xf5\x07" "uniform") +QDEF(MP_QSTR_union, (const byte*)"\xf6\x7c\x05" "union") +QDEF(MP_QSTR_unique_id, (const byte*)"\x04\x89\x09" "unique_id") +QDEF(MP_QSTR_unit, (const byte*)"\x83\x49\x04" "unit") +QDEF(MP_QSTR_unlock, (const byte*)"\x15\x88\x06" "unlock") +QDEF(MP_QSTR_unpack, (const byte*)"\x07\x3c\x06" "unpack") +QDEF(MP_QSTR_unpack_from, (const byte*)"\x0e\x6d\x0b" "unpack_from") +QDEF(MP_QSTR_unregister, (const byte*)"\x17\xd4\x0a" "unregister") +QDEF(MP_QSTR_unsubscribe, (const byte*)"\xd6\xa0\x0b" "unsubscribe") +QDEF(MP_QSTR_unsubscribed_cb, (const byte*)"\x4c\x96\x0f" "unsubscribed_cb") +QDEF(MP_QSTR_uos, (const byte*)"\xec\x67\x03" "uos") +QDEF(MP_QSTR_update, (const byte*)"\xb4\x76\x06" "update") +QDEF(MP_QSTR_update_period, (const byte*)"\x0e\x65\x0d" "update_period") +QDEF(MP_QSTR_upper, (const byte*)"\x27\x94\x05" "upper") +QDEF(MP_QSTR_urandom, (const byte*)"\xab\xae\x07" "urandom") +QDEF(MP_QSTR_ure, (const byte*)"\x87\x63\x03" "ure") +QDEF(MP_QSTR_url, (const byte*)"\x8e\x63\x03" "url") +QDEF(MP_QSTR_uselect, (const byte*)"\x58\x8e\x07" "uselect") +QDEF(MP_QSTR_user, (const byte*)"\x54\xf1\x04" "user") +QDEF(MP_QSTR_usocket, (const byte*)"\x75\x00\x07" "usocket") +QDEF(MP_QSTR_ussl, (const byte*)"\x1c\xf2\x04" "ussl") +QDEF(MP_QSTR_ustruct, (const byte*)"\x47\x08\x07" "ustruct") +QDEF(MP_QSTR_utime, (const byte*)"\xe5\x9d\x05" "utime") +QDEF(MP_QSTR_utimeq, (const byte*)"\xf4\x5a\x06" "utimeq") +QDEF(MP_QSTR_uzlib, (const byte*)"\x6d\x9b\x05" "uzlib") +QDEF(MP_QSTR_value, (const byte*)"\x4e\x34\x05" "value") +QDEF(MP_QSTR_values, (const byte*)"\x7d\xbe\x06" "values") +QDEF(MP_QSTR_verbose, (const byte*)"\x1f\x84\x07" "verbose") +QDEF(MP_QSTR_version, (const byte*)"\xbf\xd3\x07" "version") +QDEF(MP_QSTR_version_info, (const byte*)"\x6e\x0a\x0c" "version_info") +QDEF(MP_QSTR_vline, (const byte*)"\x1d\xf6\x05" "vline") +QDEF(MP_QSTR_vref, (const byte*)"\xe2\x78\x04" "vref") +QDEF(MP_QSTR_vref_topin, (const byte*)"\xb1\xaa\x0a" "vref_topin") +QDEF(MP_QSTR_wait, (const byte*)"\x8e\x55\x04" "wait") +QDEF(MP_QSTR_wake_description, (const byte*)"\x04\x8d\x10" "wake_description") +QDEF(MP_QSTR_wake_on_ext0, (const byte*)"\x05\xdc\x0c" "wake_on_ext0") +QDEF(MP_QSTR_wake_on_ext1, (const byte*)"\x04\xdc\x0c" "wake_on_ext1") +QDEF(MP_QSTR_wake_reason, (const byte*)"\x66\xc6\x0b" "wake_reason") +QDEF(MP_QSTR_websocket, (const byte*)"\x90\x8d\x09" "websocket") +QDEF(MP_QSTR_white, (const byte*)"\x42\xc3\x05" "white") +QDEF(MP_QSTR_width, (const byte*)"\x23\x75\x05" "width") +QDEF(MP_QSTR_wifiactive, (const byte*)"\x58\x33\x0a" "wifiactive") +QDEF(MP_QSTR_wifimode, (const byte*)"\x17\x91\x08" "wifimode") +QDEF(MP_QSTR_winsize, (const byte*)"\xd0\x0e\x07" "winsize") +QDEF(MP_QSTR_wrap, (const byte*)"\x51\xfc\x04" "wrap") +QDEF(MP_QSTR_wrap_socket, (const byte*)"\xcb\xf3\x0b" "wrap_socket") +QDEF(MP_QSTR_write, (const byte*)"\x98\xa8\x05" "write") +QDEF(MP_QSTR_write_break, (const byte*)"\x78\x98\x0b" "write_break") +QDEF(MP_QSTR_write_byte, (const byte*)"\x8d\x8d\x0a" "write_byte") +QDEF(MP_QSTR_write_bytes, (const byte*)"\x5e\x3f\x0b" "write_bytes") +QDEF(MP_QSTR_write_readinto, (const byte*)"\x89\x84\x0e" "write_readinto") +QDEF(MP_QSTR_write_string, (const byte*)"\xb2\x83\x0c" "write_string") +QDEF(MP_QSTR_writebyte, (const byte*)"\xd2\x1e\x09" "writebyte") +QDEF(MP_QSTR_writebytes, (const byte*)"\x61\xf9\x0a" "writebytes") +QDEF(MP_QSTR_writeto, (const byte*)"\x03\x39\x07" "writeto") +QDEF(MP_QSTR_writeto_mem, (const byte*)"\x79\xed\x0b" "writeto_mem") +QDEF(MP_QSTR_x, (const byte*)"\xdd\xb5\x01" "x") +QDEF(MP_QSTR_x1, (const byte*)"\x4c\x71\x02" "x1") +QDEF(MP_QSTR_x2, (const byte*)"\x4f\x71\x02" "x2") +QDEF(MP_QSTR_y, (const byte*)"\xdc\xb5\x01" "y") +QDEF(MP_QSTR_y1, (const byte*)"\x6d\x71\x02" "y1") +QDEF(MP_QSTR_y2, (const byte*)"\x6e\x71\x02" "y2") +QDEF(MP_QSTR_ymodem, (const byte*)"\xf2\x89\x06" "ymodem") +QDEF(MP_QSTR_zip, (const byte*)"\xe6\xac\x03" "zip") +QDEF(MP_QSTR_zlib, (const byte*)"\xf8\x37\x04" "zlib") diff --git a/MicroPython_BUILD/components/micropython/lib/utils/pyexec.c b/MicroPython_BUILD/components/micropython/lib/utils/pyexec.c index c8f7b683..15a5ce95 100644 --- a/MicroPython_BUILD/components/micropython/lib/utils/pyexec.c +++ b/MicroPython_BUILD/components/micropython/lib/utils/pyexec.c @@ -374,6 +374,7 @@ int pyexec_raw_repl(void) { return ret; } } + return 0; } int pyexec_friendly_repl(void) { @@ -499,6 +500,7 @@ int pyexec_friendly_repl(void) { return ret; } } + return 0; } #endif // MICROPY_REPL_EVENT_DRIVEN diff --git a/MicroPython_BUILD/components/micropython/py/modsys.c b/MicroPython_BUILD/components/micropython/py/modsys.c index 174c32f0..dbb61690 100644 --- a/MicroPython_BUILD/components/micropython/py/modsys.c +++ b/MicroPython_BUILD/components/micropython/py/modsys.c @@ -26,6 +26,8 @@ * THE SOFTWARE. */ +#include "sdkconfig.h" +#include #include #include "py/builtin.h" #include "py/objlist.h" @@ -36,6 +38,9 @@ #include "py/stream.h" #include "py/smallint.h" #include "py/runtime.h" +#include "lib/utils/pyexec.h" +#include "modmachine.h" +#include "machine_rtc.h" #if MICROPY_PY_SYS @@ -101,6 +106,7 @@ STATIC mp_obj_t mp_sys_exit(size_t n_args, const mp_obj_t *args) { exc = mp_obj_new_exception_arg1(&mp_type_SystemExit, args[0]); } nlr_raise(exc); + return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_exit_obj, 0, 1, mp_sys_exit); @@ -158,23 +164,94 @@ STATIC mp_obj_t mp_sys_mpycore() { } MP_DEFINE_CONST_FUN_OBJ_0(mp_sys_mpycore_obj, mp_sys_mpycore); +#ifdef CONFIG_MICROPY_USE_THREADED_REPL +//------------------------------------ +STATIC mp_obj_t mp_sys_exec_repl(void) +{ + for (;;) { + if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) { + if (pyexec_raw_repl() != 0) { + break; + } + } + else { + if (pyexec_friendly_repl() != 0) { + break; + } + } + } + prepareSleepReset(0, "ESP32: soft reboot\r\n"); + esp_restart(); // no return !! + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_sys_exec_repl_obj, mp_sys_exec_repl); + +//------------------------------------- +STATIC mp_obj_t mp_sys_stack_size(void) +{ + return mp_obj_new_int(mpy_repl_stack_size); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_sys_stack_size_obj, mp_sys_stack_size); +#endif + +//------------------------------------------------------------------ +STATIC mp_obj_t mp_sys_timezone(size_t n_args, const mp_obj_t *args) +{ + if (n_args == 0) { + char tzs[64] = {'\0'}; + if (strlen(mpy_time_zone) == 0) { + // Try to get tz from NVS + tz_fromto_NVS(tzs, NULL); + if (strlen(tzs) > 0) { + strcpy(mpy_time_zone, tzs); + setenv("TZ", mpy_time_zone, 1); + tzset(); + } + } + else strcpy(tzs, mpy_time_zone); + } + else { + const char *newtzs = mp_obj_str_get_str(args[0]); + if (strcmp(newtzs, mpy_time_zone) != 0) { + if ((strlen(newtzs) > 2) && (strlen(newtzs) < 64)) { + sprintf(mpy_time_zone, "%s", newtzs); + tz_fromto_NVS(NULL, mpy_time_zone); + } + else { + mp_raise_ValueError("tz string length must be 3 - 64"); + } + } + setenv("TZ", mpy_time_zone, 1); + tzset(); + } + + return mp_obj_new_str(mpy_time_zone, strlen(mpy_time_zone)); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_timezone_obj, 0, 1, mp_sys_timezone); + + //============================================================== STATIC const mp_rom_map_elem_t mp_module_sys_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sys) }, - { MP_ROM_QSTR(MP_QSTR_path), MP_ROM_PTR(&MP_STATE_VM(mp_sys_path_obj)) }, - { MP_ROM_QSTR(MP_QSTR_argv), MP_ROM_PTR(&MP_STATE_VM(mp_sys_argv_obj)) }, - { MP_ROM_QSTR(MP_QSTR_version), MP_ROM_PTR(&version_obj) }, - { MP_ROM_QSTR(MP_QSTR_version_info), MP_ROM_PTR(&mp_sys_version_info_obj) }, - { MP_ROM_QSTR(MP_QSTR_implementation), MP_ROM_PTR(&mp_sys_implementation_obj) }, - { MP_ROM_QSTR(MP_QSTR_mpycore), MP_ROM_PTR(&mp_sys_mpycore_obj) }, + #ifdef CONFIG_MICROPY_USE_THREADED_REPL + { MP_ROM_QSTR(MP_QSTR_REPL), MP_ROM_PTR(&mp_sys_exec_repl_obj) }, + { MP_ROM_QSTR(MP_QSTR_stackSize), MP_ROM_PTR(&mp_sys_stack_size_obj) }, + #endif + { MP_ROM_QSTR(MP_QSTR_path), MP_ROM_PTR(&MP_STATE_VM(mp_sys_path_obj)) }, + { MP_ROM_QSTR(MP_QSTR_argv), MP_ROM_PTR(&MP_STATE_VM(mp_sys_argv_obj)) }, + { MP_ROM_QSTR(MP_QSTR_version), MP_ROM_PTR(&version_obj) }, + { MP_ROM_QSTR(MP_QSTR_version_info), MP_ROM_PTR(&mp_sys_version_info_obj) }, + { MP_ROM_QSTR(MP_QSTR_implementation), MP_ROM_PTR(&mp_sys_implementation_obj) }, + { MP_ROM_QSTR(MP_QSTR_mpycore), MP_ROM_PTR(&mp_sys_mpycore_obj) }, + { MP_ROM_QSTR(MP_QSTR_tz), MP_ROM_PTR(&mp_sys_timezone_obj) }, #ifdef MICROPY_PY_SYS_PLATFORM - { MP_ROM_QSTR(MP_QSTR_platform), MP_ROM_PTR(&platform_obj) }, + { MP_ROM_QSTR(MP_QSTR_platform), MP_ROM_PTR(&platform_obj) }, #endif #if MP_ENDIANNESS_LITTLE - { MP_ROM_QSTR(MP_QSTR_byteorder), MP_ROM_QSTR(MP_QSTR_little) }, + { MP_ROM_QSTR(MP_QSTR_byteorder), MP_ROM_QSTR(MP_QSTR_little) }, #else - { MP_ROM_QSTR(MP_QSTR_byteorder), MP_ROM_QSTR(MP_QSTR_big) }, + { MP_ROM_QSTR(MP_QSTR_byteorder), MP_ROM_QSTR(MP_QSTR_big) }, #endif #if MICROPY_PY_SYS_MAXSIZE @@ -184,37 +261,37 @@ STATIC const mp_rom_map_elem_t mp_module_sys_globals_table[] = { // to not try to compare sys.maxsize to some literal number (as this // number might not fit in available int size), but instead count number // of "one" bits in sys.maxsize. - { MP_ROM_QSTR(MP_QSTR_maxsize), MP_ROM_INT(MP_SMALL_INT_MAX) }, + { MP_ROM_QSTR(MP_QSTR_maxsize), MP_ROM_INT(MP_SMALL_INT_MAX) }, #else - { MP_ROM_QSTR(MP_QSTR_maxsize), MP_ROM_PTR(&mp_maxsize_obj) }, + { MP_ROM_QSTR(MP_QSTR_maxsize), MP_ROM_PTR(&mp_maxsize_obj) }, #endif #endif #if MICROPY_PY_SYS_EXIT - { MP_ROM_QSTR(MP_QSTR_exit), MP_ROM_PTR(&mp_sys_exit_obj) }, + { MP_ROM_QSTR(MP_QSTR_exit), MP_ROM_PTR(&mp_sys_exit_obj) }, #endif #if MICROPY_PY_SYS_STDFILES - { MP_ROM_QSTR(MP_QSTR_stdin), MP_ROM_PTR(&mp_sys_stdin_obj) }, - { MP_ROM_QSTR(MP_QSTR_stdout), MP_ROM_PTR(&mp_sys_stdout_obj) }, - { MP_ROM_QSTR(MP_QSTR_stderr), MP_ROM_PTR(&mp_sys_stderr_obj) }, + { MP_ROM_QSTR(MP_QSTR_stdin), MP_ROM_PTR(&mp_sys_stdin_obj) }, + { MP_ROM_QSTR(MP_QSTR_stdout), MP_ROM_PTR(&mp_sys_stdout_obj) }, + { MP_ROM_QSTR(MP_QSTR_stderr), MP_ROM_PTR(&mp_sys_stderr_obj) }, #endif #if MICROPY_PY_SYS_MODULES - { MP_ROM_QSTR(MP_QSTR_modules), MP_ROM_PTR(&MP_STATE_VM(mp_loaded_modules_dict)) }, + { MP_ROM_QSTR(MP_QSTR_modules), MP_ROM_PTR(&MP_STATE_VM(mp_loaded_modules_dict)) }, #endif #if MICROPY_PY_SYS_EXC_INFO - { MP_ROM_QSTR(MP_QSTR_exc_info), MP_ROM_PTR(&mp_sys_exc_info_obj) }, + { MP_ROM_QSTR(MP_QSTR_exc_info), MP_ROM_PTR(&mp_sys_exc_info_obj) }, #endif #if MICROPY_PY_SYS_GETSIZEOF - { MP_ROM_QSTR(MP_QSTR_getsizeof), MP_ROM_PTR(&mp_sys_getsizeof_obj) }, + { MP_ROM_QSTR(MP_QSTR_getsizeof), MP_ROM_PTR(&mp_sys_getsizeof_obj) }, #endif /* * Extensions to CPython */ - { MP_ROM_QSTR(MP_QSTR_print_exception), MP_ROM_PTR(&mp_sys_print_exception_obj) }, + { MP_ROM_QSTR(MP_QSTR_print_exception), MP_ROM_PTR(&mp_sys_print_exception_obj) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_sys_globals, mp_module_sys_globals_table); diff --git a/MicroPython_BUILD/components/micropython/py/modthread.c b/MicroPython_BUILD/components/micropython/py/modthread.c index 95286c66..b3795e88 100644 --- a/MicroPython_BUILD/components/micropython/py/modthread.c +++ b/MicroPython_BUILD/components/micropython/py/modthread.c @@ -36,13 +36,11 @@ #include "py/mpthread.h" #include "mphalport.h" -extern TaskHandle_t MainTaskHandle; - /****************************************************************/ // _thread module -STATIC size_t thread_stack_size = MP_THREAD_DEFAULT_STACK_SIZE; +size_t thread_stack_size = MP_THREAD_DEFAULT_STACK_SIZE; //-------------------------------------------------------------------------- STATIC mp_obj_t mod_thread_stack_size(size_t n_args, const mp_obj_t *args) { @@ -78,8 +76,8 @@ typedef struct _thread_entry_args_t { mp_obj_t args[]; } thread_entry_args_t; -//-------------------------------------- -STATIC void *thread_entry(void *args_in) +//------------------------------- +void *thread_entry(void *args_in) { // Execution begins here for a new thread. We do not have the GIL. @@ -312,10 +310,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_thread_isnotified_obj, mod_thread_isnotifie //-------------------------------------- STATIC mp_obj_t mod_thread_getREPLId() { - return mp_obj_new_int_from_uint((uintptr_t)MainTaskHandle); + return mp_obj_new_int_from_uint((uintptr_t)ReplTaskHandle); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_thread_getREPLId_obj, mod_thread_getREPLId); +//-------------------------------------- +STATIC mp_obj_t mod_thread_getMAINId() { + return mp_obj_new_int_from_uint((uintptr_t)MainTaskHandle); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_thread_getMAINId_obj, mod_thread_getMAINId); + //-------------------------------------- STATIC mp_obj_t mod_thread_getnotify() { @@ -439,6 +443,7 @@ STATIC mp_obj_t mod_thread_list(mp_uint_t n_args, const mp_obj_t *args) { char th_type[8] = {'\0'}; char th_state[16] = {'\0'}; if (thr->type == THREAD_TYPE_MAIN) sprintf(th_type, "MAIN"); + else if (thr->type == THREAD_TYPE_REPL) sprintf(th_type, "REPL"); else if (thr->type == THREAD_TYPE_PYTHON) sprintf(th_type, "PYTHON"); else if (thr->type == THREAD_TYPE_SERVICE) sprintf(th_type, "SERVICE"); else sprintf(th_type, "Unknown"); @@ -532,6 +537,19 @@ STATIC mp_obj_t mod_thread_replAcceptMsg(mp_uint_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_thread_replAcceptMsg_obj, 0, 1, mod_thread_replAcceptMsg); +//-------------------------------------------------------------------------------- +STATIC mp_obj_t mod_thread_mainAcceptMsg(mp_uint_t n_args, const mp_obj_t *args) { + int res = 0; + if (n_args == 0) { + res = mp_thread_mainAcceptMsg(-1); + } + else { + res = mp_thread_mainAcceptMsg(mp_obj_is_true(args[0])); + } + return mp_obj_new_bool(res); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_thread_mainAcceptMsg_obj, 0, 1, mod_thread_mainAcceptMsg); + //----------------------------------------------------------------------------- STATIC mp_obj_t mod_thread_waitnotify(mp_uint_t n_args, const mp_obj_t *args) { uint32_t tmo = portMAX_DELAY; @@ -588,7 +606,9 @@ STATIC const mp_rom_map_elem_t mp_module_thread_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_getnotification), MP_ROM_PTR(&mod_thread_getnotify_obj) }, { MP_ROM_QSTR(MP_QSTR_isnotified), MP_ROM_PTR(&mod_thread_isnotified_obj) }, { MP_ROM_QSTR(MP_QSTR_getReplID), MP_ROM_PTR(&mod_thread_getREPLId_obj) }, + { MP_ROM_QSTR(MP_QSTR_getMainID), MP_ROM_PTR(&mod_thread_getMAINId_obj) }, { MP_ROM_QSTR(MP_QSTR_replAcceptMsg), MP_ROM_PTR(&mod_thread_replAcceptMsg_obj) }, + { MP_ROM_QSTR(MP_QSTR_mainAcceptMsg), MP_ROM_PTR(&mod_thread_mainAcceptMsg_obj) }, { MP_ROM_QSTR(MP_QSTR_sendmsg), MP_ROM_PTR(&mod_thread_sendmsg_obj) }, { MP_ROM_QSTR(MP_QSTR_getmsg), MP_ROM_PTR(&mod_thread_getmsg_obj) }, { MP_ROM_QSTR(MP_QSTR_list), MP_ROM_PTR(&mod_thread_list_obj) }, diff --git a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32.zip b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32.zip index 0be99d13..0ba73006 100644 Binary files a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32.zip and b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32.zip differ diff --git a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_all.zip b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_all.zip index 1fd7a749..84de4c9c 100644 Binary files a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_all.zip and b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_all.zip differ diff --git a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_ota.zip b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_ota.zip index 0ebe973a..c7df15b7 100644 Binary files a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_ota.zip and b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_ota.zip differ diff --git a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram.zip b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram.zip index bbb45a98..7c0b8d47 100644 Binary files a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram.zip and b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram.zip differ diff --git a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_all.zip b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_all.zip index c7afee74..eb865f9d 100644 Binary files a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_all.zip and b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_all.zip differ diff --git a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_ota.zip b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_ota.zip index 618eea4f..75a775fc 100644 Binary files a/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_ota.zip and b/MicroPython_BUILD/firmware/MicroPython_LoBo_esp32_psram_ota.zip differ diff --git a/MicroPython_BUILD/firmware/esp32/MicroPython.bin b/MicroPython_BUILD/firmware/esp32/MicroPython.bin index 92ba6f8f..070b3986 100644 Binary files a/MicroPython_BUILD/firmware/esp32/MicroPython.bin and b/MicroPython_BUILD/firmware/esp32/MicroPython.bin differ diff --git a/MicroPython_BUILD/firmware/esp32/bootloader/bootloader.bin b/MicroPython_BUILD/firmware/esp32/bootloader/bootloader.bin index 543f9600..c676a9a5 100644 Binary files a/MicroPython_BUILD/firmware/esp32/bootloader/bootloader.bin and b/MicroPython_BUILD/firmware/esp32/bootloader/bootloader.bin differ diff --git a/MicroPython_BUILD/firmware/esp32/sdkconfig b/MicroPython_BUILD/firmware/esp32/sdkconfig index e9eff6bf..eafeaef6 100644 --- a/MicroPython_BUILD/firmware/esp32/sdkconfig +++ b/MicroPython_BUILD/firmware/esp32/sdkconfig @@ -93,6 +93,7 @@ CONFIG_MICRO_PY_LOG_LEVEL2=y CONFIG_MICRO_PY_LOG_LEVEL3= CONFIG_MICRO_PY_LOG_LEVEL4= CONFIG_MICRO_PY_LOG_LEVEL5= +CONFIG_MICROPY_USE_THREADED_REPL= CONFIG_MICROPY_RX_BUFFER_SIZE=1080 CONFIG_MICROPY_USE_TASK_WDT=y CONFIG_MICROPY_USE_BOTH_CORES= diff --git a/MicroPython_BUILD/firmware/esp32_all/MicroPython.bin b/MicroPython_BUILD/firmware/esp32_all/MicroPython.bin index 3ef432b9..de58c20c 100644 Binary files a/MicroPython_BUILD/firmware/esp32_all/MicroPython.bin and b/MicroPython_BUILD/firmware/esp32_all/MicroPython.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_all/bootloader/bootloader.bin b/MicroPython_BUILD/firmware/esp32_all/bootloader/bootloader.bin index 406b9c6c..66bbf6ec 100644 Binary files a/MicroPython_BUILD/firmware/esp32_all/bootloader/bootloader.bin and b/MicroPython_BUILD/firmware/esp32_all/bootloader/bootloader.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_all/partitions_mpy.bin b/MicroPython_BUILD/firmware/esp32_all/partitions_mpy.bin index 0bdd9d71..f37f3bfa 100644 Binary files a/MicroPython_BUILD/firmware/esp32_all/partitions_mpy.bin and b/MicroPython_BUILD/firmware/esp32_all/partitions_mpy.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_all/sdkconfig b/MicroPython_BUILD/firmware/esp32_all/sdkconfig index 81e809fb..e6c32b35 100644 --- a/MicroPython_BUILD/firmware/esp32_all/sdkconfig +++ b/MicroPython_BUILD/firmware/esp32_all/sdkconfig @@ -93,6 +93,7 @@ CONFIG_MICRO_PY_LOG_LEVEL2=y CONFIG_MICRO_PY_LOG_LEVEL3= CONFIG_MICRO_PY_LOG_LEVEL4= CONFIG_MICRO_PY_LOG_LEVEL5= +CONFIG_MICROPY_USE_THREADED_REPL= CONFIG_MICROPY_RX_BUFFER_SIZE=1080 CONFIG_MICROPY_USE_TASK_WDT=y CONFIG_MICROPY_USE_BOTH_CORES= diff --git a/MicroPython_BUILD/firmware/esp32_ota/MicroPython.bin b/MicroPython_BUILD/firmware/esp32_ota/MicroPython.bin index 0947e2cf..eef3eed3 100644 Binary files a/MicroPython_BUILD/firmware/esp32_ota/MicroPython.bin and b/MicroPython_BUILD/firmware/esp32_ota/MicroPython.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_ota/bootloader/bootloader.bin b/MicroPython_BUILD/firmware/esp32_ota/bootloader/bootloader.bin index aae4ece3..f3e2349b 100644 Binary files a/MicroPython_BUILD/firmware/esp32_ota/bootloader/bootloader.bin and b/MicroPython_BUILD/firmware/esp32_ota/bootloader/bootloader.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_ota/sdkconfig b/MicroPython_BUILD/firmware/esp32_ota/sdkconfig index 6a43d488..5ed54448 100644 --- a/MicroPython_BUILD/firmware/esp32_ota/sdkconfig +++ b/MicroPython_BUILD/firmware/esp32_ota/sdkconfig @@ -94,6 +94,7 @@ CONFIG_MICRO_PY_LOG_LEVEL2=y CONFIG_MICRO_PY_LOG_LEVEL3= CONFIG_MICRO_PY_LOG_LEVEL4= CONFIG_MICRO_PY_LOG_LEVEL5= +CONFIG_MICROPY_USE_THREADED_REPL= CONFIG_MICROPY_RX_BUFFER_SIZE=1080 CONFIG_MICROPY_USE_TASK_WDT=y CONFIG_MICROPY_USE_BOTH_CORES= diff --git a/MicroPython_BUILD/firmware/esp32_psram/MicroPython.bin b/MicroPython_BUILD/firmware/esp32_psram/MicroPython.bin index b5503972..7317609a 100644 Binary files a/MicroPython_BUILD/firmware/esp32_psram/MicroPython.bin and b/MicroPython_BUILD/firmware/esp32_psram/MicroPython.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_psram/bootloader/bootloader.bin b/MicroPython_BUILD/firmware/esp32_psram/bootloader/bootloader.bin index 2a6b6f56..a4ca26ef 100644 Binary files a/MicroPython_BUILD/firmware/esp32_psram/bootloader/bootloader.bin and b/MicroPython_BUILD/firmware/esp32_psram/bootloader/bootloader.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_psram/sdkconfig b/MicroPython_BUILD/firmware/esp32_psram/sdkconfig index 4c3d6ce3..5975194a 100644 --- a/MicroPython_BUILD/firmware/esp32_psram/sdkconfig +++ b/MicroPython_BUILD/firmware/esp32_psram/sdkconfig @@ -93,6 +93,7 @@ CONFIG_MICRO_PY_LOG_LEVEL2=y CONFIG_MICRO_PY_LOG_LEVEL3= CONFIG_MICRO_PY_LOG_LEVEL4= CONFIG_MICRO_PY_LOG_LEVEL5= +CONFIG_MICROPY_USE_THREADED_REPL= CONFIG_MICROPY_RX_BUFFER_SIZE=1080 CONFIG_MICROPY_USE_TASK_WDT=y CONFIG_MICROPY_USE_BOTH_CORES= diff --git a/MicroPython_BUILD/firmware/esp32_psram_all/MicroPython.bin b/MicroPython_BUILD/firmware/esp32_psram_all/MicroPython.bin index 083724ab..d121374b 100644 Binary files a/MicroPython_BUILD/firmware/esp32_psram_all/MicroPython.bin and b/MicroPython_BUILD/firmware/esp32_psram_all/MicroPython.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_psram_all/bootloader/bootloader.bin b/MicroPython_BUILD/firmware/esp32_psram_all/bootloader/bootloader.bin index 8055eb03..d6ce8bae 100644 Binary files a/MicroPython_BUILD/firmware/esp32_psram_all/bootloader/bootloader.bin and b/MicroPython_BUILD/firmware/esp32_psram_all/bootloader/bootloader.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_psram_all/sdkconfig b/MicroPython_BUILD/firmware/esp32_psram_all/sdkconfig index 97e2389c..da109b9d 100644 --- a/MicroPython_BUILD/firmware/esp32_psram_all/sdkconfig +++ b/MicroPython_BUILD/firmware/esp32_psram_all/sdkconfig @@ -93,6 +93,7 @@ CONFIG_MICRO_PY_LOG_LEVEL2=y CONFIG_MICRO_PY_LOG_LEVEL3= CONFIG_MICRO_PY_LOG_LEVEL4= CONFIG_MICRO_PY_LOG_LEVEL5= +CONFIG_MICROPY_USE_THREADED_REPL= CONFIG_MICROPY_RX_BUFFER_SIZE=1080 CONFIG_MICROPY_USE_TASK_WDT=y CONFIG_MICROPY_USE_BOTH_CORES= diff --git a/MicroPython_BUILD/firmware/esp32_psram_ota/MicroPython.bin b/MicroPython_BUILD/firmware/esp32_psram_ota/MicroPython.bin index 35876c0b..338e9145 100644 Binary files a/MicroPython_BUILD/firmware/esp32_psram_ota/MicroPython.bin and b/MicroPython_BUILD/firmware/esp32_psram_ota/MicroPython.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_psram_ota/bootloader/bootloader.bin b/MicroPython_BUILD/firmware/esp32_psram_ota/bootloader/bootloader.bin index a0108aef..372650c4 100644 Binary files a/MicroPython_BUILD/firmware/esp32_psram_ota/bootloader/bootloader.bin and b/MicroPython_BUILD/firmware/esp32_psram_ota/bootloader/bootloader.bin differ diff --git a/MicroPython_BUILD/firmware/esp32_psram_ota/sdkconfig b/MicroPython_BUILD/firmware/esp32_psram_ota/sdkconfig index 82976673..b52f0fe5 100644 --- a/MicroPython_BUILD/firmware/esp32_psram_ota/sdkconfig +++ b/MicroPython_BUILD/firmware/esp32_psram_ota/sdkconfig @@ -94,6 +94,7 @@ CONFIG_MICRO_PY_LOG_LEVEL2=y CONFIG_MICRO_PY_LOG_LEVEL3= CONFIG_MICRO_PY_LOG_LEVEL4= CONFIG_MICRO_PY_LOG_LEVEL5= +CONFIG_MICROPY_USE_THREADED_REPL= CONFIG_MICROPY_RX_BUFFER_SIZE=1080 CONFIG_MICROPY_USE_TASK_WDT=y CONFIG_MICROPY_USE_BOTH_CORES=