From d0db93cf1ff8eb8b2db63da07dd14d86577eebd1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Jul 2017 11:43:35 +1000 Subject: [PATCH 001/403] unix/modsocket: Remove unnecessary asserts. These checks are already made, and errors reported, by the uPy runtime. --- unix/modsocket.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/unix/modsocket.c b/unix/modsocket.c index c7be6461e..c1f88defc 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -391,7 +391,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_socket_htons_obj, mod_socket_htons); STATIC mp_obj_t mod_socket_gethostbyname(mp_obj_t arg) { - assert(MP_OBJ_IS_TYPE(arg, &mp_type_str)); const char *s = mp_obj_str_get_str(arg); struct hostent *h = gethostbyname(s); if (h == NULL) { @@ -441,9 +440,7 @@ STATIC mp_obj_t mod_socket_inet_ntop(mp_obj_t family_in, mp_obj_t binaddr_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_socket_inet_ntop_obj, mod_socket_inet_ntop); STATIC mp_obj_t mod_socket_getaddrinfo(size_t n_args, const mp_obj_t *args) { - // TODO: Implement all args - assert(n_args >= 2 && n_args <= 4); - assert(MP_OBJ_IS_STR(args[0])); + // TODO: Implement 5th and 6th args const char *host = mp_obj_str_get_str(args[0]); const char *serv = NULL; @@ -510,7 +507,7 @@ STATIC mp_obj_t mod_socket_getaddrinfo(size_t n_args, const mp_obj_t *args) { freeaddrinfo(addr_list); return list; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_socket_getaddrinfo_obj, 2, 6, mod_socket_getaddrinfo); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_socket_getaddrinfo_obj, 2, 4, mod_socket_getaddrinfo); STATIC mp_obj_t mod_socket_sockaddr(mp_obj_t sockaddr_in) { mp_buffer_info_t bufinfo; From 1e6fd9f2b4072873f5d6846b19b2ef0ccc5e4e52 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Jul 2017 11:56:32 +1000 Subject: [PATCH 002/403] unix/Makefile: Disable assertions in the standard unix executable. Reasons to disable: - the code is relatively robust so doesn't need full checking in the main executable, and the coverage build is used for full testing with assertions still enabled; - reduces code size noticeably, by 27k for x86-64 and 20k for x86; - allows to more easily track changes in code size, since assertions can skew things. --- unix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/Makefile b/unix/Makefile index be324dd3d..83c79ac96 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -30,7 +30,7 @@ ifdef DEBUG CFLAGS += -g COPT = -O0 else -COPT = -Os -fdata-sections -ffunction-sections #-DNDEBUG +COPT = -Os -fdata-sections -ffunction-sections -DNDEBUG # _FORTIFY_SOURCE is a feature in gcc/glibc which is intended to provide extra # security for detecting buffer overflows. Some distros (Ubuntu at the very least) # have it enabled by default. From 12d4fa9b37408ed682e52c3d78ecd6c269a4904a Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Jul 2017 12:17:38 +1000 Subject: [PATCH 003/403] py/gc: Refactor assertions in gc_free function. gc_free() expects either NULL or a valid pointer into the heap, so the checks for a valid pointer can be turned into assertions. --- py/gc.c | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/py/gc.c b/py/gc.c index 937dae44f..2af886c56 100644 --- a/py/gc.c +++ b/py/gc.c @@ -536,37 +536,34 @@ void gc_free(void *ptr) { DEBUG_printf("gc_free(%p)\n", ptr); - if (VERIFY_PTR(ptr)) { + if (ptr == NULL) { + GC_EXIT(); + } else { + // get the GC block number corresponding to this pointer + assert(VERIFY_PTR(ptr)); size_t block = BLOCK_FROM_PTR(ptr); - if (ATB_GET_KIND(block) == AT_HEAD) { - #if MICROPY_ENABLE_FINALISER - FTB_CLEAR(block); - #endif - // set the last_free pointer to this block if it's earlier in the heap - if (block / BLOCKS_PER_ATB < MP_STATE_MEM(gc_last_free_atb_index)) { - MP_STATE_MEM(gc_last_free_atb_index) = block / BLOCKS_PER_ATB; - } + assert(ATB_GET_KIND(block) == AT_HEAD); - // free head and all of its tail blocks - do { - ATB_ANY_TO_FREE(block); - block += 1; - } while (ATB_GET_KIND(block) == AT_TAIL); - - GC_EXIT(); + #if MICROPY_ENABLE_FINALISER + FTB_CLEAR(block); + #endif - #if EXTENSIVE_HEAP_PROFILING - gc_dump_alloc_table(); - #endif - } else { - GC_EXIT(); - assert(!"bad free"); + // set the last_free pointer to this block if it's earlier in the heap + if (block / BLOCKS_PER_ATB < MP_STATE_MEM(gc_last_free_atb_index)) { + MP_STATE_MEM(gc_last_free_atb_index) = block / BLOCKS_PER_ATB; } - } else if (ptr != NULL) { - GC_EXIT(); - assert(!"bad free"); - } else { + + // free head and all of its tail blocks + do { + ATB_ANY_TO_FREE(block); + block += 1; + } while (ATB_GET_KIND(block) == AT_TAIL); + GC_EXIT(); + + #if EXTENSIVE_HEAP_PROFILING + gc_dump_alloc_table(); + #endif } } From f1d260d878105bfbf25c0bb68da6190e35fc106a Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Jul 2017 12:51:37 +1000 Subject: [PATCH 004/403] stmhal: Reduce size of ESPRUINO_PICO build so it fits in flash. The default frozen modules are no longer included (but users can still specify their own via FROZEN_MPY_DIR), complex numbers are disabled and so are the native, viper and asm_thumb emitters. Users needing these features can tune the build to disable other things. --- stmhal/boards/ESPRUINO_PICO/mpconfigboard.h | 3 +++ stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk | 3 +++ stmhal/mpconfigport.h | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h index e84822957..d065180d8 100644 --- a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h +++ b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h @@ -1,6 +1,9 @@ #define MICROPY_HW_BOARD_NAME "Espruino Pico" #define MICROPY_HW_MCU_NAME "STM32F401CD" +#define MICROPY_EMIT_THUMB (0) +#define MICROPY_EMIT_INLINE_THUMB (0) +#define MICROPY_PY_BUILTINS_COMPLEX (0) #define MICROPY_PY_USOCKET (0) #define MICROPY_PY_NETWORK (0) diff --git a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk index 4c44022c3..d531a594a 100644 --- a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk +++ b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk @@ -2,3 +2,6 @@ MCU_SERIES = f4 CMSIS_MCU = STM32F401xE AF_FILE = boards/stm32f401_af.csv LD_FILE = boards/stm32f401xd.ld + +# Don't include default frozen modules because MCU is tight on flash space +FROZEN_MPY_DIR ?= diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index 96a330d13..d3ce11e02 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -39,8 +39,12 @@ // emitters #define MICROPY_PERSISTENT_CODE_LOAD (1) +#ifndef MICROPY_EMIT_THUMB #define MICROPY_EMIT_THUMB (1) +#endif +#ifndef MICROPY_EMIT_INLINE_THUMB #define MICROPY_EMIT_INLINE_THUMB (1) +#endif // compiler configuration #define MICROPY_COMP_MODULE_CONST (1) From 2b7075741131c457ed0bd146cd5aecddddd5f7d2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 14 Jul 2017 16:38:15 +1000 Subject: [PATCH 005/403] stmhal/servo: Make pyb.Servo(n) map to Pin('Xn') on all MCUs. Prior to this patch Servo numbers 1, 2, 3, 4 mapped to pins X3, X4, X1, X2 on PYBLITE which doesn't match the standard PYB mapping. This patch fixes the mapping. --- stmhal/servo.c | 67 ++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/stmhal/servo.c b/stmhal/servo.c index 6ea6938ad..2916ca280 100644 --- a/stmhal/servo.c +++ b/stmhal/servo.c @@ -26,26 +26,28 @@ #include -#include "py/nlr.h" #include "py/runtime.h" +#include "py/mphal.h" +#include "pin.h" +#include "genhdr/pins.h" #include "timer.h" #include "servo.h" -/// \moduleref pyb -/// \class Servo - 3-wire hobby servo driver -/// -/// Servo controls standard hobby servos with 3-wires (ground, power, signal). - -// this servo driver uses hardware PWM to drive servos on PA0, PA1, PA2, PA3 = X1, X2, X3, X4 -// TIM2 and TIM5 have CH1, CH2, CH3, CH4 on PA0-PA3 respectively -// they are both 32-bit counters with 16-bit prescaler -// we use TIM5 +// This file implements the pyb.Servo class which controls standard hobby servo +// motors that have 3-wires (ground, power, signal). +// +// The driver uses hardware PWM to drive servos on pins X1, X2, X3, X4 which are +// assumed to be on PA0, PA1, PA2, PA3 but not necessarily in that order (the +// pins PA0-PA3 are used directly if the X pins are not defined). +// +// TIM2 and TIM5 have CH1-CH4 on PA0-PA3 respectively. They are both 32-bit +// counters with 16-bit prescaler. TIM5 is used by this driver. #define PYB_SERVO_NUM (4) typedef struct _pyb_servo_obj_t { mp_obj_base_t base; - uint8_t servo_id; + const pin_obj_t *pin; uint8_t pulse_min; // units of 10us uint8_t pulse_max; // units of 10us uint8_t pulse_centre; // units of 10us @@ -65,7 +67,6 @@ void servo_init(void) { // reset servo objects for (int i = 0; i < PYB_SERVO_NUM; i++) { pyb_servo_obj[i].base.type = &pyb_servo_type; - pyb_servo_obj[i].servo_id = i + 1; pyb_servo_obj[i].pulse_min = 64; pyb_servo_obj[i].pulse_max = 242; pyb_servo_obj[i].pulse_centre = 150; @@ -75,6 +76,19 @@ void servo_init(void) { pyb_servo_obj[i].pulse_dest = 0; pyb_servo_obj[i].time_left = 0; } + + // assign servo objects to specific pins (must be some permutation of PA0-PA3) + #ifdef pyb_pin_X1 + pyb_servo_obj[0].pin = &pyb_pin_X1; + pyb_servo_obj[1].pin = &pyb_pin_X2; + pyb_servo_obj[2].pin = &pyb_pin_X3; + pyb_servo_obj[3].pin = &pyb_pin_X4; + #else + pyb_servo_obj[0].pin = &pin_A0; + pyb_servo_obj[1].pin = &pin_A1; + pyb_servo_obj[2].pin = &pin_A2; + pyb_servo_obj[3].pin = &pin_A3; + #endif } void servo_timer_irq_callback(void) { @@ -100,12 +114,7 @@ void servo_timer_irq_callback(void) { need_it = true; } // set the pulse width - switch (s->servo_id) { - case 1: TIM5->CCR1 = s->pulse_cur; break; - case 2: TIM5->CCR2 = s->pulse_cur; break; - case 3: TIM5->CCR3 = s->pulse_cur; break; - case 4: TIM5->CCR4 = s->pulse_cur; break; - } + *(&TIM5->CCR1 + s->pin->pin) = s->pulse_cur; } } if (need_it) { @@ -116,24 +125,12 @@ void servo_timer_irq_callback(void) { } STATIC void servo_init_channel(pyb_servo_obj_t *s) { - uint32_t pin; - uint32_t channel; - switch (s->servo_id) { - case 1: pin = GPIO_PIN_0; channel = TIM_CHANNEL_1; break; - case 2: pin = GPIO_PIN_1; channel = TIM_CHANNEL_2; break; - case 3: pin = GPIO_PIN_2; channel = TIM_CHANNEL_3; break; - case 4: pin = GPIO_PIN_3; channel = TIM_CHANNEL_4; break; - default: return; - } + static const uint8_t channel_table[4] = + {TIM_CHANNEL_1, TIM_CHANNEL_2, TIM_CHANNEL_3, TIM_CHANNEL_4}; + uint32_t channel = channel_table[s->pin->pin]; // GPIO configuration - GPIO_InitTypeDef GPIO_InitStructure; - GPIO_InitStructure.Pin = pin; - GPIO_InitStructure.Mode = GPIO_MODE_AF_PP; - GPIO_InitStructure.Speed = GPIO_SPEED_FAST; - GPIO_InitStructure.Pull = GPIO_NOPULL; - GPIO_InitStructure.Alternate = GPIO_AF2_TIM5; - HAL_GPIO_Init(GPIOA, &GPIO_InitStructure); + mp_hal_pin_config(s->pin, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, GPIO_AF2_TIM5); // PWM mode configuration TIM_OC_InitTypeDef oc_init; @@ -178,7 +175,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(pyb_pwm_set_obj, pyb_pwm_set); STATIC void pyb_servo_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_servo_obj_t *self = self_in; - mp_printf(print, "", self->servo_id, 10 * self->pulse_cur); + mp_printf(print, "", self - &pyb_servo_obj[0] + 1, 10 * self->pulse_cur); } /// \classmethod \constructor(id) From 9cca14a5dcba9e850e150fbd77803626df190f55 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 14 Jul 2017 17:03:24 +1000 Subject: [PATCH 006/403] stmhal/pin_named_pins: Remove unreachable print function. There are never any instances of these objects so there is no need to have a print function. --- stmhal/pin_named_pins.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/stmhal/pin_named_pins.c b/stmhal/pin_named_pins.c index 9e5f9593b..fac19ee97 100644 --- a/stmhal/pin_named_pins.c +++ b/stmhal/pin_named_pins.c @@ -31,22 +31,15 @@ #include "py/mphal.h" #include "pin.h" -STATIC void pin_named_pins_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - pin_named_pins_obj_t *self = self_in; - mp_printf(print, "", self->name); -} - const mp_obj_type_t pin_cpu_pins_obj_type = { { &mp_type_type }, .name = MP_QSTR_cpu, - .print = pin_named_pins_obj_print, .locals_dict = (mp_obj_t)&pin_cpu_pins_locals_dict, }; const mp_obj_type_t pin_board_pins_obj_type = { { &mp_type_type }, .name = MP_QSTR_board, - .print = pin_named_pins_obj_print, .locals_dict = (mp_obj_t)&pin_board_pins_locals_dict, }; From 4fa9d97e4db333e3252b0e87584d29753f2da74d Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 14 Jul 2017 17:41:43 +1000 Subject: [PATCH 007/403] stmhal/servo: Don't compile servo code when it's not enabled. --- stmhal/servo.c | 4 ++++ stmhal/timer.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/stmhal/servo.c b/stmhal/servo.c index 2916ca280..e4bcbc30e 100644 --- a/stmhal/servo.c +++ b/stmhal/servo.c @@ -33,6 +33,8 @@ #include "timer.h" #include "servo.h" +#if MICROPY_HW_ENABLE_SERVO + // This file implements the pyb.Servo class which controls standard hobby servo // motors that have 3-wires (ground, power, signal). // @@ -328,3 +330,5 @@ const mp_obj_type_t pyb_servo_type = { .make_new = pyb_servo_make_new, .locals_dict = (mp_obj_dict_t*)&pyb_servo_locals_dict, }; + +#endif // MICROPY_HW_ENABLE_SERVO diff --git a/stmhal/timer.c b/stmhal/timer.c index 7db15f649..39f168fc8 100644 --- a/stmhal/timer.c +++ b/stmhal/timer.c @@ -216,9 +216,11 @@ TIM_HandleTypeDef *timer_tim6_init(uint freq) { // Interrupt dispatch void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { + #if MICROPY_HW_ENABLE_SERVO if (htim == &TIM5_Handle) { servo_timer_irq_callback(); } + #endif } // Get the frequency (in Hz) of the source clock for the given timer. From c9a48eb464879e35217e7df89a5dab568367f395 Mon Sep 17 00:00:00 2001 From: Alexander Steffen Date: Sat, 15 Jul 2017 11:44:15 +0200 Subject: [PATCH 008/403] docs,teensy: Use the name MicroPython consistently in documentation --- docs/library/pyb.rst | 4 ++-- teensy/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/library/pyb.rst b/docs/library/pyb.rst index a8fef9309..799160145 100644 --- a/docs/library/pyb.rst +++ b/docs/library/pyb.rst @@ -21,7 +21,7 @@ Time related functions Returns the number of milliseconds since the board was last reset. - The result is always a micropython smallint (31-bit signed number), so + The result is always a MicroPython smallint (31-bit signed number), so after 2^30 milliseconds (about 12.4 days) this will start to return negative numbers. @@ -33,7 +33,7 @@ Time related functions Returns the number of microseconds since the board was last reset. - The result is always a micropython smallint (31-bit signed number), so + The result is always a MicroPython smallint (31-bit signed number), so after 2^30 microseconds (about 17.8 minutes) this will start to return negative numbers. diff --git a/teensy/README.md b/teensy/README.md index 3e4a75b9e..c586853b5 100644 --- a/teensy/README.md +++ b/teensy/README.md @@ -18,7 +18,7 @@ cd teensy ARDUINO=~/arduino-1.0.5 make ``` -To upload micropython to the Teensy 3.1. +To upload MicroPython to the Teensy 3.1. Press the Program button on the Teensy 3.1 ```bash From d91c1170ca489b6f754918e678ed412a246eb8cc Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 17 Jul 2017 15:17:06 +1000 Subject: [PATCH 009/403] zephyr: Remove long-obsolete machine_ptr_t typedef's. --- zephyr/mpconfigport.h | 3 --- zephyr/mpconfigport_minimal.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/zephyr/mpconfigport.h b/zephyr/mpconfigport.h index 2f2526779..b4677f3ed 100644 --- a/zephyr/mpconfigport.h +++ b/zephyr/mpconfigport.h @@ -98,9 +98,6 @@ typedef int mp_int_t; // must be pointer size typedef unsigned mp_uint_t; // must be pointer size - -typedef void *machine_ptr_t; // must be of pointer size -typedef const void *machine_const_ptr_t; // must be of pointer size typedef long mp_off_t; #define MP_STATE_PORT MP_STATE_VM diff --git a/zephyr/mpconfigport_minimal.h b/zephyr/mpconfigport_minimal.h index 772335c0a..f0e57d756 100644 --- a/zephyr/mpconfigport_minimal.h +++ b/zephyr/mpconfigport_minimal.h @@ -80,9 +80,6 @@ typedef int mp_int_t; // must be pointer size typedef unsigned mp_uint_t; // must be pointer size - -typedef void *machine_ptr_t; // must be of pointer size -typedef const void *machine_const_ptr_t; // must be of pointer size typedef long mp_off_t; #define MP_STATE_PORT MP_STATE_VM From 299bc625864b9e624ed599c94a5f95870516139a Mon Sep 17 00:00:00 2001 From: Alexander Steffen Date: Thu, 29 Jun 2017 23:14:58 +0200 Subject: [PATCH 010/403] all: Unify header guard usage. The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h --- cc3200/bootmgr/bootmgr.h | 7 +++---- cc3200/bootmgr/flc.h | 7 +++---- cc3200/ftp/ftp.h | 7 +++---- cc3200/ftp/updater.h | 8 +++----- cc3200/hal/cc3200_hal.h | 5 ----- cc3200/misc/antenna.h | 7 +++---- cc3200/misc/mperror.h | 7 +++---- cc3200/misc/mpexception.h | 7 +++---- cc3200/misc/mpirq.h | 7 +++---- cc3200/mods/modnetwork.h | 7 +++---- cc3200/mods/modubinascii.h | 7 +++---- cc3200/mods/moduos.h | 7 +++---- cc3200/mods/modusocket.h | 7 +++---- cc3200/mods/modwlan.h | 7 +++---- cc3200/mods/pybadc.h | 7 +++---- cc3200/mods/pybi2c.h | 7 +++---- cc3200/mods/pybpin.h | 7 +++---- cc3200/mods/pybrtc.h | 7 +++---- cc3200/mods/pybsd.h | 6 +++--- cc3200/mods/pybsleep.h | 7 +++---- cc3200/mods/pybspi.h | 7 +++---- cc3200/mods/pybtimer.h | 3 +++ cc3200/mods/pybuart.h | 7 +++---- cc3200/mods/pybwdt.h | 7 +++---- cc3200/mpconfigport.h | 5 ----- cc3200/mptask.h | 7 +++---- cc3200/mpthreadport.h | 4 ---- cc3200/serverstask.h | 7 +++---- cc3200/telnet/telnet.h | 7 +++---- cc3200/util/cryptohash.h | 7 +++---- cc3200/util/fifo.h | 7 +++---- cc3200/util/gccollect.h | 4 ++++ cc3200/util/gchelper.h | 7 +++---- cc3200/util/random.h | 7 +++---- cc3200/util/sleeprestore.h | 7 +++---- cc3200/util/socketfifo.h | 7 +++---- cc3200/version.h | 7 +++---- drivers/dht/dht.h | 5 +++++ drivers/memory/spiflash.h | 1 - esp8266/esp_mphal.h | 5 ----- esp8266/espapa102.h | 4 ++++ esp8266/espneopixel.h | 5 +++++ esp8266/esppwm.h | 6 +++--- esp8266/ets_alt_task.h | 5 +++++ esp8266/etshal.h | 6 +++--- esp8266/gccollect.h | 4 ++++ esp8266/modmachine.h | 6 +++--- esp8266/uart.h | 6 +++--- esp8266/xtirq.h | 7 +++---- extmod/lwip-include/arch/cc.h | 6 +++--- extmod/lwip-include/arch/perf.h | 6 +++--- extmod/lwip-include/lwipopts.h | 7 +++---- extmod/machine_i2c.h | 7 +++---- extmod/machine_mem.h | 8 +++----- extmod/machine_pinbase.h | 8 +++----- extmod/machine_pulse.h | 7 +++---- extmod/machine_signal.h | 8 +++----- extmod/machine_spi.h | 1 - extmod/misc.h | 4 ++++ extmod/modubinascii.h | 7 +++---- extmod/modwebsocket.h | 5 +++++ extmod/utime_mphal.h | 4 ++++ extmod/vfs.h | 1 - extmod/vfs_fat.h | 4 ++++ extmod/virtpin.h | 4 ++++ lib/mp-readline/readline.h | 4 ++++ lib/netutils/netutils.h | 6 +++--- lib/timeutils/timeutils.h | 7 +++---- lib/utils/interrupt_char.h | 4 ++++ lib/utils/pyexec.h | 6 +++--- pic16bit/board.h | 6 +++--- pic16bit/modpyb.h | 6 +++--- pic16bit/pic16bit_mphal.h | 4 ---- pic16bit/unistd.h | 5 +++++ py/asmarm.h | 6 +++--- py/asmthumb.h | 6 +++--- py/asmx64.h | 6 +++--- py/asmx86.h | 6 +++--- py/bc.h | 6 +++--- py/bc0.h | 6 +++--- py/binary.h | 6 +++--- py/builtin.h | 6 +++--- py/compile.h | 6 +++--- py/emit.h | 7 +++---- py/emitglue.h | 6 +++--- py/formatfloat.h | 6 +++--- py/frozenmod.h | 6 +++--- py/gc.h | 6 +++--- py/lexer.h | 6 +++--- py/misc.h | 6 +++--- py/mpconfig.h | 6 +++--- py/mperrno.h | 7 +++---- py/mphal.h | 6 +++--- py/mpprint.h | 6 +++--- py/mpstate.h | 6 +++--- py/mpthread.h | 6 +++--- py/mpz.h | 6 +++--- py/nlr.h | 6 +++--- py/obj.h | 6 +++--- py/objarray.h | 7 +++---- py/objexcept.h | 6 +++--- py/objfun.h | 6 +++--- py/objgenerator.h | 6 +++--- py/objint.h | 6 +++--- py/objlist.h | 6 +++--- py/objmodule.h | 6 +++--- py/objstr.h | 6 +++--- py/objtuple.h | 6 +++--- py/objtype.h | 6 +++--- py/parse.h | 6 +++--- py/parsenum.h | 6 +++--- py/parsenumbase.h | 6 +++--- py/qstr.h | 6 +++--- py/repl.h | 6 +++--- py/ringbuf.h | 6 +++--- py/runtime.h | 6 +++--- py/runtime0.h | 6 +++--- py/scope.h | 6 +++--- py/smallint.h | 6 +++--- py/stackctrl.h | 6 +++--- py/stream.h | 6 +++--- py/unicode.h | 6 +++--- stmhal/accel.h | 4 ++++ stmhal/adc.h | 4 ++++ stmhal/bufhelper.h | 4 ++++ stmhal/can.h | 4 ++++ stmhal/dac.h | 4 ++++ stmhal/dma.h | 7 +++---- stmhal/extint.h | 4 ++++ stmhal/flash.h | 4 ++++ stmhal/font_petme128_8x8.h | 4 ++++ stmhal/gccollect.h | 4 ++++ stmhal/i2c.h | 4 ++++ stmhal/irq.h | 1 - stmhal/lcd.h | 4 ++++ stmhal/led.h | 4 ++++ stmhal/modmachine.h | 7 +++---- stmhal/modnetwork.h | 4 ++++ stmhal/mpconfigport.h | 6 ------ stmhal/mpthreadport.h | 4 ---- stmhal/pendsv.h | 4 ++++ stmhal/pin.h | 7 +++---- stmhal/portmodules.h | 4 ++++ stmhal/pybthread.h | 1 - stmhal/rng.h | 4 ++++ stmhal/rtc.h | 4 ++++ stmhal/sdcard.h | 4 ++++ stmhal/servo.h | 4 ++++ stmhal/spi.h | 4 ++++ stmhal/stm32_it.h | 4 ++++ stmhal/storage.h | 4 ++++ stmhal/systick.h | 4 ++++ stmhal/timer.h | 4 ++++ stmhal/uart.h | 4 ++++ stmhal/usb.h | 4 ++++ stmhal/usbd_cdc_interface.h | 4 ++++ stmhal/usbd_desc.h | 4 ++++ stmhal/usbd_hid_interface.h | 4 ++++ stmhal/usbd_msc_storage.h | 4 ++++ stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h | 7 +++---- stmhal/usrsw.h | 4 ++++ stmhal/wdt.h | 4 ++++ teensy/hal_ftm.h | 4 +++- teensy/led.h | 5 +++++ teensy/lexermemzip.h | 4 ++++ teensy/reg.h | 5 +++++ teensy/servo.h | 4 ++++ teensy/std.h | 5 +++++ teensy/timer.h | 4 ++++ teensy/usb.h | 5 +++++ unix/fdfile.h | 7 +++---- unix/input.h | 5 +++++ unix/mpthreadport.h | 4 ---- windows/fmode.h | 7 +++---- windows/init.h | 4 ++++ windows/msvc/dirent.h | 4 ++++ windows/msvc/sys/time.h | 4 ++++ windows/msvc/unistd.h | 4 ++++ windows/realpath.h | 4 ++++ windows/sleep.h | 4 ++++ zephyr/modmachine.h | 6 +++--- 181 files changed, 574 insertions(+), 414 deletions(-) diff --git a/cc3200/bootmgr/bootmgr.h b/cc3200/bootmgr/bootmgr.h index 4b314335c..e5285d4e4 100644 --- a/cc3200/bootmgr/bootmgr.h +++ b/cc3200/bootmgr/bootmgr.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __BOOTMGR_H__ -#define __BOOTMGR_H__ +#ifndef MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H +#define MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H //**************************************************************************** // @@ -66,4 +65,4 @@ extern void Run(unsigned long); } #endif -#endif //__BOOTMGR_H__ +#endif // MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H diff --git a/cc3200/bootmgr/flc.h b/cc3200/bootmgr/flc.h index 4b2aca9ac..7c04c7b05 100644 --- a/cc3200/bootmgr/flc.h +++ b/cc3200/bootmgr/flc.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __FLC_H__ -#define __FLC_H__ +#ifndef MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H +#define MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H /****************************************************************************** @@ -93,4 +92,4 @@ typedef struct _sBootInfo_t } #endif -#endif /* __FLC_H__ */ +#endif // MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H diff --git a/cc3200/ftp/ftp.h b/cc3200/ftp/ftp.h index 13b044dcf..7d16002e4 100644 --- a/cc3200/ftp/ftp.h +++ b/cc3200/ftp/ftp.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef FTP_H_ -#define FTP_H_ +#ifndef MICROPY_INCLUDED_CC3200_FTP_FTP_H +#define MICROPY_INCLUDED_CC3200_FTP_FTP_H /****************************************************************************** DECLARE EXPORTED FUNCTIONS @@ -36,4 +35,4 @@ extern void ftp_enable (void); extern void ftp_disable (void); extern void ftp_reset (void); -#endif /* FTP_H_ */ +#endif // MICROPY_INCLUDED_CC3200_FTP_FTP_H diff --git a/cc3200/ftp/updater.h b/cc3200/ftp/updater.h index b581d0fc8..dcca70472 100644 --- a/cc3200/ftp/updater.h +++ b/cc3200/ftp/updater.h @@ -23,10 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef UPDATER_H_ -#define UPDATER_H_ +#ifndef MICROPY_INCLUDED_CC3200_FTP_UPDATER_H +#define MICROPY_INCLUDED_CC3200_FTP_UPDATER_H extern void updater_pre_init (void); extern bool updater_check_path (void *path); @@ -35,4 +33,4 @@ extern bool updater_write (uint8_t *buf, uint32_t len); extern void updater_finnish (void); extern bool updater_verify (uint8_t *rbuff, uint8_t *hasbuff); -#endif /* UPDATER_H_ */ +#endif // MICROPY_INCLUDED_CC3200_FTP_UPDATER_H diff --git a/cc3200/hal/cc3200_hal.h b/cc3200/hal/cc3200_hal.h index fcb85b292..9953f0e5a 100644 --- a/cc3200/hal/cc3200_hal.h +++ b/cc3200/hal/cc3200_hal.h @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -#ifndef CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ -#define CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ - #include #include @@ -69,5 +66,3 @@ extern void mp_hal_set_interrupt_char (int c); #define mp_hal_delay_us(usec) UtilsDelay(UTILS_DELAY_US_TO_COUNT(usec)) #define mp_hal_ticks_cpu() (SysTickPeriodGet() - SysTickValueGet()) - -#endif /* CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ */ diff --git a/cc3200/misc/antenna.h b/cc3200/misc/antenna.h index b3b1c6162..3bb87e32b 100644 --- a/cc3200/misc/antenna.h +++ b/cc3200/misc/antenna.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef _ANTENNA_H_ -#define _ANTENNA_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H +#define MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H typedef enum { ANTENNA_TYPE_INTERNAL = 0, @@ -35,4 +34,4 @@ typedef enum { extern void antenna_init0 (void); extern void antenna_select (antenna_type_t antenna_type); -#endif /* _ANTENNA_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H diff --git a/cc3200/misc/mperror.h b/cc3200/misc/mperror.h index e38d129db..46a9b8cb0 100644 --- a/cc3200/misc/mperror.h +++ b/cc3200/misc/mperror.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPERROR_H_ -#define MPERROR_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_MPERROR_H +#define MICROPY_INCLUDED_CC3200_MISC_MPERROR_H extern void NORETURN __fatal_error(const char *msg); @@ -39,4 +38,4 @@ void mperror_heartbeat_signal (void); void mperror_enable_heartbeat (bool enable); bool mperror_is_heartbeat_enabled (void); -#endif // MPERROR_H_ +#endif // MICROPY_INCLUDED_CC3200_MISC_MPERROR_H diff --git a/cc3200/misc/mpexception.h b/cc3200/misc/mpexception.h index 2f9d1877c..d23381caf 100644 --- a/cc3200/misc/mpexception.h +++ b/cc3200/misc/mpexception.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPEXCEPTION_H_ -#define MPEXCEPTION_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H +#define MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H extern const char mpexception_value_invalid_arguments[]; extern const char mpexception_num_type_invalid_arguments[]; @@ -40,4 +39,4 @@ extern void mpexception_set_interrupt_char (int c); extern void mpexception_nlr_jump (void *o); extern void mpexception_keyboard_nlr_jump (void); -#endif /* MPEXCEPTION_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H diff --git a/cc3200/misc/mpirq.h b/cc3200/misc/mpirq.h index 3fd21ee09..8b4ab2f1b 100644 --- a/cc3200/misc/mpirq.h +++ b/cc3200/misc/mpirq.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPIRQ_H_ -#define MPIRQ_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H +#define MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H /****************************************************************************** DEFINE CONSTANTS @@ -72,4 +71,4 @@ void mp_irq_remove (const mp_obj_t parent); void mp_irq_handler (mp_obj_t self_in); uint mp_irq_translate_priority (uint priority); -#endif /* MPIRQ_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H diff --git a/cc3200/mods/modnetwork.h b/cc3200/mods/modnetwork.h index 8a886c3e4..8e1196e86 100644 --- a/cc3200/mods/modnetwork.h +++ b/cc3200/mods/modnetwork.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODNETWORK_H_ -#define MODNETWORK_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H +#define MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H /****************************************************************************** DEFINE CONSTANTS @@ -71,4 +70,4 @@ extern const mod_network_nic_type_t mod_network_nic_type_wlan; ******************************************************************************/ void mod_network_init0(void); -#endif // MODNETWORK_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H diff --git a/cc3200/mods/modubinascii.h b/cc3200/mods/modubinascii.h index c04b70021..3e784e9ae 100644 --- a/cc3200/mods/modubinascii.h +++ b/cc3200/mods/modubinascii.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H +#define MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H -#ifndef MODUBINASCII_H_ -#define MODUBINASCII_H_ - -#endif /* MODUBINASCII_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H diff --git a/cc3200/mods/moduos.h b/cc3200/mods/moduos.h index 4c8bc9659..148cddf2e 100644 --- a/cc3200/mods/moduos.h +++ b/cc3200/mods/moduos.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODUOS_H_ -#define MODUOS_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODUOS_H +#define MICROPY_INCLUDED_CC3200_MODS_MODUOS_H #include "py/obj.h" @@ -45,4 +44,4 @@ typedef struct _os_term_dup_obj_t { ******************************************************************************/ void osmount_unmount_all (void); -#endif // MODUOS_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODUOS_H diff --git a/cc3200/mods/modusocket.h b/cc3200/mods/modusocket.h index 851f8e5be..80c1f24cd 100644 --- a/cc3200/mods/modusocket.h +++ b/cc3200/mods/modusocket.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODUSOCKET_H_ -#define MODUSOCKET_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODUSOCKET_H +#define MICROPY_INCLUDED_CC3200_MODS_MODUSOCKET_H extern const mp_obj_dict_t socket_locals_dict; extern const mp_stream_p_t socket_stream_p; @@ -36,4 +35,4 @@ extern void modusocket_socket_delete (int16_t sd); extern void modusocket_enter_sleep (void); extern void modusocket_close_all_user_sockets (void); -#endif /* MODUSOCKET_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODUSOCKET_H diff --git a/cc3200/mods/modwlan.h b/cc3200/mods/modwlan.h index 3bfd1fbbf..d37d276e8 100644 --- a/cc3200/mods/modwlan.h +++ b/cc3200/mods/modwlan.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODWLAN_H_ -#define MODWLAN_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODWLAN_H +#define MICROPY_INCLUDED_CC3200_MODS_MODWLAN_H /****************************************************************************** DEFINE CONSTANTS @@ -97,4 +96,4 @@ extern bool wlan_is_connected (void); extern void wlan_set_current_time (uint32_t seconds_since_2000); extern void wlan_off_on (void); -#endif /* MODWLAN_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODWLAN_H diff --git a/cc3200/mods/pybadc.h b/cc3200/mods/pybadc.h index b77c4af42..50640ee60 100644 --- a/cc3200/mods/pybadc.h +++ b/cc3200/mods/pybadc.h @@ -24,10 +24,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBADC_H_ -#define PYBADC_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBADC_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBADC_H extern const mp_obj_type_t pyb_adc_type; -#endif /* PYBADC_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBADC_H diff --git a/cc3200/mods/pybi2c.h b/cc3200/mods/pybi2c.h index 7adffb2d9..d547f6330 100644 --- a/cc3200/mods/pybi2c.h +++ b/cc3200/mods/pybi2c.h @@ -24,10 +24,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBI2C_H_ -#define PYBI2C_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBI2C_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBI2C_H extern const mp_obj_type_t pyb_i2c_type; -#endif // PYBI2C_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBI2C_H diff --git a/cc3200/mods/pybpin.h b/cc3200/mods/pybpin.h index ad02cc777..6b4b7b1ed 100644 --- a/cc3200/mods/pybpin.h +++ b/cc3200/mods/pybpin.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBPIN_H_ -#define PYBPIN_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBPIN_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBPIN_H enum { PORT_A0 = GPIOA0_BASE, @@ -138,4 +137,4 @@ uint8_t pin_find_peripheral_unit (const mp_obj_t pin, uint8_t fn, uint8_t type); uint8_t pin_find_peripheral_type (const mp_obj_t pin, uint8_t fn, uint8_t unit); int8_t pin_find_af_index (const pin_obj_t* pin, uint8_t fn, uint8_t unit, uint8_t type);; -#endif // PYBPIN_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBPIN_H diff --git a/cc3200/mods/pybrtc.h b/cc3200/mods/pybrtc.h index 5111b78f7..3fd11ecd6 100644 --- a/cc3200/mods/pybrtc.h +++ b/cc3200/mods/pybrtc.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBRTC_H_ -#define PYBRTC_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBRTC_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBRTC_H // RTC triggers #define PYB_RTC_ALARM0 (0x01) @@ -56,4 +55,4 @@ extern void pyb_rtc_calc_future_time (uint32_t a_mseconds, uint32_t *f_seconds, extern void pyb_rtc_repeat_alarm (pyb_rtc_obj_t *self); extern void pyb_rtc_disable_alarm (void); -#endif // PYBRTC_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBRTC_H diff --git a/cc3200/mods/pybsd.h b/cc3200/mods/pybsd.h index a06df6d8d..084d7caaf 100644 --- a/cc3200/mods/pybsd.h +++ b/cc3200/mods/pybsd.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef PYBSD_H_ -#define PYBSD_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBSD_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBSD_H /****************************************************************************** DEFINE PUBLIC TYPES @@ -41,4 +41,4 @@ typedef struct { extern pybsd_obj_t pybsd_obj; extern const mp_obj_type_t pyb_sd_type; -#endif // PYBSD_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBSD_H diff --git a/cc3200/mods/pybsleep.h b/cc3200/mods/pybsleep.h index d34895ae0..513e6fa95 100644 --- a/cc3200/mods/pybsleep.h +++ b/cc3200/mods/pybsleep.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBSLEEP_H_ -#define PYBSLEEP_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBSLEEP_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBSLEEP_H /****************************************************************************** DEFINE CONSTANTS @@ -70,4 +69,4 @@ void pyb_sleep_deepsleep (void); pybsleep_reset_cause_t pyb_sleep_get_reset_cause (void); pybsleep_wake_reason_t pyb_sleep_get_wake_reason (void); -#endif /* PYBSLEEP_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBSLEEP_H diff --git a/cc3200/mods/pybspi.h b/cc3200/mods/pybspi.h index 48e0edd61..b533b6056 100644 --- a/cc3200/mods/pybspi.h +++ b/cc3200/mods/pybspi.h @@ -24,10 +24,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBSPI_H_ -#define PYBSPI_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBSPI_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBSPI_H extern const mp_obj_type_t pyb_spi_type; -#endif // PYBSPI_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBSPI_H diff --git a/cc3200/mods/pybtimer.h b/cc3200/mods/pybtimer.h index 4e9de138d..a1b30cd2b 100644 --- a/cc3200/mods/pybtimer.h +++ b/cc3200/mods/pybtimer.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBTIMER_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBTIMER_H /****************************************************************************** DECLARE EXPORTED DATA @@ -35,3 +37,4 @@ extern const mp_obj_type_t pyb_timer_type; ******************************************************************************/ void timer_init0 (void); +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBTIMER_H diff --git a/cc3200/mods/pybuart.h b/cc3200/mods/pybuart.h index 19bc93607..56440987f 100644 --- a/cc3200/mods/pybuart.h +++ b/cc3200/mods/pybuart.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBUART_H_ -#define PYBUART_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBUART_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBUART_H typedef enum { PYB_UART_0 = 0, @@ -43,4 +42,4 @@ int uart_rx_char(pyb_uart_obj_t *uart_obj); bool uart_tx_char(pyb_uart_obj_t *self, int c); bool uart_tx_strn(pyb_uart_obj_t *uart_obj, const char *str, uint len); -#endif // PYBUART_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBUART_H diff --git a/cc3200/mods/pybwdt.h b/cc3200/mods/pybwdt.h index f87f0a773..2844587cb 100644 --- a/cc3200/mods/pybwdt.h +++ b/cc3200/mods/pybwdt.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBWDT_H_ -#define PYBWDT_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBWDT_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBWDT_H #include "py/obj.h" @@ -36,4 +35,4 @@ void pybwdt_srv_alive (void); void pybwdt_srv_sleeping (bool state); void pybwdt_sl_alive (void); -#endif /* PYBWDT_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBWDT_H diff --git a/cc3200/mpconfigport.h b/cc3200/mpconfigport.h index 4bd583a4b..78f8c0948 100644 --- a/cc3200/mpconfigport.h +++ b/cc3200/mpconfigport.h @@ -25,9 +25,6 @@ * THE SOFTWARE. */ -#ifndef __INCLUDED_MPCONFIGPORT_H -#define __INCLUDED_MPCONFIGPORT_H - #include #ifndef BOOTLOADER @@ -235,5 +232,3 @@ typedef long mp_off_t; #define MICROPY_PORT_WLAN_AP_KEY "www.wipy.io" #define MICROPY_PORT_WLAN_AP_SECURITY SL_SEC_TYPE_WPA_WPA2 #define MICROPY_PORT_WLAN_AP_CHANNEL 5 - -#endif // __INCLUDED_MPCONFIGPORT_H diff --git a/cc3200/mptask.h b/cc3200/mptask.h index e0d2f0eec..9276cfc3e 100644 --- a/cc3200/mptask.h +++ b/cc3200/mptask.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPTASK_H_ -#define MPTASK_H_ +#ifndef MICROPY_INCLUDED_CC3200_MPTASK_H +#define MICROPY_INCLUDED_CC3200_MPTASK_H /****************************************************************************** DEFINE CONSTANTS @@ -44,4 +43,4 @@ extern StackType_t mpTaskStack[]; ******************************************************************************/ extern void TASK_Micropython (void *pvParameters); -#endif /* MPTASK_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MPTASK_H diff --git a/cc3200/mpthreadport.h b/cc3200/mpthreadport.h index 2b49232dd..dc9ba9920 100644 --- a/cc3200/mpthreadport.h +++ b/cc3200/mpthreadport.h @@ -23,8 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_CC3200_MPTHREADPORT_H__ -#define __MICROPY_INCLUDED_CC3200_MPTHREADPORT_H__ #ifndef BOOTLOADER #include "FreeRTOS.h" @@ -39,5 +37,3 @@ typedef struct _mp_thread_mutex_t { void mp_thread_init(void); void mp_thread_gc_others(void); - -#endif // __MICROPY_INCLUDED_CC3200_MPTHREADPORT_H__ diff --git a/cc3200/serverstask.h b/cc3200/serverstask.h index 2786ff697..77a3af2f3 100644 --- a/cc3200/serverstask.h +++ b/cc3200/serverstask.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef SERVERSTASK_H_ -#define SERVERSTASK_H_ +#ifndef MICROPY_INCLUDED_CC3200_SERVERSTASK_H +#define MICROPY_INCLUDED_CC3200_SERVERSTASK_H /****************************************************************************** DEFINE CONSTANTS @@ -73,4 +72,4 @@ extern void server_sleep_sockets (void); extern void servers_set_timeout (uint32_t timeout); extern uint32_t servers_get_timeout (void); -#endif /* SERVERSTASK_H_ */ +#endif // MICROPY_INCLUDED_CC3200_SERVERSTASK_H diff --git a/cc3200/telnet/telnet.h b/cc3200/telnet/telnet.h index aa5531394..1e3173b11 100644 --- a/cc3200/telnet/telnet.h +++ b/cc3200/telnet/telnet.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef TELNET_H_ -#define TELNET_H_ +#ifndef MICROPY_INCLUDED_CC3200_TELNET_TELNET_H +#define MICROPY_INCLUDED_CC3200_TELNET_TELNET_H /****************************************************************************** DECLARE EXPORTED FUNCTIONS @@ -39,4 +38,4 @@ extern void telnet_enable (void); extern void telnet_disable (void); extern void telnet_reset (void); -#endif /* TELNET_H_ */ +#endif // MICROPY_INCLUDED_CC3200_TELNET_TELNET_H diff --git a/cc3200/util/cryptohash.h b/cc3200/util/cryptohash.h index d9f624d19..df3a8475c 100644 --- a/cc3200/util/cryptohash.h +++ b/cc3200/util/cryptohash.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef CRYPTOHASH_H_ -#define CRYPTOHASH_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_CRYPTOHASH_H +#define MICROPY_INCLUDED_CC3200_UTIL_CRYPTOHASH_H /****************************************************************************** DECLARE PUBLIC FUNCTIONS @@ -35,4 +34,4 @@ extern void CRYPTOHASH_SHAMD5Start (uint32_t algo, uint32_t blocklen); extern void CRYPTOHASH_SHAMD5Update (uint8_t *data, uint32_t datalen); extern void CRYPTOHASH_SHAMD5Read (uint8_t *hash); -#endif /* CRYPTOHASH_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_CRYPTOHASH_H diff --git a/cc3200/util/fifo.h b/cc3200/util/fifo.h index c8590f5c2..ee7571c26 100644 --- a/cc3200/util/fifo.h +++ b/cc3200/util/fifo.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef FIFO_H_ -#define FIFO_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_FIFO_H +#define MICROPY_INCLUDED_CC3200_UTIL_FIFO_H typedef struct { void *pvElements; @@ -47,4 +46,4 @@ extern bool FIFO_IsEmpty (FIFO_t *fifo); extern bool FIFO_IsFull (FIFO_t *fifo); extern void FIFO_Flush (FIFO_t *fifo); -#endif /* FIFO_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_FIFO_H diff --git a/cc3200/util/gccollect.h b/cc3200/util/gccollect.h index 281e84aa8..3c4232b84 100644 --- a/cc3200/util/gccollect.h +++ b/cc3200/util/gccollect.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_GCCOLLECT_H +#define MICROPY_INCLUDED_CC3200_UTIL_GCCOLLECT_H // variables defining memory layout extern uint32_t _etext; @@ -39,3 +41,5 @@ extern uint32_t _stack; extern uint32_t _estack; void gc_collect(void); + +#endif // MICROPY_INCLUDED_CC3200_UTIL_GCCOLLECT_H diff --git a/cc3200/util/gchelper.h b/cc3200/util/gchelper.h index 1f7d2fece..0277a754b 100644 --- a/cc3200/util/gchelper.h +++ b/cc3200/util/gchelper.h @@ -24,11 +24,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef GC_HELPER_H_ -#define GC_HELPER_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_GCHELPER_H +#define MICROPY_INCLUDED_CC3200_UTIL_GCHELPER_H extern mp_uint_t gc_helper_get_sp(void); extern mp_uint_t gc_helper_get_regs_and_sp(mp_uint_t *regs); -#endif /* GC_HELPER_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_GCHELPER_H diff --git a/cc3200/util/random.h b/cc3200/util/random.h index 67fd1ff85..60b0b8663 100644 --- a/cc3200/util/random.h +++ b/cc3200/util/random.h @@ -23,13 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __RANDOM_H -#define __RANDOM_H +#ifndef MICROPY_INCLUDED_CC3200_UTIL_RANDOM_H +#define MICROPY_INCLUDED_CC3200_UTIL_RANDOM_H void rng_init0 (void); uint32_t rng_get (void); MP_DECLARE_CONST_FUN_OBJ_0(machine_rng_get_obj); -#endif // __RANDOM_H +#endif // MICROPY_INCLUDED_CC3200_UTIL_RANDOM_H diff --git a/cc3200/util/sleeprestore.h b/cc3200/util/sleeprestore.h index 51416f0fc..1c5509db0 100644 --- a/cc3200/util/sleeprestore.h +++ b/cc3200/util/sleeprestore.h @@ -23,11 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef SLEEPRESTORE_H_ -#define SLEEPRESTORE_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_SLEEPRESTORE_H +#define MICROPY_INCLUDED_CC3200_UTIL_SLEEPRESTORE_H extern void sleep_store(void); extern void sleep_restore(void); -#endif /* SLEEPRESTORE_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_SLEEPRESTORE_H diff --git a/cc3200/util/socketfifo.h b/cc3200/util/socketfifo.h index 69b17658f..1309201ee 100644 --- a/cc3200/util/socketfifo.h +++ b/cc3200/util/socketfifo.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef SOCKETFIFO_H_ -#define SOCKETFIFO_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_SOCKETFIFO_H +#define MICROPY_INCLUDED_CC3200_UTIL_SOCKETFIFO_H /*---------------------------------------------------------------------------- ** Imports @@ -60,4 +59,4 @@ extern bool SOCKETFIFO_IsFull (void); extern void SOCKETFIFO_Flush (void); extern unsigned int SOCKETFIFO_Count (void); -#endif /* SOCKETFIFO_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_SOCKETFIFO_H diff --git a/cc3200/version.h b/cc3200/version.h index c8315d771..83e3f8c07 100644 --- a/cc3200/version.h +++ b/cc3200/version.h @@ -23,10 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef VERSION_H_ -#define VERSION_H_ +#ifndef MICROPY_INCLUDED_CC3200_VERSION_H +#define MICROPY_INCLUDED_CC3200_VERSION_H #define WIPY_SW_VERSION_NUMBER "1.2.0" -#endif /* VERSION_H_ */ +#endif // MICROPY_INCLUDED_CC3200_VERSION_H diff --git a/drivers/dht/dht.h b/drivers/dht/dht.h index 20954036d..883e07796 100644 --- a/drivers/dht/dht.h +++ b/drivers/dht/dht.h @@ -1,3 +1,8 @@ +#ifndef MICROPY_INCLUDED_DRIVERS_DHT_DHT_H +#define MICROPY_INCLUDED_DRIVERS_DHT_DHT_H + #include "py/obj.h" MP_DECLARE_CONST_FUN_OBJ_2(dht_readinto_obj); + +#endif // MICROPY_INCLUDED_DRIVERS_DHT_DHT_H diff --git a/drivers/memory/spiflash.h b/drivers/memory/spiflash.h index d2e817450..967352b04 100644 --- a/drivers/memory/spiflash.h +++ b/drivers/memory/spiflash.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_DRIVERS_MEMORY_SPIFLASH_H #define MICROPY_INCLUDED_DRIVERS_MEMORY_SPIFLASH_H diff --git a/esp8266/esp_mphal.h b/esp8266/esp_mphal.h index d783f1f09..1d1d6de3f 100644 --- a/esp8266/esp_mphal.h +++ b/esp8266/esp_mphal.h @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -#ifndef _INCLUDED_MPHAL_H_ -#define _INCLUDED_MPHAL_H_ - #include "py/ringbuf.h" #include "lib/utils/interrupt_char.h" #include "xtirq.h" @@ -96,5 +93,3 @@ void mp_hal_pin_open_drain(mp_hal_pin_obj_t pin); void *ets_get_esf_buf_ctlblk(void); int ets_esf_free_bufs(int idx); - -#endif // _INCLUDED_MPHAL_H_ diff --git a/esp8266/espapa102.h b/esp8266/espapa102.h index 82c92025d..dd7c5ab72 100644 --- a/esp8266/espapa102.h +++ b/esp8266/espapa102.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_ESP8266_ESPAPA102_H +#define MICROPY_INCLUDED_ESP8266_ESPAPA102_H void esp_apa102_write(uint8_t clockPin, uint8_t dataPin, uint8_t *pixels, uint32_t numBytes); + +#endif // MICROPY_INCLUDED_ESP8266_ESPAPA102_H diff --git a/esp8266/espneopixel.h b/esp8266/espneopixel.h index 4b20afda5..c444740ff 100644 --- a/esp8266/espneopixel.h +++ b/esp8266/espneopixel.h @@ -1 +1,6 @@ +#ifndef MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H +#define MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H + void esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32_t numBytes, bool is800KHz); + +#endif // MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H diff --git a/esp8266/esppwm.h b/esp8266/esppwm.h index 242a9a2a6..1ee4a2f55 100644 --- a/esp8266/esppwm.h +++ b/esp8266/esppwm.h @@ -1,5 +1,5 @@ -#ifndef __ESPPWM_H__ -#define __ESPPWM_H__ +#ifndef MICROPY_INCLUDED_ESP8266_ESPPWM_H +#define MICROPY_INCLUDED_ESP8266_ESPPWM_H #include #include @@ -14,4 +14,4 @@ uint16_t pwm_get_freq(uint8_t channel); int pwm_add(uint8_t pin_id, uint32_t pin_mux, uint32_t pin_func); bool pwm_delete(uint8_t channel); -#endif +#endif // MICROPY_INCLUDED_ESP8266_ESPPWM_H diff --git a/esp8266/ets_alt_task.h b/esp8266/ets_alt_task.h index dba0c5fa6..33a9d3a00 100644 --- a/esp8266/ets_alt_task.h +++ b/esp8266/ets_alt_task.h @@ -1,4 +1,9 @@ +#ifndef MICROPY_INCLUDED_ESP8266_ETS_ALT_TASK_H +#define MICROPY_INCLUDED_ESP8266_ETS_ALT_TASK_H + extern int ets_loop_iter_disable; extern uint32_t system_time_high_word; bool ets_loop_iter(void); + +#endif // MICROPY_INCLUDED_ESP8266_ETS_ALT_TASK_H diff --git a/esp8266/etshal.h b/esp8266/etshal.h index 90af63ba2..34787779f 100644 --- a/esp8266/etshal.h +++ b/esp8266/etshal.h @@ -1,5 +1,5 @@ -#ifndef _INCLUDED_ETSHAL_H_ -#define _INCLUDED_ETSHAL_H_ +#ifndef MICROPY_INCLUDED_ESP8266_ETSHAL_H +#define MICROPY_INCLUDED_ESP8266_ETSHAL_H #include @@ -42,4 +42,4 @@ uint32_t SPIRead(uint32_t offset, void *buf, uint32_t len); uint32_t SPIWrite(uint32_t offset, const void *buf, uint32_t len); uint32_t SPIEraseSector(int sector); -#endif // _INCLUDED_ETSHAL_H_ +#endif // MICROPY_INCLUDED_ESP8266_ETSHAL_H diff --git a/esp8266/gccollect.h b/esp8266/gccollect.h index d81cba12c..0aee42771 100644 --- a/esp8266/gccollect.h +++ b/esp8266/gccollect.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_ESP8266_GCCOLLECT_H +#define MICROPY_INCLUDED_ESP8266_GCCOLLECT_H extern uint32_t _text_start; extern uint32_t _text_end; @@ -39,3 +41,5 @@ extern uint32_t _heap_end; void gc_collect(void); void esp_native_code_gc_collect(void); + +#endif // MICROPY_INCLUDED_ESP8266_GCCOLLECT_H diff --git a/esp8266/modmachine.h b/esp8266/modmachine.h index 414aaa85b..eae351f68 100644 --- a/esp8266/modmachine.h +++ b/esp8266/modmachine.h @@ -1,5 +1,5 @@ -#ifndef __MICROPY_INCLUDED_ESP8266_MODPYB_H__ -#define __MICROPY_INCLUDED_ESP8266_MODPYB_H__ +#ifndef MICROPY_INCLUDED_ESP8266_MODMACHINE_H +#define MICROPY_INCLUDED_ESP8266_MODMACHINE_H #include "py/obj.h" @@ -38,4 +38,4 @@ void pyb_rtc_set_us_since_2000(uint64_t nowus); uint64_t pyb_rtc_get_us_since_2000(); void rtc_prepare_deepsleep(uint64_t sleep_us); -#endif // __MICROPY_INCLUDED_ESP8266_MODPYB_H__ +#endif // MICROPY_INCLUDED_ESP8266_MODMACHINE_H diff --git a/esp8266/uart.h b/esp8266/uart.h index f6850c42d..ebcd8b051 100644 --- a/esp8266/uart.h +++ b/esp8266/uart.h @@ -1,5 +1,5 @@ -#ifndef _INCLUDED_UART_H_ -#define _INCLUDED_UART_H_ +#ifndef MICROPY_INCLUDED_ESP8266_UART_H +#define MICROPY_INCLUDED_ESP8266_UART_H #include @@ -103,4 +103,4 @@ void uart_setup(uint8 uart); int uart_rx_any(uint8 uart); int uart_tx_any_room(uint8 uart); -#endif // _INCLUDED_UART_H_ +#endif // MICROPY_INCLUDED_ESP8266_UART_H diff --git a/esp8266/xtirq.h b/esp8266/xtirq.h index 856ff075a..595052fc7 100644 --- a/esp8266/xtirq.h +++ b/esp8266/xtirq.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_ESP8266_XTIRQ_H__ -#define __MICROPY_INCLUDED_ESP8266_XTIRQ_H__ +#ifndef MICROPY_INCLUDED_ESP8266_XTIRQ_H +#define MICROPY_INCLUDED_ESP8266_XTIRQ_H #include @@ -57,4 +56,4 @@ static inline void enable_irq(uint32_t irq_state) { restore_irq_pri(irq_state); } -#endif // __MICROPY_INCLUDED_ESP8266_XTIRQ_H__ +#endif // MICROPY_INCLUDED_ESP8266_XTIRQ_H diff --git a/extmod/lwip-include/arch/cc.h b/extmod/lwip-include/arch/cc.h index 0a7907d34..400dc6ec7 100644 --- a/extmod/lwip-include/arch/cc.h +++ b/extmod/lwip-include/arch/cc.h @@ -1,5 +1,5 @@ -#ifndef __CC_H__ -#define __CC_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_CC_H +#define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_CC_H #include @@ -38,4 +38,4 @@ typedef u32_t mem_ptr_t; #define PACK_STRUCT_BEGIN #define PACK_STRUCT_END -#endif /* __ARCH_CC_H__ */ +#endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_CC_H diff --git a/extmod/lwip-include/arch/perf.h b/extmod/lwip-include/arch/perf.h index 51710701a..d310fc339 100644 --- a/extmod/lwip-include/arch/perf.h +++ b/extmod/lwip-include/arch/perf.h @@ -1,7 +1,7 @@ -#ifndef __PERF_H__ -#define __PERF_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H +#define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H #define PERF_START /* null definition */ #define PERF_STOP(x) /* null definition */ -#endif /* __PERF_H__ */ +#endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H diff --git a/extmod/lwip-include/lwipopts.h b/extmod/lwip-include/lwipopts.h index e4a33b238..2122f30f0 100644 --- a/extmod/lwip-include/lwipopts.h +++ b/extmod/lwip-include/lwipopts.h @@ -1,5 +1,5 @@ -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H +#define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H #include #include @@ -32,5 +32,4 @@ typedef uint32_t sys_prot_t; // things like this into a port-provided header file. #define sys_now mp_hal_ticks_ms -#endif - +#endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H diff --git a/extmod/machine_i2c.h b/extmod/machine_i2c.h index d49ff01e4..f5af6656f 100644 --- a/extmod/machine_i2c.h +++ b/extmod/machine_i2c.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H #include "py/obj.h" @@ -54,4 +53,4 @@ extern const mp_obj_dict_t mp_machine_soft_i2c_locals_dict; int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop); int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop); -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H diff --git a/extmod/machine_mem.h b/extmod/machine_mem.h index fddd7d46c..4bc9ac127 100644 --- a/extmod/machine_mem.h +++ b/extmod/machine_mem.h @@ -23,10 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H #include "py/obj.h" @@ -48,4 +46,4 @@ uintptr_t MICROPY_MACHINE_MEM_GET_READ_ADDR(mp_obj_t addr_o, uint align); uintptr_t MICROPY_MACHINE_MEM_GET_WRITE_ADDR(mp_obj_t addr_o, uint align); #endif -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H diff --git a/extmod/machine_pinbase.h b/extmod/machine_pinbase.h index ece3384cc..c96abbc46 100644 --- a/extmod/machine_pinbase.h +++ b/extmod/machine_pinbase.h @@ -23,13 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H #include "py/obj.h" extern const mp_obj_type_t machine_pinbase_type; -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H diff --git a/extmod/machine_pulse.h b/extmod/machine_pulse.h index cc1c4eda5..e303dca02 100644 --- a/extmod/machine_pulse.h +++ b/extmod/machine_pulse.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H #include "py/obj.h" #include "py/mphal.h" @@ -34,4 +33,4 @@ mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_time_pulse_us_obj); -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H diff --git a/extmod/machine_signal.h b/extmod/machine_signal.h index 7f88cbaa8..df1c3e2e9 100644 --- a/extmod/machine_signal.h +++ b/extmod/machine_signal.h @@ -23,13 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H #include "py/obj.h" extern const mp_obj_type_t machine_signal_type; -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H diff --git a/extmod/machine_spi.h b/extmod/machine_spi.h index 88a3e19f4..e24e41eb3 100644 --- a/extmod/machine_spi.h +++ b/extmod/machine_spi.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H #define MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H diff --git a/extmod/misc.h b/extmod/misc.h index d7ead0654..6c13592c7 100644 --- a/extmod/misc.h +++ b/extmod/misc.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_MISC_H +#define MICROPY_INCLUDED_EXTMOD_MISC_H // This file contains cumulative declarations for extmod/ . @@ -38,3 +40,5 @@ void mp_uos_deactivate(const char *msg, mp_obj_t exc); #else #define mp_uos_dupterm_tx_strn(s, l) #endif + +#endif // MICROPY_INCLUDED_EXTMOD_MISC_H diff --git a/extmod/modubinascii.h b/extmod/modubinascii.h index 33d0f1cbd..6c0156fc4 100644 --- a/extmod/modubinascii.h +++ b/extmod/modubinascii.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MICROPY_EXTMOD_MODUBINASCII -#define MICROPY_EXTMOD_MODUBINASCII +#ifndef MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H +#define MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H extern mp_obj_t mod_binascii_hexlify(size_t n_args, const mp_obj_t *args); extern mp_obj_t mod_binascii_unhexlify(mp_obj_t data); @@ -39,4 +38,4 @@ MP_DECLARE_CONST_FUN_OBJ_1(mod_binascii_a2b_base64_obj); MP_DECLARE_CONST_FUN_OBJ_1(mod_binascii_b2a_base64_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mod_binascii_crc32_obj); -#endif /* MICROPY_EXTMOD_MODUBINASCII */ +#endif // MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H diff --git a/extmod/modwebsocket.h b/extmod/modwebsocket.h index 7da147561..2720147df 100644 --- a/extmod/modwebsocket.h +++ b/extmod/modwebsocket.h @@ -1,5 +1,10 @@ +#ifndef MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H +#define MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H + #define FRAME_OPCODE_MASK 0x0f enum { FRAME_CONT, FRAME_TXT, FRAME_BIN, FRAME_CLOSE = 0x8, FRAME_PING, FRAME_PONG }; + +#endif // MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H diff --git a/extmod/utime_mphal.h b/extmod/utime_mphal.h index 644387b67..88a9ed4d3 100644 --- a/extmod/utime_mphal.h +++ b/extmod/utime_mphal.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H +#define MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H #include "py/obj.h" @@ -35,3 +37,5 @@ MP_DECLARE_CONST_FUN_OBJ_0(mp_utime_ticks_us_obj); MP_DECLARE_CONST_FUN_OBJ_0(mp_utime_ticks_cpu_obj); MP_DECLARE_CONST_FUN_OBJ_2(mp_utime_ticks_diff_obj); MP_DECLARE_CONST_FUN_OBJ_2(mp_utime_ticks_add_obj); + +#endif // MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H diff --git a/extmod/vfs.h b/extmod/vfs.h index edaeb5349..f2efdbe79 100644 --- a/extmod/vfs.h +++ b/extmod/vfs.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_EXTMOD_VFS_H #define MICROPY_INCLUDED_EXTMOD_VFS_H diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h index 6c7c05a9a..63c4abb82 100644 --- a/extmod/vfs_fat.h +++ b/extmod/vfs_fat.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_VFS_FAT_H +#define MICROPY_INCLUDED_EXTMOD_VFS_FAT_H #include "py/lexer.h" #include "py/obj.h" @@ -58,3 +60,5 @@ mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode) MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj); mp_obj_t fat_vfs_ilistdir2(struct _fs_user_mount_t *vfs, const char *path, bool is_str_type); + +#endif // MICROPY_INCLUDED_EXTMOD_VFS_FAT_H diff --git a/extmod/virtpin.h b/extmod/virtpin.h index 041010350..706affc19 100644 --- a/extmod/virtpin.h +++ b/extmod/virtpin.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_VIRTPIN_H +#define MICROPY_INCLUDED_EXTMOD_VIRTPIN_H #include "py/obj.h" @@ -41,3 +43,5 @@ void mp_virtual_pin_write(mp_obj_t pin, int value); // If a port exposes a Pin object, it's constructor should be like this mp_obj_t mp_pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args); + +#endif // MICROPY_INCLUDED_EXTMOD_VIRTPIN_H diff --git a/lib/mp-readline/readline.h b/lib/mp-readline/readline.h index f73934d23..f53fdeaa8 100644 --- a/lib/mp-readline/readline.h +++ b/lib/mp-readline/readline.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_LIB_MP_READLINE_READLINE_H +#define MICROPY_INCLUDED_LIB_MP_READLINE_READLINE_H #define CHAR_CTRL_A (1) #define CHAR_CTRL_B (2) @@ -42,3 +44,5 @@ void readline_push_history(const char *line); void readline_init(vstr_t *line, const char *prompt); void readline_note_newline(const char *prompt); int readline_process_char(int c); + +#endif // MICROPY_INCLUDED_LIB_MP_READLINE_READLINE_H diff --git a/lib/netutils/netutils.h b/lib/netutils/netutils.h index 45e021640..1e147afa9 100644 --- a/lib/netutils/netutils.h +++ b/lib/netutils/netutils.h @@ -24,8 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_LIB_NETUTILS_H__ -#define __MICROPY_INCLUDED_LIB_NETUTILS_H__ +#ifndef MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H +#define MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H #define NETUTILS_IPV4ADDR_BUFSIZE 4 @@ -47,4 +47,4 @@ void netutils_parse_ipv4_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian // puts IP in out_ip (which must take at least IPADDR_BUF_SIZE bytes). mp_uint_t netutils_parse_inet_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian_t endian); -#endif // __MICROPY_INCLUDED_LIB_NETUTILS_H__ +#endif // MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H diff --git a/lib/timeutils/timeutils.h b/lib/timeutils/timeutils.h index c3f1fc2db..1dc486e2e 100644 --- a/lib/timeutils/timeutils.h +++ b/lib/timeutils/timeutils.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_LIB_TIMEUTILS_H__ -#define __MICROPY_INCLUDED_LIB_TIMEUTILS_H__ +#ifndef MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H +#define MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H typedef struct _timeutils_struct_time_t { uint16_t tm_year; // i.e. 2014 @@ -52,4 +51,4 @@ mp_uint_t timeutils_seconds_since_2000(mp_uint_t year, mp_uint_t month, mp_uint_t timeutils_mktime(mp_uint_t year, mp_int_t month, mp_int_t mday, mp_int_t hours, mp_int_t minutes, mp_int_t seconds); -#endif // __MICROPY_INCLUDED_LIB_TIMEUTILS_H__ +#endif // MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H diff --git a/lib/utils/interrupt_char.h b/lib/utils/interrupt_char.h index ae0bf57e8..ca50d4d56 100644 --- a/lib/utils/interrupt_char.h +++ b/lib/utils/interrupt_char.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H +#define MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H extern int mp_interrupt_char; void mp_hal_set_interrupt_char(int c); void mp_keyboard_interrupt(void); + +#endif // MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index 0c7567e27..69cdb4762 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__ -#define __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__ +#ifndef MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H +#define MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H typedef enum { PYEXEC_MODE_RAW_REPL, @@ -51,4 +51,4 @@ extern uint8_t pyexec_repl_active; MP_DECLARE_CONST_FUN_OBJ_1(pyb_set_repl_info_obj); -#endif // __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__ +#endif // MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H diff --git a/pic16bit/board.h b/pic16bit/board.h index 0eb022436..f79dd3497 100644 --- a/pic16bit/board.h +++ b/pic16bit/board.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PIC16BIT_BOARD_H__ -#define __MICROPY_INCLUDED_PIC16BIT_BOARD_H__ +#ifndef MICROPY_INCLUDED_PIC16BIT_BOARD_H +#define MICROPY_INCLUDED_PIC16BIT_BOARD_H void cpu_init(void); @@ -40,4 +40,4 @@ int uart_rx_any(void); int uart_rx_char(void); void uart_tx_char(int chr); -#endif // __MICROPY_INCLUDED_PIC16BIT_BOARD_H__ +#endif // MICROPY_INCLUDED_PIC16BIT_BOARD_H diff --git a/pic16bit/modpyb.h b/pic16bit/modpyb.h index 6c68cbdfd..910ec1b6e 100644 --- a/pic16bit/modpyb.h +++ b/pic16bit/modpyb.h @@ -23,11 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PIC16BIT_MODPYB_H__ -#define __MICROPY_INCLUDED_PIC16BIT_MODPYB_H__ +#ifndef MICROPY_INCLUDED_PIC16BIT_MODPYB_H +#define MICROPY_INCLUDED_PIC16BIT_MODPYB_H extern const mp_obj_type_t pyb_led_type; extern const mp_obj_type_t pyb_switch_type; extern const mp_obj_module_t pyb_module; -#endif // __MICROPY_INCLUDED_PIC16BIT_MODPYB_H__ +#endif // MICROPY_INCLUDED_PIC16BIT_MODPYB_H diff --git a/pic16bit/pic16bit_mphal.h b/pic16bit/pic16bit_mphal.h index a858f7e0f..ffcca41bf 100644 --- a/pic16bit/pic16bit_mphal.h +++ b/pic16bit/pic16bit_mphal.h @@ -23,13 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PIC16BIT_PIC16BIT_MPHAL_H__ -#define __MICROPY_INCLUDED_PIC16BIT_PIC16BIT_MPHAL_H__ #include "py/mpstate.h" void mp_hal_init(void); void mp_hal_set_interrupt_char(int c); - -#endif // __MICROPY_INCLUDED_PIC16BIT_PIC16BIT_MPHAL_H__ diff --git a/pic16bit/unistd.h b/pic16bit/unistd.h index cdd9fe061..5b60c8a62 100644 --- a/pic16bit/unistd.h +++ b/pic16bit/unistd.h @@ -1,5 +1,10 @@ +#ifndef MICROPY_INCLUDED_PIC16BIT_UNISTD_H +#define MICROPY_INCLUDED_PIC16BIT_UNISTD_H + // XC16 compiler doesn't seem to have unistd.h file #define SEEK_CUR 1 typedef int ssize_t; + +#endif // MICROPY_INCLUDED_PIC16BIT_UNISTD_H diff --git a/py/asmarm.h b/py/asmarm.h index e273b98d7..c5900925f 100644 --- a/py/asmarm.h +++ b/py/asmarm.h @@ -24,8 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMARM_H__ -#define __MICROPY_INCLUDED_PY_ASMARM_H__ +#ifndef MICROPY_INCLUDED_PY_ASMARM_H +#define MICROPY_INCLUDED_PY_ASMARM_H #include "py/misc.h" #include "py/asmbase.h" @@ -202,4 +202,4 @@ void asm_arm_bl_ind(asm_arm_t *as, void *fun_ptr, uint fun_id, uint reg_temp); #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMARM_H__ +#endif // MICROPY_INCLUDED_PY_ASMARM_H diff --git a/py/asmthumb.h b/py/asmthumb.h index 52e663b3b..589c481cd 100644 --- a/py/asmthumb.h +++ b/py/asmthumb.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMTHUMB_H__ -#define __MICROPY_INCLUDED_PY_ASMTHUMB_H__ +#ifndef MICROPY_INCLUDED_PY_ASMTHUMB_H +#define MICROPY_INCLUDED_PY_ASMTHUMB_H #include "py/misc.h" #include "py/asmbase.h" @@ -318,4 +318,4 @@ void asm_thumb_bl_ind(asm_thumb_t *as, void *fun_ptr, uint fun_id, uint reg_temp #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMTHUMB_H__ +#endif // MICROPY_INCLUDED_PY_ASMTHUMB_H diff --git a/py/asmx64.h b/py/asmx64.h index 4499c53c3..a384cca00 100644 --- a/py/asmx64.h +++ b/py/asmx64.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMX64_H__ -#define __MICROPY_INCLUDED_PY_ASMX64_H__ +#ifndef MICROPY_INCLUDED_PY_ASMX64_H +#define MICROPY_INCLUDED_PY_ASMX64_H #include "py/mpconfig.h" #include "py/misc.h" @@ -197,4 +197,4 @@ void asm_x64_call_ind(asm_x64_t* as, void* ptr, int temp_r32); #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMX64_H__ +#endif // MICROPY_INCLUDED_PY_ASMX64_H diff --git a/py/asmx86.h b/py/asmx86.h index 0b44af663..fd34228d1 100644 --- a/py/asmx86.h +++ b/py/asmx86.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMX86_H__ -#define __MICROPY_INCLUDED_PY_ASMX86_H__ +#ifndef MICROPY_INCLUDED_PY_ASMX86_H +#define MICROPY_INCLUDED_PY_ASMX86_H #include "py/mpconfig.h" #include "py/misc.h" @@ -195,4 +195,4 @@ void asm_x86_call_ind(asm_x86_t* as, void* ptr, mp_uint_t n_args, int temp_r32); #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMX86_H__ +#endif // MICROPY_INCLUDED_PY_ASMX86_H diff --git a/py/bc.h b/py/bc.h index 88045dc55..c55d31fe4 100644 --- a/py/bc.h +++ b/py/bc.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BC_H__ -#define __MICROPY_INCLUDED_PY_BC_H__ +#ifndef MICROPY_INCLUDED_PY_BC_H +#define MICROPY_INCLUDED_PY_BC_H #include "py/runtime.h" #include "py/obj.h" @@ -119,4 +119,4 @@ uint mp_opcode_format(const byte *ip, size_t *opcode_size); #endif -#endif // __MICROPY_INCLUDED_PY_BC_H__ +#endif // MICROPY_INCLUDED_PY_BC_H diff --git a/py/bc0.h b/py/bc0.h index b5650abe4..be8ac6c15 100644 --- a/py/bc0.h +++ b/py/bc0.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BC0_H__ -#define __MICROPY_INCLUDED_PY_BC0_H__ +#ifndef MICROPY_INCLUDED_PY_BC0_H +#define MICROPY_INCLUDED_PY_BC0_H // Micro Python byte-codes. // The comment at the end of the line (if it exists) tells the arguments to the byte-code. @@ -116,4 +116,4 @@ #define MP_BC_UNARY_OP_MULTI (0xd0) // + op(7) #define MP_BC_BINARY_OP_MULTI (0xd7) // + op(36) -#endif // __MICROPY_INCLUDED_PY_BC0_H__ +#endif // MICROPY_INCLUDED_PY_BC0_H diff --git a/py/binary.h b/py/binary.h index 997d878c8..04cc6d83b 100644 --- a/py/binary.h +++ b/py/binary.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BINARY_H__ -#define __MICROPY_INCLUDED_PY_BINARY_H__ +#ifndef MICROPY_INCLUDED_PY_BINARY_H +#define MICROPY_INCLUDED_PY_BINARY_H #include "py/obj.h" @@ -41,4 +41,4 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte ** long long mp_binary_get_int(mp_uint_t size, bool is_signed, bool big_endian, const byte *src); void mp_binary_set_int(mp_uint_t val_sz, bool big_endian, byte *dest, mp_uint_t val); -#endif // __MICROPY_INCLUDED_PY_BINARY_H__ +#endif // MICROPY_INCLUDED_PY_BINARY_H diff --git a/py/builtin.h b/py/builtin.h index ec326d037..4915383f2 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BUILTIN_H__ -#define __MICROPY_INCLUDED_PY_BUILTIN_H__ +#ifndef MICROPY_INCLUDED_PY_BUILTIN_H +#define MICROPY_INCLUDED_PY_BUILTIN_H #include "py/obj.h" @@ -120,4 +120,4 @@ extern const mp_obj_module_t mp_module_btree; extern const char *MICROPY_PY_BUILTINS_HELP_TEXT; -#endif // __MICROPY_INCLUDED_PY_BUILTIN_H__ +#endif // MICROPY_INCLUDED_PY_BUILTIN_H diff --git a/py/compile.h b/py/compile.h index 45a98588d..f6b262d18 100644 --- a/py/compile.h +++ b/py/compile.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_COMPILE_H__ -#define __MICROPY_INCLUDED_PY_COMPILE_H__ +#ifndef MICROPY_INCLUDED_PY_COMPILE_H +#define MICROPY_INCLUDED_PY_COMPILE_H #include "py/lexer.h" #include "py/parse.h" @@ -51,4 +51,4 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f // this is implemented in runtime.c mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_input_kind, mp_obj_dict_t *globals, mp_obj_dict_t *locals); -#endif // __MICROPY_INCLUDED_PY_COMPILE_H__ +#endif // MICROPY_INCLUDED_PY_COMPILE_H diff --git a/py/emit.h b/py/emit.h index 0236a9b8d..a58e20e3d 100644 --- a/py/emit.h +++ b/py/emit.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_PY_EMIT_H__ -#define __MICROPY_INCLUDED_PY_EMIT_H__ +#ifndef MICROPY_INCLUDED_PY_EMIT_H +#define MICROPY_INCLUDED_PY_EMIT_H #include "py/lexer.h" #include "py/scope.h" @@ -284,4 +283,4 @@ void mp_emitter_warning(pass_kind_t pass, const char *msg); #define mp_emitter_warning(pass, msg) #endif -#endif // __MICROPY_INCLUDED_PY_EMIT_H__ +#endif // MICROPY_INCLUDED_PY_EMIT_H diff --git a/py/emitglue.h b/py/emitglue.h index 37c4f1b18..309996596 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_EMITGLUE_H__ -#define __MICROPY_INCLUDED_PY_EMITGLUE_H__ +#ifndef MICROPY_INCLUDED_PY_EMITGLUE_H +#define MICROPY_INCLUDED_PY_EMITGLUE_H #include "py/obj.h" @@ -74,4 +74,4 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_args, mp_obj_t def_kw_args); mp_obj_t mp_make_closure_from_raw_code(const mp_raw_code_t *rc, mp_uint_t n_closed_over, const mp_obj_t *args); -#endif // __MICROPY_INCLUDED_PY_EMITGLUE_H__ +#endif // MICROPY_INCLUDED_PY_EMITGLUE_H diff --git a/py/formatfloat.h b/py/formatfloat.h index 019603447..9c8d137bb 100644 --- a/py/formatfloat.h +++ b/py/formatfloat.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_FORMATFLOAT_H__ -#define __MICROPY_INCLUDED_PY_FORMATFLOAT_H__ +#ifndef MICROPY_INCLUDED_PY_FORMATFLOAT_H +#define MICROPY_INCLUDED_PY_FORMATFLOAT_H #include "py/mpconfig.h" @@ -32,4 +32,4 @@ int mp_format_float(mp_float_t f, char *buf, size_t bufSize, char fmt, int prec, char sign); #endif -#endif // __MICROPY_INCLUDED_PY_FORMATFLOAT_H__ +#endif // MICROPY_INCLUDED_PY_FORMATFLOAT_H diff --git a/py/frozenmod.h b/py/frozenmod.h index 7c1299b2c..6993167ac 100644 --- a/py/frozenmod.h +++ b/py/frozenmod.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_FROZENMOD_H__ -#define __MICROPY_INCLUDED_PY_FROZENMOD_H__ +#ifndef MICROPY_INCLUDED_PY_FROZENMOD_H +#define MICROPY_INCLUDED_PY_FROZENMOD_H #include "py/lexer.h" @@ -38,4 +38,4 @@ int mp_find_frozen_module(const char *str, size_t len, void **data); const char *mp_find_frozen_str(const char *str, size_t *len); mp_import_stat_t mp_frozen_stat(const char *str); -#endif // __MICROPY_INCLUDED_PY_FROZENMOD_H__ +#endif // MICROPY_INCLUDED_PY_FROZENMOD_H diff --git a/py/gc.h b/py/gc.h index 7d8fe2bf8..136695517 100644 --- a/py/gc.h +++ b/py/gc.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_GC_H__ -#define __MICROPY_INCLUDED_PY_GC_H__ +#ifndef MICROPY_INCLUDED_PY_GC_H +#define MICROPY_INCLUDED_PY_GC_H #include @@ -64,4 +64,4 @@ void gc_info(gc_info_t *info); void gc_dump_info(void); void gc_dump_alloc_table(void); -#endif // __MICROPY_INCLUDED_PY_GC_H__ +#endif // MICROPY_INCLUDED_PY_GC_H diff --git a/py/lexer.h b/py/lexer.h index 5d998b352..435aa096b 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_LEXER_H__ -#define __MICROPY_INCLUDED_PY_LEXER_H__ +#ifndef MICROPY_INCLUDED_PY_LEXER_H +#define MICROPY_INCLUDED_PY_LEXER_H #include @@ -192,4 +192,4 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename); mp_lexer_t *mp_lexer_new_from_fd(qstr filename, int fd, bool close_fd); #endif -#endif // __MICROPY_INCLUDED_PY_LEXER_H__ +#endif // MICROPY_INCLUDED_PY_LEXER_H diff --git a/py/misc.h b/py/misc.h index 5ac0f933a..cebbd38ea 100644 --- a/py/misc.h +++ b/py/misc.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MISC_H__ -#define __MICROPY_INCLUDED_PY_MISC_H__ +#ifndef MICROPY_INCLUDED_PY_MISC_H +#define MICROPY_INCLUDED_PY_MISC_H // a mini library of useful types and functions @@ -223,4 +223,4 @@ static inline mp_uint_t count_lead_ones(byte val) { #define MP_FLOAT_EXP_BIAS ((1 << (MP_FLOAT_EXP_BITS - 1)) - 1) #endif // MICROPY_PY_BUILTINS_FLOAT -#endif // __MICROPY_INCLUDED_PY_MISC_H__ +#endif // MICROPY_INCLUDED_PY_MISC_H diff --git a/py/mpconfig.h b/py/mpconfig.h index 32d64828d..fb507a503 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPCONFIG_H__ -#define __MICROPY_INCLUDED_PY_MPCONFIG_H__ +#ifndef MICROPY_INCLUDED_PY_MPCONFIG_H +#define MICROPY_INCLUDED_PY_MPCONFIG_H // This file contains default configuration settings for MicroPython. // You can override any of the options below using mpconfigport.h file @@ -1253,4 +1253,4 @@ typedef double mp_float_t; #define MP_UNLIKELY(x) __builtin_expect((x), 0) #endif -#endif // __MICROPY_INCLUDED_PY_MPCONFIG_H__ +#endif // MICROPY_INCLUDED_PY_MPCONFIG_H diff --git a/py/mperrno.h b/py/mperrno.h index 6ea99ae22..c515ed488 100644 --- a/py/mperrno.h +++ b/py/mperrno.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_PY_MPERRNO_H__ -#define __MICROPY_INCLUDED_PY_MPERRNO_H__ +#ifndef MICROPY_INCLUDED_PY_MPERRNO_H +#define MICROPY_INCLUDED_PY_MPERRNO_H #if MICROPY_USE_INTERNAL_ERRNO @@ -142,4 +141,4 @@ qstr mp_errno_to_str(mp_obj_t errno_val); #endif -#endif // __MICROPY_INCLUDED_PY_MPERRNO_H__ +#endif // MICROPY_INCLUDED_PY_MPERRNO_H diff --git a/py/mphal.h b/py/mphal.h index 8d5654f9e..93a0a40ce 100644 --- a/py/mphal.h +++ b/py/mphal.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPHAL_H__ -#define __MICROPY_INCLUDED_PY_MPHAL_H__ +#ifndef MICROPY_INCLUDED_PY_MPHAL_H +#define MICROPY_INCLUDED_PY_MPHAL_H #include "py/mpconfig.h" @@ -80,4 +80,4 @@ mp_uint_t mp_hal_ticks_cpu(void); #include "extmod/virtpin.h" #endif -#endif // __MICROPY_INCLUDED_PY_MPHAL_H__ +#endif // MICROPY_INCLUDED_PY_MPHAL_H diff --git a/py/mpprint.h b/py/mpprint.h index 4fc904a20..20bd875b4 100644 --- a/py/mpprint.h +++ b/py/mpprint.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPPRINT_H__ -#define __MICROPY_INCLUDED_PY_MPPRINT_H__ +#ifndef MICROPY_INCLUDED_PY_MPPRINT_H +#define MICROPY_INCLUDED_PY_MPPRINT_H #include "py/mpconfig.h" @@ -71,4 +71,4 @@ int mp_printf(const mp_print_t *print, const char *fmt, ...); int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args); #endif -#endif // __MICROPY_INCLUDED_PY_MPPRINT_H__ +#endif // MICROPY_INCLUDED_PY_MPPRINT_H diff --git a/py/mpstate.h b/py/mpstate.h index 2b8f29a6a..b09ba08cf 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPSTATE_H__ -#define __MICROPY_INCLUDED_PY_MPSTATE_H__ +#ifndef MICROPY_INCLUDED_PY_MPSTATE_H +#define MICROPY_INCLUDED_PY_MPSTATE_H #include @@ -248,4 +248,4 @@ extern mp_state_thread_t *mp_thread_get_state(void); #define MP_STATE_THREAD(x) (mp_state_ctx.thread.x) #endif -#endif // __MICROPY_INCLUDED_PY_MPSTATE_H__ +#endif // MICROPY_INCLUDED_PY_MPSTATE_H diff --git a/py/mpthread.h b/py/mpthread.h index 04d4f1968..602df830c 100644 --- a/py/mpthread.h +++ b/py/mpthread.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPTHREAD_H__ -#define __MICROPY_INCLUDED_PY_MPTHREAD_H__ +#ifndef MICROPY_INCLUDED_PY_MPTHREAD_H +#define MICROPY_INCLUDED_PY_MPTHREAD_H #include "py/mpconfig.h" @@ -58,4 +58,4 @@ void mp_thread_mutex_unlock(mp_thread_mutex_t *mutex); #define MP_THREAD_GIL_EXIT() #endif -#endif // __MICROPY_INCLUDED_PY_MPTHREAD_H__ +#endif // MICROPY_INCLUDED_PY_MPTHREAD_H diff --git a/py/mpz.h b/py/mpz.h index 5c8822722..878febf8b 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPZ_H__ -#define __MICROPY_INCLUDED_PY_MPZ_H__ +#ifndef MICROPY_INCLUDED_PY_MPZ_H +#define MICROPY_INCLUDED_PY_MPZ_H #include @@ -139,4 +139,4 @@ mp_float_t mpz_as_float(const mpz_t *z); #endif size_t mpz_as_str_inpl(const mpz_t *z, unsigned int base, const char *prefix, char base_char, char comma, char *str); -#endif // __MICROPY_INCLUDED_PY_MPZ_H__ +#endif // MICROPY_INCLUDED_PY_MPZ_H diff --git a/py/nlr.h b/py/nlr.h index 7a71ef34b..624e97307 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_NLR_H__ -#define __MICROPY_INCLUDED_PY_NLR_H__ +#ifndef MICROPY_INCLUDED_PY_NLR_H +#define MICROPY_INCLUDED_PY_NLR_H // non-local return // exception handling, basically a stack of setjmp/longjmp buffers @@ -112,4 +112,4 @@ NORETURN void nlr_jump_fail(void *val); #endif -#endif // __MICROPY_INCLUDED_PY_NLR_H__ +#endif // MICROPY_INCLUDED_PY_NLR_H diff --git a/py/obj.h b/py/obj.h index a3c06a261..f88c10004 100644 --- a/py/obj.h +++ b/py/obj.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJ_H__ -#define __MICROPY_INCLUDED_PY_OBJ_H__ +#ifndef MICROPY_INCLUDED_PY_OBJ_H +#define MICROPY_INCLUDED_PY_OBJ_H #include "py/mpconfig.h" #include "py/misc.h" @@ -864,4 +864,4 @@ mp_obj_t mp_seq_extract_slice(size_t len, const mp_obj_t *seq, mp_bound_slice_t memmove(((char*)dest) + (beg + slice_len) * (item_sz), ((char*)dest) + (end) * (item_sz), ((dest_len) + (len_adj) - ((beg) + (slice_len))) * (item_sz)); \ memmove(((char*)dest) + (beg) * (item_sz), slice, slice_len * (item_sz)); -#endif // __MICROPY_INCLUDED_PY_OBJ_H__ +#endif // MICROPY_INCLUDED_PY_OBJ_H diff --git a/py/objarray.h b/py/objarray.h index 06a2a07ef..038966845 100644 --- a/py/objarray.h +++ b/py/objarray.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_PY_OBJARRAY_H__ -#define __MICROPY_INCLUDED_PY_OBJARRAY_H__ +#ifndef MICROPY_INCLUDED_PY_OBJARRAY_H +#define MICROPY_INCLUDED_PY_OBJARRAY_H #include "py/obj.h" @@ -40,4 +39,4 @@ typedef struct _mp_obj_array_t { void *items; } mp_obj_array_t; -#endif // __MICROPY_INCLUDED_PY_OBJARRAY_H__ +#endif // MICROPY_INCLUDED_PY_OBJARRAY_H diff --git a/py/objexcept.h b/py/objexcept.h index 3128fded7..2232e1e21 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJEXCEPT_H__ -#define __MICROPY_INCLUDED_PY_OBJEXCEPT_H__ +#ifndef MICROPY_INCLUDED_PY_OBJEXCEPT_H +#define MICROPY_INCLUDED_PY_OBJEXCEPT_H #include "py/obj.h" #include "py/objtuple.h" @@ -37,4 +37,4 @@ typedef struct _mp_obj_exception_t { mp_obj_tuple_t *args; } mp_obj_exception_t; -#endif // __MICROPY_INCLUDED_PY_OBJEXCEPT_H__ +#endif // MICROPY_INCLUDED_PY_OBJEXCEPT_H diff --git a/py/objfun.h b/py/objfun.h index d02fada9b..450c98f76 100644 --- a/py/objfun.h +++ b/py/objfun.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJFUN_H__ -#define __MICROPY_INCLUDED_PY_OBJFUN_H__ +#ifndef MICROPY_INCLUDED_PY_OBJFUN_H +#define MICROPY_INCLUDED_PY_OBJFUN_H #include "py/obj.h" @@ -41,4 +41,4 @@ typedef struct _mp_obj_fun_bc_t { mp_obj_t extra_args[]; } mp_obj_fun_bc_t; -#endif // __MICROPY_INCLUDED_PY_OBJFUN_H__ +#endif // MICROPY_INCLUDED_PY_OBJFUN_H diff --git a/py/objgenerator.h b/py/objgenerator.h index d1b9be478..d61332a20 100644 --- a/py/objgenerator.h +++ b/py/objgenerator.h @@ -23,12 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJGENERATOR_H__ -#define __MICROPY_INCLUDED_PY_OBJGENERATOR_H__ +#ifndef MICROPY_INCLUDED_PY_OBJGENERATOR_H +#define MICROPY_INCLUDED_PY_OBJGENERATOR_H #include "py/obj.h" #include "py/runtime.h" mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_val, mp_obj_t throw_val, mp_obj_t *ret_val); -#endif // __MICROPY_INCLUDED_PY_OBJGENERATOR_H__ +#endif // MICROPY_INCLUDED_PY_OBJGENERATOR_H diff --git a/py/objint.h b/py/objint.h index da56c1862..f341306ed 100644 --- a/py/objint.h +++ b/py/objint.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJINT_H__ -#define __MICROPY_INCLUDED_PY_OBJINT_H__ +#ifndef MICROPY_INCLUDED_PY_OBJINT_H +#define MICROPY_INCLUDED_PY_OBJINT_H #include "py/mpz.h" #include "py/obj.h" @@ -63,4 +63,4 @@ mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); mp_obj_t mp_obj_int_binary_op_extra_cases(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); mp_obj_t mp_obj_int_pow3(mp_obj_t base, mp_obj_t exponent, mp_obj_t modulus); -#endif // __MICROPY_INCLUDED_PY_OBJINT_H__ +#endif // MICROPY_INCLUDED_PY_OBJINT_H diff --git a/py/objlist.h b/py/objlist.h index 5b2d216fc..740ba9fda 100644 --- a/py/objlist.h +++ b/py/objlist.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJLIST_H__ -#define __MICROPY_INCLUDED_PY_OBJLIST_H__ +#ifndef MICROPY_INCLUDED_PY_OBJLIST_H +#define MICROPY_INCLUDED_PY_OBJLIST_H #include "py/obj.h" @@ -35,4 +35,4 @@ typedef struct _mp_obj_list_t { mp_obj_t *items; } mp_obj_list_t; -#endif // __MICROPY_INCLUDED_PY_OBJLIST_H__ +#endif // MICROPY_INCLUDED_PY_OBJLIST_H diff --git a/py/objmodule.h b/py/objmodule.h index 4e6612adc..5bfbe51d5 100644 --- a/py/objmodule.h +++ b/py/objmodule.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJMODULE_H__ -#define __MICROPY_INCLUDED_PY_OBJMODULE_H__ +#ifndef MICROPY_INCLUDED_PY_OBJMODULE_H +#define MICROPY_INCLUDED_PY_OBJMODULE_H #include "py/obj.h" @@ -34,4 +34,4 @@ extern const mp_map_t mp_builtin_module_weak_links_map; mp_obj_t mp_module_get(qstr module_name); void mp_module_register(qstr qstr, mp_obj_t module); -#endif // __MICROPY_INCLUDED_PY_OBJMODULE_H__ +#endif // MICROPY_INCLUDED_PY_OBJMODULE_H diff --git a/py/objstr.h b/py/objstr.h index e92832d10..6fbed405a 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJSTR_H__ -#define __MICROPY_INCLUDED_PY_OBJSTR_H__ +#ifndef MICROPY_INCLUDED_PY_OBJSTR_H +#define MICROPY_INCLUDED_PY_OBJSTR_H #include "py/obj.h" @@ -102,4 +102,4 @@ MP_DECLARE_CONST_FUN_OBJ_1(str_isdigit_obj); MP_DECLARE_CONST_FUN_OBJ_1(str_isupper_obj); MP_DECLARE_CONST_FUN_OBJ_1(str_islower_obj); -#endif // __MICROPY_INCLUDED_PY_OBJSTR_H__ +#endif // MICROPY_INCLUDED_PY_OBJSTR_H diff --git a/py/objtuple.h b/py/objtuple.h index 555c3b3c2..686702395 100644 --- a/py/objtuple.h +++ b/py/objtuple.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJTUPLE_H__ -#define __MICROPY_INCLUDED_PY_OBJTUPLE_H__ +#ifndef MICROPY_INCLUDED_PY_OBJTUPLE_H +#define MICROPY_INCLUDED_PY_OBJTUPLE_H #include "py/obj.h" @@ -61,4 +61,4 @@ void mp_obj_attrtuple_print_helper(const mp_print_t *print, const qstr *fields, mp_obj_t mp_obj_new_attrtuple(const qstr *fields, size_t n, const mp_obj_t *items); -#endif // __MICROPY_INCLUDED_PY_OBJTUPLE_H__ +#endif // MICROPY_INCLUDED_PY_OBJTUPLE_H diff --git a/py/objtype.h b/py/objtype.h index 61efd00c0..104b20aab 100644 --- a/py/objtype.h +++ b/py/objtype.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJTYPE_H__ -#define __MICROPY_INCLUDED_PY_OBJTYPE_H__ +#ifndef MICROPY_INCLUDED_PY_OBJTYPE_H +#define MICROPY_INCLUDED_PY_OBJTYPE_H #include "py/obj.h" @@ -49,4 +49,4 @@ mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, cons // this needs to be exposed for the above macros to work correctly mp_obj_t mp_obj_instance_make_new(const mp_obj_type_t *self_in, size_t n_args, size_t n_kw, const mp_obj_t *args); -#endif // __MICROPY_INCLUDED_PY_OBJTYPE_H__ +#endif // MICROPY_INCLUDED_PY_OBJTYPE_H diff --git a/py/parse.h b/py/parse.h index 769f5a875..fec18825b 100644 --- a/py/parse.h +++ b/py/parse.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_PARSE_H__ -#define __MICROPY_INCLUDED_PY_PARSE_H__ +#ifndef MICROPY_INCLUDED_PY_PARSE_H +#define MICROPY_INCLUDED_PY_PARSE_H #include #include @@ -104,4 +104,4 @@ typedef struct _mp_parse_t { mp_parse_tree_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind); void mp_parse_tree_clear(mp_parse_tree_t *tree); -#endif // __MICROPY_INCLUDED_PY_PARSE_H__ +#endif // MICROPY_INCLUDED_PY_PARSE_H diff --git a/py/parsenum.h b/py/parsenum.h index f140cfc85..77fd0f4a5 100644 --- a/py/parsenum.h +++ b/py/parsenum.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_PARSENUM_H__ -#define __MICROPY_INCLUDED_PY_PARSENUM_H__ +#ifndef MICROPY_INCLUDED_PY_PARSENUM_H +#define MICROPY_INCLUDED_PY_PARSENUM_H #include "py/mpconfig.h" #include "py/lexer.h" @@ -34,4 +34,4 @@ mp_obj_t mp_parse_num_integer(const char *restrict str, size_t len, int base, mp_lexer_t *lex); mp_obj_t mp_parse_num_decimal(const char *str, size_t len, bool allow_imag, bool force_complex, mp_lexer_t *lex); -#endif // __MICROPY_INCLUDED_PY_PARSENUM_H__ +#endif // MICROPY_INCLUDED_PY_PARSENUM_H diff --git a/py/parsenumbase.h b/py/parsenumbase.h index 9da9db841..143796df4 100644 --- a/py/parsenumbase.h +++ b/py/parsenumbase.h @@ -23,11 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_PARSENUMBASE_H__ -#define __MICROPY_INCLUDED_PY_PARSENUMBASE_H__ +#ifndef MICROPY_INCLUDED_PY_PARSENUMBASE_H +#define MICROPY_INCLUDED_PY_PARSENUMBASE_H #include "py/mpconfig.h" size_t mp_parse_num_base(const char *str, size_t len, int *base); -#endif // __MICROPY_INCLUDED_PY_PARSENUMBASE_H__ +#endif // MICROPY_INCLUDED_PY_PARSENUMBASE_H diff --git a/py/qstr.h b/py/qstr.h index 8c63fbbc8..4116eb81d 100644 --- a/py/qstr.h +++ b/py/qstr.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_QSTR_H__ -#define __MICROPY_INCLUDED_PY_QSTR_H__ +#ifndef MICROPY_INCLUDED_PY_QSTR_H +#define MICROPY_INCLUDED_PY_QSTR_H #include "py/mpconfig.h" #include "py/misc.h" @@ -76,4 +76,4 @@ const byte *qstr_data(qstr q, size_t *len); void qstr_pool_info(size_t *n_pool, size_t *n_qstr, size_t *n_str_data_bytes, size_t *n_total_bytes); void qstr_dump_data(void); -#endif // __MICROPY_INCLUDED_PY_QSTR_H__ +#endif // MICROPY_INCLUDED_PY_QSTR_H diff --git a/py/repl.h b/py/repl.h index 048b0de0f..c2499a270 100644 --- a/py/repl.h +++ b/py/repl.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_REPL_H__ -#define __MICROPY_INCLUDED_PY_REPL_H__ +#ifndef MICROPY_INCLUDED_PY_REPL_H +#define MICROPY_INCLUDED_PY_REPL_H #include "py/mpconfig.h" #include "py/misc.h" @@ -35,4 +35,4 @@ bool mp_repl_continue_with_input(const char *input); size_t mp_repl_autocomplete(const char *str, size_t len, const mp_print_t *print, const char **compl_str); #endif -#endif // __MICROPY_INCLUDED_PY_REPL_H__ +#endif // MICROPY_INCLUDED_PY_REPL_H diff --git a/py/ringbuf.h b/py/ringbuf.h index 5e108afad..b41692706 100644 --- a/py/ringbuf.h +++ b/py/ringbuf.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_RINGBUF_H__ -#define __MICROPY_INCLUDED_PY_RINGBUF_H__ +#ifndef MICROPY_INCLUDED_PY_RINGBUF_H +#define MICROPY_INCLUDED_PY_RINGBUF_H typedef struct _ringbuf_t { uint8_t *buf; @@ -69,4 +69,4 @@ static inline int ringbuf_put(ringbuf_t *r, uint8_t v) { return 0; } -#endif // __MICROPY_INCLUDED_PY_RINGBUF_H__ +#endif // MICROPY_INCLUDED_PY_RINGBUF_H diff --git a/py/runtime.h b/py/runtime.h index d75d23ff1..0add564cc 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_RUNTIME_H__ -#define __MICROPY_INCLUDED_PY_RUNTIME_H__ +#ifndef MICROPY_INCLUDED_PY_RUNTIME_H +#define MICROPY_INCLUDED_PY_RUNTIME_H #include "py/mpstate.h" #include "py/obj.h" @@ -178,4 +178,4 @@ void mp_warning(const char *msg, ...); #define mp_warning(msg, ...) #endif -#endif // __MICROPY_INCLUDED_PY_RUNTIME_H__ +#endif // MICROPY_INCLUDED_PY_RUNTIME_H diff --git a/py/runtime0.h b/py/runtime0.h index 720fe6a23..060ee8c0a 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_RUNTIME0_H__ -#define __MICROPY_INCLUDED_PY_RUNTIME0_H__ +#ifndef MICROPY_INCLUDED_PY_RUNTIME0_H +#define MICROPY_INCLUDED_PY_RUNTIME0_H // These must fit in 8 bits; see scope.h #define MP_SCOPE_FLAG_VARARGS (0x01) @@ -151,4 +151,4 @@ typedef enum { extern void *const mp_fun_table[MP_F_NUMBER_OF]; -#endif // __MICROPY_INCLUDED_PY_RUNTIME0_H__ +#endif // MICROPY_INCLUDED_PY_RUNTIME0_H diff --git a/py/scope.h b/py/scope.h index 826064d7e..4d0c1b1d9 100644 --- a/py/scope.h +++ b/py/scope.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_SCOPE_H__ -#define __MICROPY_INCLUDED_PY_SCOPE_H__ +#ifndef MICROPY_INCLUDED_PY_SCOPE_H +#define MICROPY_INCLUDED_PY_SCOPE_H #include "py/parse.h" #include "py/emitglue.h" @@ -94,4 +94,4 @@ id_info_t *scope_find(scope_t *scope, qstr qstr); id_info_t *scope_find_global(scope_t *scope, qstr qstr); void scope_find_local_and_close_over(scope_t *scope, id_info_t *id, qstr qst); -#endif // __MICROPY_INCLUDED_PY_SCOPE_H__ +#endif // MICROPY_INCLUDED_PY_SCOPE_H diff --git a/py/smallint.h b/py/smallint.h index b9686be30..b2bfc6df9 100644 --- a/py/smallint.h +++ b/py/smallint.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_SMALLINT_H__ -#define __MICROPY_INCLUDED_PY_SMALLINT_H__ +#ifndef MICROPY_INCLUDED_PY_SMALLINT_H +#define MICROPY_INCLUDED_PY_SMALLINT_H #include "py/mpconfig.h" #include "py/misc.h" @@ -65,4 +65,4 @@ bool mp_small_int_mul_overflow(mp_int_t x, mp_int_t y); mp_int_t mp_small_int_modulo(mp_int_t dividend, mp_int_t divisor); mp_int_t mp_small_int_floor_divide(mp_int_t num, mp_int_t denom); -#endif // __MICROPY_INCLUDED_PY_SMALLINT_H__ +#endif // MICROPY_INCLUDED_PY_SMALLINT_H diff --git a/py/stackctrl.h b/py/stackctrl.h index e915f5000..84c0e1427 100644 --- a/py/stackctrl.h +++ b/py/stackctrl.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_STACKCTRL_H__ -#define __MICROPY_INCLUDED_PY_STACKCTRL_H__ +#ifndef MICROPY_INCLUDED_PY_STACKCTRL_H +#define MICROPY_INCLUDED_PY_STACKCTRL_H #include "py/mpconfig.h" @@ -45,4 +45,4 @@ void mp_stack_check(void); #endif -#endif // __MICROPY_INCLUDED_PY_STACKCTRL_H__ +#endif // MICROPY_INCLUDED_PY_STACKCTRL_H diff --git a/py/stream.h b/py/stream.h index 01199ab60..0b5fd7cc0 100644 --- a/py/stream.h +++ b/py/stream.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_STREAM_H__ -#define __MICROPY_INCLUDED_PY_STREAM_H__ +#ifndef MICROPY_INCLUDED_PY_STREAM_H +#define MICROPY_INCLUDED_PY_STREAM_H #include "py/obj.h" #include "py/mperrno.h" @@ -103,4 +103,4 @@ int mp_stream_posix_fsync(mp_obj_t stream); #define mp_is_nonblocking_error(errno) (0) #endif -#endif // __MICROPY_INCLUDED_PY_STREAM_H__ +#endif // MICROPY_INCLUDED_PY_STREAM_H diff --git a/py/unicode.h b/py/unicode.h index 89c28ed0e..f99c9705d 100644 --- a/py/unicode.h +++ b/py/unicode.h @@ -23,12 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_UNICODE_H__ -#define __MICROPY_INCLUDED_PY_UNICODE_H__ +#ifndef MICROPY_INCLUDED_PY_UNICODE_H +#define MICROPY_INCLUDED_PY_UNICODE_H #include "py/mpconfig.h" #include "py/misc.h" mp_uint_t utf8_ptr_to_index(const byte *s, const byte *ptr); -#endif // __MICROPY_INCLUDED_PY_UNICODE_H__ +#endif // MICROPY_INCLUDED_PY_UNICODE_H diff --git a/stmhal/accel.h b/stmhal/accel.h index 10b095f79..42b156329 100644 --- a/stmhal/accel.h +++ b/stmhal/accel.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_ACCEL_H +#define MICROPY_INCLUDED_STMHAL_ACCEL_H extern const mp_obj_type_t pyb_accel_type; void accel_init(void); + +#endif // MICROPY_INCLUDED_STMHAL_ACCEL_H diff --git a/stmhal/adc.h b/stmhal/adc.h index ebaccbee3..6ec558464 100644 --- a/stmhal/adc.h +++ b/stmhal/adc.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_ADC_H +#define MICROPY_INCLUDED_STMHAL_ADC_H extern const mp_obj_type_t pyb_adc_type; extern const mp_obj_type_t pyb_adc_all_type; + +#endif // MICROPY_INCLUDED_STMHAL_ADC_H diff --git a/stmhal/bufhelper.h b/stmhal/bufhelper.h index abdeea6a8..55f57be8e 100644 --- a/stmhal/bufhelper.h +++ b/stmhal/bufhelper.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_BUFHELPER_H +#define MICROPY_INCLUDED_STMHAL_BUFHELPER_H void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data); mp_obj_t pyb_buf_get_for_recv(mp_obj_t o, vstr_t *vstr); + +#endif // MICROPY_INCLUDED_STMHAL_BUFHELPER_H diff --git a/stmhal/can.h b/stmhal/can.h index 4d4b1bb83..7c40e9bf9 100644 --- a/stmhal/can.h +++ b/stmhal/can.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_CAN_H +#define MICROPY_INCLUDED_STMHAL_CAN_H #define PYB_CAN_1 (1) #define PYB_CAN_2 (2) @@ -32,3 +34,5 @@ extern const mp_obj_type_t pyb_can_type; void can_init0(void); void can_deinit(void); void can_rx_irq_handler(uint can_id, uint fifo_id); + +#endif // MICROPY_INCLUDED_STMHAL_CAN_H diff --git a/stmhal/dac.h b/stmhal/dac.h index ba44158f3..93192c0fe 100644 --- a/stmhal/dac.h +++ b/stmhal/dac.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_DAC_H +#define MICROPY_INCLUDED_STMHAL_DAC_H void dac_init(void); extern const mp_obj_type_t pyb_dac_type; + +#endif // MICROPY_INCLUDED_STMHAL_DAC_H diff --git a/stmhal/dma.h b/stmhal/dma.h index 57b8f866d..d8b11ca3a 100644 --- a/stmhal/dma.h +++ b/stmhal/dma.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_DMA_H__ -#define __MICROPY_INCLUDED_STMHAL_DMA_H__ +#ifndef MICROPY_INCLUDED_STMHAL_DMA_H +#define MICROPY_INCLUDED_STMHAL_DMA_H typedef struct _dma_descr_t dma_descr_t; @@ -101,4 +100,4 @@ void dma_deinit(const dma_descr_t *dma_descr); void dma_invalidate_channel(const dma_descr_t *dma_descr); void dma_idle_handler(int controller); -#endif //__MICROPY_INCLUDED_STMHAL_DMA_H__ +#endif // MICROPY_INCLUDED_STMHAL_DMA_H diff --git a/stmhal/extint.h b/stmhal/extint.h index b04224c40..0eae8942c 100644 --- a/stmhal/extint.h +++ b/stmhal/extint.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_EXTINT_H +#define MICROPY_INCLUDED_STMHAL_EXTINT_H // Vectors 0-15 are for regular pins // Vectors 16-22 are for internal sources. @@ -61,3 +63,5 @@ void extint_swint(uint line); void Handle_EXTI_Irq(uint32_t line); extern const mp_obj_type_t extint_type; + +#endif // MICROPY_INCLUDED_STMHAL_EXTINT_H diff --git a/stmhal/flash.h b/stmhal/flash.h index 007155ecb..c5b5bf352 100644 --- a/stmhal/flash.h +++ b/stmhal/flash.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_FLASH_H +#define MICROPY_INCLUDED_STMHAL_FLASH_H uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size); void flash_erase(uint32_t flash_dest, const uint32_t *src, uint32_t num_word32); void flash_write(uint32_t flash_dest, const uint32_t *src, uint32_t num_word32); + +#endif // MICROPY_INCLUDED_STMHAL_FLASH_H diff --git a/stmhal/font_petme128_8x8.h b/stmhal/font_petme128_8x8.h index 7f928edda..f27277760 100644 --- a/stmhal/font_petme128_8x8.h +++ b/stmhal/font_petme128_8x8.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_FONT_PETME128_8X8_H +#define MICROPY_INCLUDED_STMHAL_FONT_PETME128_8X8_H static const uint8_t font_petme128_8x8[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32= @@ -122,3 +124,5 @@ static const uint8_t font_petme128_8x8[] = { 0x00,0x02,0x03,0x01,0x03,0x02,0x03,0x01, // 126=~ 0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55, // 127 }; + +#endif // MICROPY_INCLUDED_STMHAL_FONT_PETME128_8X8_H diff --git a/stmhal/gccollect.h b/stmhal/gccollect.h index 07797be7e..2cb32a8d4 100644 --- a/stmhal/gccollect.h +++ b/stmhal/gccollect.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_GCCOLLECT_H +#define MICROPY_INCLUDED_STMHAL_GCCOLLECT_H // variables defining memory layout // (these probably belong somewhere else...) @@ -37,3 +39,5 @@ extern uint32_t _heap_start; extern uint32_t _heap_end; extern uint32_t _estack; extern uint32_t _ram_end; + +#endif // MICROPY_INCLUDED_STMHAL_GCCOLLECT_H diff --git a/stmhal/i2c.h b/stmhal/i2c.h index fc7a6f613..eda076e82 100644 --- a/stmhal/i2c.h +++ b/stmhal/i2c.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_I2C_H +#define MICROPY_INCLUDED_STMHAL_I2C_H #include "dma.h" @@ -49,3 +51,5 @@ void i2c_init_freq(const pyb_i2c_obj_t *self, mp_int_t freq); uint32_t i2c_get_baudrate(I2C_InitTypeDef *init); void i2c_ev_irq_handler(mp_uint_t i2c_id); void i2c_er_irq_handler(mp_uint_t i2c_id); + +#endif // MICROPY_INCLUDED_STMHAL_I2C_H diff --git a/stmhal/irq.h b/stmhal/irq.h index 35187520a..8d44b50ed 100644 --- a/stmhal/irq.h +++ b/stmhal/irq.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_STMHAL_IRQ_H #define MICROPY_INCLUDED_STMHAL_IRQ_H diff --git a/stmhal/lcd.h b/stmhal/lcd.h index 6a4b004bd..be4f6ed25 100644 --- a/stmhal/lcd.h +++ b/stmhal/lcd.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_LCD_H +#define MICROPY_INCLUDED_STMHAL_LCD_H extern const mp_obj_type_t pyb_lcd_type; + +#endif // MICROPY_INCLUDED_STMHAL_LCD_H diff --git a/stmhal/led.h b/stmhal/led.h index f4cd67336..fc9348181 100644 --- a/stmhal/led.h +++ b/stmhal/led.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_LED_H +#define MICROPY_INCLUDED_STMHAL_LED_H typedef enum { // PYBv3 @@ -48,3 +50,5 @@ void led_toggle(pyb_led_t led); void led_debug(int value, int delay); extern const mp_obj_type_t pyb_led_type; + +#endif // MICROPY_INCLUDED_STMHAL_LED_H diff --git a/stmhal/modmachine.h b/stmhal/modmachine.h index 164c5cfda..ac39f854e 100644 --- a/stmhal/modmachine.h +++ b/stmhal/modmachine.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_MODMACHINE_H__ -#define __MICROPY_INCLUDED_STMHAL_MODMACHINE_H__ +#ifndef MICROPY_INCLUDED_STMHAL_MODMACHINE_H +#define MICROPY_INCLUDED_STMHAL_MODMACHINE_H #include "py/mpstate.h" #include "py/nlr.h" @@ -41,4 +40,4 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_freq_obj); MP_DECLARE_CONST_FUN_OBJ_0(machine_sleep_obj); MP_DECLARE_CONST_FUN_OBJ_0(machine_deepsleep_obj); -#endif // __MICROPY_INCLUDED_STMHAL_MODMACHINE_H__ +#endif // MICROPY_INCLUDED_STMHAL_MODMACHINE_H diff --git a/stmhal/modnetwork.h b/stmhal/modnetwork.h index d3bc5674d..83e4255d5 100644 --- a/stmhal/modnetwork.h +++ b/stmhal/modnetwork.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_MODNETWORK_H +#define MICROPY_INCLUDED_STMHAL_MODNETWORK_H #define MOD_NETWORK_IPADDR_BUF_SIZE (4) @@ -77,3 +79,5 @@ extern const mod_network_nic_type_t mod_network_nic_type_cc3k; void mod_network_init(void); void mod_network_register_nic(mp_obj_t nic); mp_obj_t mod_network_find_nic(const uint8_t *ip); + +#endif // MICROPY_INCLUDED_STMHAL_MODNETWORK_H diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index d3ce11e02..a8ea2f02a 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -27,10 +27,6 @@ // Options to control how MicroPython is built for this port, // overriding defaults in py/mpconfig.h. -#pragma once -#ifndef __INCLUDED_MPCONFIGPORT_H -#define __INCLUDED_MPCONFIGPORT_H - // board specific definitions #include "mpconfigboard.h" @@ -350,5 +346,3 @@ static inline mp_uint_t disable_irq(void) { #include #define MICROPY_PIN_DEFS_PORT_H "pin_defs_stmhal.h" - -#endif // __INCLUDED_MPCONFIGPORT_H diff --git a/stmhal/mpthreadport.h b/stmhal/mpthreadport.h index 3d8b4ef01..8e2372dcb 100644 --- a/stmhal/mpthreadport.h +++ b/stmhal/mpthreadport.h @@ -23,8 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_STMHAL_MPTHREADPORT_H__ -#define __MICROPY_INCLUDED_STMHAL_MPTHREADPORT_H__ #include "py/mpthread.h" #include "pybthread.h" @@ -53,5 +51,3 @@ static inline int mp_thread_mutex_lock(mp_thread_mutex_t *m, int wait) { static inline void mp_thread_mutex_unlock(mp_thread_mutex_t *m) { pyb_mutex_unlock(m); } - -#endif // __MICROPY_INCLUDED_STMHAL_MPTHREADPORT_H__ diff --git a/stmhal/pendsv.h b/stmhal/pendsv.h index 77c78d4c1..b64e61386 100644 --- a/stmhal/pendsv.h +++ b/stmhal/pendsv.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_PENDSV_H +#define MICROPY_INCLUDED_STMHAL_PENDSV_H void pendsv_init(void); void pendsv_kbd_intr(void); @@ -30,3 +32,5 @@ void pendsv_kbd_intr(void); // since we play tricks with the stack, the compiler must not generate a // prelude for this function void pendsv_isr_handler(void) __attribute__((naked)); + +#endif // MICROPY_INCLUDED_STMHAL_PENDSV_H diff --git a/stmhal/pin.h b/stmhal/pin.h index a11b0a0f8..1ec4bd6b8 100644 --- a/stmhal/pin.h +++ b/stmhal/pin.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_PIN_H__ -#define __MICROPY_INCLUDED_STMHAL_PIN_H__ +#ifndef MICROPY_INCLUDED_STMHAL_PIN_H +#define MICROPY_INCLUDED_STMHAL_PIN_H // This file requires pin_defs_xxx.h (which has port specific enums and // defines, so we include it here. It should never be included directly @@ -98,4 +97,4 @@ const pin_af_obj_t *pin_find_af(const pin_obj_t *pin, uint8_t fn, uint8_t unit); const pin_af_obj_t *pin_find_af_by_index(const pin_obj_t *pin, mp_uint_t af_idx); const pin_af_obj_t *pin_find_af_by_name(const pin_obj_t *pin, const char *name); -#endif // __MICROPY_INCLUDED_STMHAL_PIN_H__ +#endif // MICROPY_INCLUDED_STMHAL_PIN_H diff --git a/stmhal/portmodules.h b/stmhal/portmodules.h index 0b460f38c..4e892da96 100644 --- a/stmhal/portmodules.h +++ b/stmhal/portmodules.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_PORTMODULES_H +#define MICROPY_INCLUDED_STMHAL_PORTMODULES_H extern const mp_obj_module_t pyb_module; extern const mp_obj_module_t stm_module; @@ -37,3 +39,5 @@ MP_DECLARE_CONST_FUN_OBJ_1(time_sleep_us_obj); MP_DECLARE_CONST_FUN_OBJ_0(mod_os_sync_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mod_os_dupterm_obj); + +#endif // MICROPY_INCLUDED_STMHAL_PORTMODULES_H diff --git a/stmhal/pybthread.h b/stmhal/pybthread.h index 6edb2400e..f628f934b 100644 --- a/stmhal/pybthread.h +++ b/stmhal/pybthread.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_STMHAL_PYBTHREAD_H #define MICROPY_INCLUDED_STMHAL_PYBTHREAD_H diff --git a/stmhal/rng.h b/stmhal/rng.h index ce1833e80..f022f3a67 100644 --- a/stmhal/rng.h +++ b/stmhal/rng.h @@ -23,8 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_RNG_H +#define MICROPY_INCLUDED_STMHAL_RNG_H void rng_init0(void); uint32_t rng_get(void); MP_DECLARE_CONST_FUN_OBJ_0(pyb_rng_get_obj); + +#endif // MICROPY_INCLUDED_STMHAL_RNG_H diff --git a/stmhal/rtc.h b/stmhal/rtc.h index 69d64c778..f382fa6b6 100644 --- a/stmhal/rtc.h +++ b/stmhal/rtc.h @@ -23,9 +23,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_RTC_H +#define MICROPY_INCLUDED_STMHAL_RTC_H extern RTC_HandleTypeDef RTCHandle; extern const mp_obj_type_t pyb_rtc_type; void rtc_init_start(bool force_init); void rtc_init_finalise(void); + +#endif // MICROPY_INCLUDED_STMHAL_RTC_H diff --git a/stmhal/sdcard.h b/stmhal/sdcard.h index 237e48d8b..d595f0f1a 100644 --- a/stmhal/sdcard.h +++ b/stmhal/sdcard.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SDCARD_H +#define MICROPY_INCLUDED_STMHAL_SDCARD_H // this is a fixed size and should not be changed #define SDCARD_BLOCK_SIZE (512) @@ -42,3 +44,5 @@ extern const struct _mp_obj_base_t pyb_sdcard_obj; struct _fs_user_mount_t; void sdcard_init_vfs(struct _fs_user_mount_t *vfs, int part); + +#endif // MICROPY_INCLUDED_STMHAL_SDCARD_H diff --git a/stmhal/servo.h b/stmhal/servo.h index 0fca8fea1..18fd493d5 100644 --- a/stmhal/servo.h +++ b/stmhal/servo.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SERVO_H +#define MICROPY_INCLUDED_STMHAL_SERVO_H void servo_init(void); void servo_timer_irq_callback(void); @@ -31,3 +33,5 @@ extern const mp_obj_type_t pyb_servo_type; MP_DECLARE_CONST_FUN_OBJ_2(pyb_servo_set_obj); MP_DECLARE_CONST_FUN_OBJ_2(pyb_pwm_set_obj); + +#endif // MICROPY_INCLUDED_STMHAL_SERVO_H diff --git a/stmhal/spi.h b/stmhal/spi.h index 5686bde64..e6752fdd1 100644 --- a/stmhal/spi.h +++ b/stmhal/spi.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SPI_H +#define MICROPY_INCLUDED_STMHAL_SPI_H extern SPI_HandleTypeDef SPIHandle1; extern SPI_HandleTypeDef SPIHandle2; @@ -37,3 +39,5 @@ extern const mp_obj_type_t machine_hard_spi_type; void spi_init0(void); void spi_init(SPI_HandleTypeDef *spi, bool enable_nss_pin); SPI_HandleTypeDef *spi_get_handle(mp_obj_t o); + +#endif // MICROPY_INCLUDED_STMHAL_SPI_H diff --git a/stmhal/stm32_it.h b/stmhal/stm32_it.h index a168cda83..d6ed1b2b9 100644 --- a/stmhal/stm32_it.h +++ b/stmhal/stm32_it.h @@ -25,6 +25,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_STM32_IT_H +#define MICROPY_INCLUDED_STMHAL_STM32_IT_H /** ****************************************************************************** @@ -80,3 +82,5 @@ void OTG_FS_IRQHandler(void); #ifdef USE_USB_HS void OTG_HS_IRQHandler(void); #endif + +#endif // MICROPY_INCLUDED_STMHAL_STM32_IT_H diff --git a/stmhal/storage.h b/stmhal/storage.h index 4d3de77ed..0ecb5715a 100644 --- a/stmhal/storage.h +++ b/stmhal/storage.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_STORAGE_H +#define MICROPY_INCLUDED_STMHAL_STORAGE_H #define FLASH_BLOCK_SIZE (512) @@ -45,3 +47,5 @@ extern const struct _mp_obj_type_t pyb_flash_type; struct _fs_user_mount_t; void pyb_flash_init_vfs(struct _fs_user_mount_t *vfs); + +#endif // MICROPY_INCLUDED_STMHAL_STORAGE_H diff --git a/stmhal/systick.h b/stmhal/systick.h index 1e7f62335..524afae40 100644 --- a/stmhal/systick.h +++ b/stmhal/systick.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SYSTICK_H +#define MICROPY_INCLUDED_STMHAL_SYSTICK_H void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms); bool sys_tick_has_passed(uint32_t stc, uint32_t delay_ms); + +#endif // MICROPY_INCLUDED_STMHAL_SYSTICK_H diff --git a/stmhal/timer.h b/stmhal/timer.h index a18d7cf10..72e461f2f 100644 --- a/stmhal/timer.h +++ b/stmhal/timer.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_TIMER_H +#define MICROPY_INCLUDED_STMHAL_TIMER_H extern TIM_HandleTypeDef TIM5_Handle; @@ -36,3 +38,5 @@ uint32_t timer_get_source_freq(uint32_t tim_id); void timer_irq_handler(uint tim_id); TIM_HandleTypeDef *pyb_timer_get_handle(mp_obj_t timer); + +#endif // MICROPY_INCLUDED_STMHAL_TIMER_H diff --git a/stmhal/uart.h b/stmhal/uart.h index 7fdc59de7..749530954 100644 --- a/stmhal/uart.h +++ b/stmhal/uart.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_UART_H +#define MICROPY_INCLUDED_STMHAL_UART_H typedef enum { PYB_UART_NONE = 0, @@ -47,3 +49,5 @@ mp_uint_t uart_rx_any(pyb_uart_obj_t *uart_obj); int uart_rx_char(pyb_uart_obj_t *uart_obj); void uart_tx_strn(pyb_uart_obj_t *uart_obj, const char *str, uint len); void uart_tx_strn_cooked(pyb_uart_obj_t *uart_obj, const char *str, uint len); + +#endif // MICROPY_INCLUDED_STMHAL_UART_H diff --git a/stmhal/usb.h b/stmhal/usb.h index 42e6c76f8..e04fe70d7 100644 --- a/stmhal/usb.h +++ b/stmhal/usb.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USB_H +#define MICROPY_INCLUDED_STMHAL_USB_H #include "usbd_cdc_msc_hid0.h" @@ -67,3 +69,5 @@ void usb_vcp_send_strn_cooked(const char *str, int len); void pyb_usb_host_init(void); void pyb_usb_host_process(void); uint pyb_usb_host_get_keyboard(void); + +#endif // MICROPY_INCLUDED_STMHAL_USB_H diff --git a/stmhal/usbd_cdc_interface.h b/stmhal/usbd_cdc_interface.h index d96861a7e..6f9a1e8a3 100644 --- a/stmhal/usbd_cdc_interface.h +++ b/stmhal/usbd_cdc_interface.h @@ -1,6 +1,8 @@ /* * This file is part of the Micro Python project, http://micropython.org/ */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H +#define MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H /** ****************************************************************************** @@ -39,3 +41,5 @@ void USBD_CDC_TxAlways(const uint8_t *buf, uint32_t len); int USBD_CDC_RxNum(void); int USBD_CDC_Rx(uint8_t *buf, uint32_t len, uint32_t timeout); + +#endif // MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H diff --git a/stmhal/usbd_desc.h b/stmhal/usbd_desc.h index 93e222fc9..f48e364e1 100644 --- a/stmhal/usbd_desc.h +++ b/stmhal/usbd_desc.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_DESC_H +#define MICROPY_INCLUDED_STMHAL_USBD_DESC_H extern const USBD_DescriptorsTypeDef USBD_Descriptors; void USBD_SetVIDPIDRelease(uint16_t vid, uint16_t pid, uint16_t device_release_num, int cdc_only); + +#endif // MICROPY_INCLUDED_STMHAL_USBD_DESC_H diff --git a/stmhal/usbd_hid_interface.h b/stmhal/usbd_hid_interface.h index fbc874796..b2ff75fa1 100644 --- a/stmhal/usbd_hid_interface.h +++ b/stmhal/usbd_hid_interface.h @@ -1,6 +1,8 @@ /* * This file is part of the MicroPython project, http://micropython.org/ */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_HID_INTERFACE_H +#define MICROPY_INCLUDED_STMHAL_USBD_HID_INTERFACE_H #include "usbd_cdc_msc_hid.h" @@ -8,3 +10,5 @@ extern const USBD_HID_ItfTypeDef USBD_HID_fops; int USBD_HID_RxNum(void); int USBD_HID_Rx(USBD_HandleTypeDef *pdev, uint8_t *buf, uint32_t len, uint32_t timeout); + +#endif // MICROPY_INCLUDED_STMHAL_USBD_HID_INTERFACE_H diff --git a/stmhal/usbd_msc_storage.h b/stmhal/usbd_msc_storage.h index 4a0d28ca8..a4bc8004a 100644 --- a/stmhal/usbd_msc_storage.h +++ b/stmhal/usbd_msc_storage.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_MSC_STORAGE_H +#define MICROPY_INCLUDED_STMHAL_USBD_MSC_STORAGE_H extern const USBD_StorageTypeDef USBD_FLASH_STORAGE_fops; extern const USBD_StorageTypeDef USBD_SDCARD_STORAGE_fops; + +#endif // MICROPY_INCLUDED_STMHAL_USBD_MSC_STORAGE_H diff --git a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h index bc9d0d21a..ec03c860a 100644 --- a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h +++ b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_USB_CDC_MSC_HID0_H__ -#define __MICROPY_INCLUDED_STMHAL_USB_CDC_MSC_HID0_H__ +#ifndef MICROPY_INCLUDED_STMHAL_USBDEV_CLASS_INC_USBD_CDC_MSC_HID0_H +#define MICROPY_INCLUDED_STMHAL_USBDEV_CLASS_INC_USBD_CDC_MSC_HID0_H // these are exports for the CDC/MSC/HID interface that are independent // from any other definitions/declarations @@ -49,4 +48,4 @@ typedef struct _USBD_HID_ModeInfoTypeDef { const uint8_t *report_desc; } USBD_HID_ModeInfoTypeDef; -#endif // __MICROPY_INCLUDED_STMHAL_USB_CDC_MSC_HID0_H__ +#endif // MICROPY_INCLUDED_STMHAL_USBDEV_CLASS_INC_USBD_CDC_MSC_HID0_H diff --git a/stmhal/usrsw.h b/stmhal/usrsw.h index b6dff2c43..9fbe6109d 100644 --- a/stmhal/usrsw.h +++ b/stmhal/usrsw.h @@ -23,8 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USRSW_H +#define MICROPY_INCLUDED_STMHAL_USRSW_H void switch_init0(void); int switch_get(void); extern const mp_obj_type_t pyb_switch_type; + +#endif // MICROPY_INCLUDED_STMHAL_USRSW_H diff --git a/stmhal/wdt.h b/stmhal/wdt.h index 362d6ef68..0a486f704 100644 --- a/stmhal/wdt.h +++ b/stmhal/wdt.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_WDT_H +#define MICROPY_INCLUDED_STMHAL_WDT_H extern const mp_obj_type_t pyb_wdt_type; + +#endif // MICROPY_INCLUDED_STMHAL_WDT_H diff --git a/teensy/hal_ftm.h b/teensy/hal_ftm.h index 3dc15300d..ad627358b 100644 --- a/teensy/hal_ftm.h +++ b/teensy/hal_ftm.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_TEENSY_HAL_FTM_H +#define MICROPY_INCLUDED_TEENSY_HAL_FTM_H #define FTM0 ((FTM_TypeDef *)&FTM0_SC) #define FTM1 ((FTM_TypeDef *)&FTM1_SC) @@ -181,4 +183,4 @@ void HAL_FTM_IC_Start(FTM_HandleTypeDef *hftm, uint32_t channel); void HAL_FTM_IC_Start_IT(FTM_HandleTypeDef *hftm, uint32_t channel); void HAL_FTM_IC_DeInit(FTM_HandleTypeDef *hftm); - +#endif // MICROPY_INCLUDED_TEENSY_HAL_FTM_H diff --git a/teensy/led.h b/teensy/led.h index 7f4ba18f2..5c45166ef 100644 --- a/teensy/led.h +++ b/teensy/led.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_LED_H +#define MICROPY_INCLUDED_TEENSY_LED_H + typedef enum { PYB_LED_BUILTIN = 1, } pyb_led_t; @@ -7,3 +10,5 @@ void led_state(pyb_led_t led, int state); void led_toggle(pyb_led_t led); extern const mp_obj_type_t pyb_led_type; + +#endif // MICROPY_INCLUDED_TEENSY_LED_H diff --git a/teensy/lexermemzip.h b/teensy/lexermemzip.h index e5d4be5ea..cd7326a43 100644 --- a/teensy/lexermemzip.h +++ b/teensy/lexermemzip.h @@ -1,2 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H +#define MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H + mp_lexer_t *mp_lexer_new_from_memzip_file(const char *filename); +#endif // MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H diff --git a/teensy/reg.h b/teensy/reg.h index 5d1d27443..0da6378ee 100644 --- a/teensy/reg.h +++ b/teensy/reg.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_REG_H +#define MICROPY_INCLUDED_TEENSY_REG_H + typedef struct { const char *name; mp_uint_t offset; @@ -6,3 +9,5 @@ typedef struct { #define REG_ENTRY(st, name) { #name, offsetof(st, name) } mp_obj_t reg_cmd(void *base, reg_t *reg, mp_uint_t num_reg, uint n_args, const mp_obj_t *args); + +#endif // MICROPY_INCLUDED_TEENSY_REG_H diff --git a/teensy/servo.h b/teensy/servo.h index 5f1c87b69..1ad34353d 100644 --- a/teensy/servo.h +++ b/teensy/servo.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_SERVO_H +#define MICROPY_INCLUDED_TEENSY_SERVO_H + void servo_init(void); extern const mp_obj_type_t pyb_servo_type; @@ -5,3 +8,4 @@ extern const mp_obj_type_t pyb_servo_type; MP_DECLARE_CONST_FUN_OBJ_2(pyb_servo_set_obj); MP_DECLARE_CONST_FUN_OBJ_2(pyb_pwm_set_obj); +#endif // MICROPY_INCLUDED_TEENSY_SERVO_H diff --git a/teensy/std.h b/teensy/std.h index 42791877a..ef55d22dd 100644 --- a/teensy/std.h +++ b/teensy/std.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_STD_H +#define MICROPY_INCLUDED_TEENSY_STD_H + typedef unsigned int size_t; void __assert_func(void); @@ -18,3 +21,5 @@ char *strcat(char *dest, const char *src); int printf(const char *fmt, ...); int snprintf(char *str, size_t size, const char *fmt, ...); + +#endif // MICROPY_INCLUDED_TEENSY_STD_H diff --git a/teensy/timer.h b/teensy/timer.h index bfa7636f4..89095b076 100644 --- a/teensy/timer.h +++ b/teensy/timer.h @@ -23,8 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_TEENSY_TIMER_H +#define MICROPY_INCLUDED_TEENSY_TIMER_H extern const mp_obj_type_t pyb_timer_type; void timer_init0(void); void timer_deinit(void); + +#endif // MICROPY_INCLUDED_TEENSY_TIMER_H diff --git a/teensy/usb.h b/teensy/usb.h index 949d7a59c..50fb3ff90 100644 --- a/teensy/usb.h +++ b/teensy/usb.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_USB_H +#define MICROPY_INCLUDED_TEENSY_USB_H + bool usb_vcp_is_connected(void); bool usb_vcp_is_enabled(void); int usb_vcp_rx_num(void); @@ -5,3 +8,5 @@ int usb_vcp_recv_byte(uint8_t *ptr); void usb_vcp_send_str(const char* str); void usb_vcp_send_strn(const char* str, int len); void usb_vcp_send_strn_cooked(const char *str, int len); + +#endif // MICROPY_INCLUDED_TEENSY_USB_H diff --git a/unix/fdfile.h b/unix/fdfile.h index 8e8e97c79..591159deb 100644 --- a/unix/fdfile.h +++ b/unix/fdfile.h @@ -24,12 +24,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_UNIX_FDFILE_H +#define MICROPY_INCLUDED_UNIX_FDFILE_H #include "py/obj.h" -#ifndef __MICROPY_INCLUDED_UNIX_FILE_H__ -#define __MICROPY_INCLUDED_UNIX_FILE_H__ - typedef struct _mp_obj_fdfile_t { mp_obj_base_t base; int fd; @@ -38,4 +37,4 @@ typedef struct _mp_obj_fdfile_t { extern const mp_obj_type_t mp_type_fileio; extern const mp_obj_type_t mp_type_textio; -#endif // __MICROPY_INCLUDED_UNIX_FILE_H__ +#endif // MICROPY_INCLUDED_UNIX_FDFILE_H diff --git a/unix/input.h b/unix/input.h index 7cbee33c5..a76b87e64 100644 --- a/unix/input.h +++ b/unix/input.h @@ -1,3 +1,8 @@ +#ifndef MICROPY_INCLUDED_UNIX_INPUT_H +#define MICROPY_INCLUDED_UNIX_INPUT_H + char *prompt(char *p); void prompt_read_history(void); void prompt_write_history(void); + +#endif // MICROPY_INCLUDED_UNIX_INPUT_H diff --git a/unix/mpthreadport.h b/unix/mpthreadport.h index 51cf8d786..b158ed5bc 100644 --- a/unix/mpthreadport.h +++ b/unix/mpthreadport.h @@ -23,8 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_UNIX_MPTHREADPORT_H__ -#define __MICROPY_INCLUDED_UNIX_MPTHREADPORT_H__ #include @@ -32,5 +30,3 @@ typedef pthread_mutex_t mp_thread_mutex_t; void mp_thread_init(void); void mp_thread_gc_others(void); - -#endif // __MICROPY_INCLUDED_UNIX_MPTHREADPORT_H__ diff --git a/windows/fmode.h b/windows/fmode.h index 23d6d3d54..c661c84d0 100644 --- a/windows/fmode.h +++ b/windows/fmode.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_WINDOWS_FMODE_H__ -#define __MICROPY_INCLUDED_WINDOWS_FMODE_H__ +#ifndef MICROPY_INCLUDED_WINDOWS_FMODE_H +#define MICROPY_INCLUDED_WINDOWS_FMODE_H // Treat files opened by open() as binary. No line ending translation is done. void set_fmode_binary(void); @@ -35,4 +34,4 @@ void set_fmode_binary(void); // When writing to the file \n will be converted into \r\n. void set_fmode_text(void); -#endif +#endif // MICROPY_INCLUDED_WINDOWS_FMODE_H diff --git a/windows/init.h b/windows/init.h index 69e577689..480befef6 100644 --- a/windows/init.h +++ b/windows/init.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_INIT_H +#define MICROPY_INCLUDED_WINDOWS_INIT_H void init(void); void deinit(void); + +#endif // MICROPY_INCLUDED_WINDOWS_INIT_H diff --git a/windows/msvc/dirent.h b/windows/msvc/dirent.h index 6172913ee..fca06785a 100644 --- a/windows/msvc/dirent.h +++ b/windows/msvc/dirent.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H +#define MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H // dirent.h implementation for msvc @@ -42,3 +44,5 @@ typedef struct dirent { DIR *opendir(const char *name); int closedir(DIR *dir); struct dirent *readdir(DIR *dir); + +#endif // MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H diff --git a/windows/msvc/sys/time.h b/windows/msvc/sys/time.h index 96bca1ccb..a36648beb 100644 --- a/windows/msvc/sys/time.h +++ b/windows/msvc/sys/time.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H +#define MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H // Get the definitions for timeval etc #include + +#endif // MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H diff --git a/windows/msvc/unistd.h b/windows/msvc/unistd.h index add10c884..87787c3d8 100644 --- a/windows/msvc/unistd.h +++ b/windows/msvc/unistd.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H +#define MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H // There's no unistd.h, but this is the equivalent #include @@ -38,3 +40,5 @@ #define SEEK_CUR 1 #define SEEK_END 2 #define SEEK_SET 0 + +#endif // MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H diff --git a/windows/realpath.h b/windows/realpath.h index 6f0a29a7e..c7bb3acd7 100644 --- a/windows/realpath.h +++ b/windows/realpath.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_REALPATH_H +#define MICROPY_INCLUDED_WINDOWS_REALPATH_H extern char *realpath(const char *path, char *resolved_path); + +#endif // MICROPY_INCLUDED_WINDOWS_REALPATH_H diff --git a/windows/sleep.h b/windows/sleep.h index 09ad4afdc..6c0c00332 100644 --- a/windows/sleep.h +++ b/windows/sleep.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_SLEEP_H +#define MICROPY_INCLUDED_WINDOWS_SLEEP_H void init_sleep(void); void deinit_sleep(void); @@ -30,3 +32,5 @@ void msec_sleep(double msec); #ifdef _MSC_VER int usleep(__int64 usec); #endif + +#endif // MICROPY_INCLUDED_WINDOWS_SLEEP_H diff --git a/zephyr/modmachine.h b/zephyr/modmachine.h index 596c59b17..84e4d10a8 100644 --- a/zephyr/modmachine.h +++ b/zephyr/modmachine.h @@ -1,5 +1,5 @@ -#ifndef __MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H__ -#define __MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H__ +#ifndef MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H +#define MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H #include "py/obj.h" @@ -13,4 +13,4 @@ typedef struct _machine_pin_obj_t { uint32_t pin; } machine_pin_obj_t; -#endif // __MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H__ +#endif // MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H From 016325dd0a5ad0904378004e728ccca19ee2b30d Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 18 Jul 2017 16:17:23 +1000 Subject: [PATCH 011/403] py/vm: Make n_state variable local to just set-up part of VM. It's not used anywhere else in the VM loop, and clashes with (is shadowed by) the n_state variable that's redeclared towards the end of the mp_execute_bytecode function. Code size is unchanged. --- py/vm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/py/vm.c b/py/vm.c index 7451d53b9..bb120e775 100644 --- a/py/vm.c +++ b/py/vm.c @@ -162,9 +162,13 @@ mp_vm_return_kind_t mp_execute_bytecode(mp_code_state_t *code_state, volatile mp run_code_state: ; #endif // Pointers which are constant for particular invocation of mp_execute_bytecode() - size_t n_state = mp_decode_uint_value(code_state->fun_bc->bytecode); - mp_obj_t * /*const*/ fastn = &code_state->state[n_state - 1]; - mp_exc_stack_t * /*const*/ exc_stack = (mp_exc_stack_t*)(code_state->state + n_state); + mp_obj_t * /*const*/ fastn; + mp_exc_stack_t * /*const*/ exc_stack; + { + size_t n_state = mp_decode_uint_value(code_state->fun_bc->bytecode); + fastn = &code_state->state[n_state - 1]; + exc_stack = (mp_exc_stack_t*)(code_state->state + n_state); + } // variables that are visible to the exception handler (declared volatile) volatile bool currently_in_except_block = MP_TAGPTR_TAG0(code_state->exc_sp); // 0 or 1, to detect nested exceptions From 3235b95f087751f54c5531e24033e802be199d7c Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 18 Jul 2017 17:30:23 +1000 Subject: [PATCH 012/403] py/asmx64: Support moving a 64-bit immediate to one of top 8 registers. If constants (eg mp_const_none_obj) are placed in very high memory locations that require 64-bits for the pointer then the assembler must be able to emit instructions to move such pointers to one of the top 8 registers (ie r8-r15). --- py/asmx64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/asmx64.c b/py/asmx64.c index cf1a86b3f..6775e8e93 100644 --- a/py/asmx64.c +++ b/py/asmx64.c @@ -344,8 +344,9 @@ STATIC void asm_x64_mov_i32_to_r64(asm_x64_t *as, int src_i32, int dest_r64) { void asm_x64_mov_i64_to_r64(asm_x64_t *as, int64_t src_i64, int dest_r64) { // cpu defaults to i32 to r64 // to mov i64 to r64 need to use REX prefix - assert(dest_r64 < 8); - asm_x64_write_byte_2(as, REX_PREFIX | REX_W, OPCODE_MOV_I64_TO_R64 | dest_r64); + asm_x64_write_byte_2(as, + REX_PREFIX | REX_W | (dest_r64 < 8 ? 0 : REX_B), + OPCODE_MOV_I64_TO_R64 | (dest_r64 & 7)); asm_x64_write_word64(as, src_i64); } From cadbd7f3e62488fb3c62cd35f53530e8fdb8cfea Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 18 Jul 2017 22:30:22 +1000 Subject: [PATCH 013/403] py/modmicropython: Cast stack_limit value so it prints correctly. Without this cast the print will give a wrong result on nan-boxing builds. --- py/modmicropython.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/modmicropython.c b/py/modmicropython.c index d76706230..46a3922e6 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -72,7 +72,8 @@ mp_obj_t mp_micropython_mem_info(size_t n_args, const mp_obj_t *args) { (mp_uint_t)m_get_total_bytes_allocated(), (mp_uint_t)m_get_current_bytes_allocated(), (mp_uint_t)m_get_peak_bytes_allocated()); #endif #if MICROPY_STACK_CHECK - mp_printf(&mp_plat_print, "stack: " UINT_FMT " out of " INT_FMT "\n", mp_stack_usage(), MP_STATE_THREAD(stack_limit)); + mp_printf(&mp_plat_print, "stack: " UINT_FMT " out of " UINT_FMT "\n", + mp_stack_usage(), (mp_uint_t)MP_STATE_THREAD(stack_limit)); #else mp_printf(&mp_plat_print, "stack: " UINT_FMT "\n", mp_stack_usage()); #endif From 2d775fb87f2a8a4ce7b8ea659c6709bbb1f4c797 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 18 Jul 2017 23:48:07 +1000 Subject: [PATCH 014/403] esp32: Update to latest ESP IDF. --- esp32/Makefile | 16 +++++++++++----- esp32/machine_uart.c | 4 ++-- esp32/sdkconfig.h | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index 9ab7af876..94db4a52d 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -29,7 +29,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 9b955f4c9f1b32652ea165d3e4cdaad01bba170e +ESPIDF_SUPHASH := 4ec2abbf23084ac060679e4136fa222a2d0ab0e8 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) @@ -55,10 +55,12 @@ INC += -I$(ESPCOMP)/driver/include/driver INC += -I$(ESPCOMP)/nghttp/port/include INC += -I$(ESPCOMP)/nghttp/nghttp2/lib/includes INC += -I$(ESPCOMP)/esp32/include +INC += -I$(ESPCOMP)/soc/include INC += -I$(ESPCOMP)/soc/esp32/include INC += -I$(ESPCOMP)/ethernet/include INC += -I$(ESPCOMP)/expat/include/expat INC += -I$(ESPCOMP)/expat/port/include +INC += -I$(ESPCOMP)/heap/include INC += -I$(ESPCOMP)/json/include INC += -I$(ESPCOMP)/json/port/include INC += -I$(ESPCOMP)/log/include @@ -219,7 +221,6 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\ gdbstub.o \ crosscore_int.o \ deep_sleep.o \ - heap_alloc_caps.o \ ipc.o \ int_wdt.o \ event_loop.o \ @@ -234,14 +235,20 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\ dport_access.o \ ) +ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\ + heap_caps.o \ + heap_caps_init.o \ + multi_heap.o \ + ) + ESPIDF_SOC_O = $(addprefix $(ESPCOMP)/soc/,\ - esp32/brownout.o \ esp32/cpu_util.o \ esp32/rtc_clk.o \ esp32/rtc_init.o \ esp32/rtc_pm.o \ esp32/rtc_sleep.o \ esp32/rtc_time.o \ + esp32/soc_memory_layout.o \ ) ESPIDF_CXX_O = $(addprefix $(ESPCOMP)/cxx/,\ @@ -277,8 +284,6 @@ ESPIDF_FREERTOS_O = $(addprefix $(ESPCOMP)/freertos/,\ croutine.o \ event_groups.o \ FreeRTOS-openocd.o \ - heap_regions_debug.o \ - heap_regions.o \ list.o \ portasm.o \ port.o \ @@ -539,6 +544,7 @@ OBJ_ESPIDF = OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_NEWLIB_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_DRIVER_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_ESP32_O)) +OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SOC_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_CXX_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_ETHERNET_O)) diff --git a/esp32/machine_uart.c b/esp32/machine_uart.c index fc6627788..16ed97405 100644 --- a/esp32/machine_uart.c +++ b/esp32/machine_uart.c @@ -237,8 +237,8 @@ STATIC mp_obj_t machine_uart_make_new(const mp_obj_type_t *type, size_t n_args, // Setup uart_param_config(self->uart_num, &uartcfg); - // RX and TX buffers are currently hardcoded at 256 and 64 bytes respectively. - uart_driver_install(uart_num, 256, 64, 10, &UART_QUEUE[self->uart_num], 0); + // RX and TX buffers are currently hardcoded at 256 bytes each (IDF minimum). + uart_driver_install(uart_num, 256, 256, 10, &UART_QUEUE[self->uart_num], 0); mp_map_t kw_args; mp_map_init_fixed_table(&kw_args, n_kw, args + n_args); diff --git a/esp32/sdkconfig.h b/esp32/sdkconfig.h index 19b1b7035..de8630e4f 100644 --- a/esp32/sdkconfig.h +++ b/esp32/sdkconfig.h @@ -51,6 +51,7 @@ #define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 1 #define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE 1 #define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 2 +#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1024 #define CONFIG_FREERTOS_ISR_STACKSIZE 1536 #define CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG 1 #define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16 @@ -58,6 +59,7 @@ #define CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK 1 #define CONFIG_MAIN_TASK_STACK_SIZE 4096 +#define CONFIG_IPC_TASK_STACK_SIZE 1024 #define CONFIG_BTC_TASK_STACK_SIZE 3072 #define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 4096 #define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32 From c972c60dbe72d7448faff7f631dfb798b694093e Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 19 Jul 2017 13:01:22 +1000 Subject: [PATCH 015/403] stmhal: Clean up USB CDC/MSC files and remove commented-out code. --- stmhal/usbd_cdc_interface.c | 79 +++++-------------------------------- stmhal/usbd_msc_storage.c | 48 ++-------------------- 2 files changed, 13 insertions(+), 114 deletions(-) diff --git a/stmhal/usbd_cdc_interface.c b/stmhal/usbd_cdc_interface.c index addcf8c85..3e107d418 100644 --- a/stmhal/usbd_cdc_interface.c +++ b/stmhal/usbd_cdc_interface.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Taken from ST Cube library and heavily modified. See below for original * copyright header. @@ -23,8 +23,8 @@ * * http://www.st.com/software_license_agreement_liberty_v2 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -102,52 +102,14 @@ const USBD_CDC_ItfTypeDef USBD_CDC_fops = { * @param None * @retval Result of the opeartion: USBD_OK if all operations are OK else USBD_FAIL */ -static int8_t CDC_Itf_Init(USBD_HandleTypeDef *pdev) -{ -#if 0 - /*##-1- Configure the UART peripheral ######################################*/ - /* Put the USART peripheral in the Asynchronous mode (UART Mode) */ - /* USART configured as follow: - - Word Length = 8 Bits - - Stop Bit = One Stop bit - - Parity = No parity - - BaudRate = 115200 baud - - Hardware flow control disabled (RTS and CTS signals) */ - UartHandle.Instance = USARTx; - UartHandle.Init.BaudRate = 115200; - UartHandle.Init.WordLength = UART_WORDLENGTH_8B; - UartHandle.Init.StopBits = UART_STOPBITS_1; - UartHandle.Init.Parity = UART_PARITY_NONE; - UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; - UartHandle.Init.Mode = UART_MODE_TX_RX; - - if(HAL_UART_Init(&UartHandle) != HAL_OK) - { - /* Initialization Error */ - Error_Handler(); - } - - /*##-2- Put UART peripheral in IT reception process ########################*/ - /* Any data received will be stored in "UserTxBuffer" buffer */ - if(HAL_UART_Receive_IT(&UartHandle, (uint8_t *)UserTxBuffer, 1) != HAL_OK) - { - /* Transfer error in reception process */ - Error_Handler(); - } - - /*##-3- Configure the TIM Base generation #################################*/ - now done in HAL_MspInit - TIM_Config(); -#endif - - /*##-5- Set Application Buffers ############################################*/ +static int8_t CDC_Itf_Init(USBD_HandleTypeDef *pdev) { USBD_CDC_SetTxBuffer(pdev, UserTxBuffer, 0); USBD_CDC_SetRxBuffer(pdev, cdc_rx_packet_buf); cdc_rx_buf_put = 0; cdc_rx_buf_get = 0; - - return (USBD_OK); + + return USBD_OK; } /** @@ -156,22 +118,14 @@ static int8_t CDC_Itf_Init(USBD_HandleTypeDef *pdev) * @param None * @retval Result of the opeartion: USBD_OK if all operations are OK else USBD_FAIL */ -static int8_t CDC_Itf_DeInit(void) -{ -#if 0 - /* DeInitialize the UART peripheral */ - if(HAL_UART_DeInit(&UartHandle) != HAL_OK) - { - /* Initialization Error */ - } -#endif - return (USBD_OK); +static int8_t CDC_Itf_DeInit(void) { + return USBD_OK; } /** * @brief CDC_Itf_Control * Manage the CDC class requests - * @param Cmd: Command code + * @param Cmd: Command code * @param Buf: Buffer containing command data (request parameters) * @param Len: Number of data to be sent (in bytes) * @retval Result of the opeartion: USBD_OK if all operations are OK else USBD_FAIL @@ -210,16 +164,6 @@ static int8_t CDC_Itf_Control(uint8_t cmd, uint8_t* pbuf, uint16_t length) { break; case CDC_GET_LINE_CODING: - #if 0 - pbuf[0] = (uint8_t)(LineCoding.bitrate); - pbuf[1] = (uint8_t)(LineCoding.bitrate >> 8); - pbuf[2] = (uint8_t)(LineCoding.bitrate >> 16); - pbuf[3] = (uint8_t)(LineCoding.bitrate >> 24); - pbuf[4] = LineCoding.format; - pbuf[5] = LineCoding.paritytype; - pbuf[6] = LineCoding.datatype; - #endif - /* Add your code here */ pbuf[0] = (uint8_t)(115200); pbuf[1] = (uint8_t)(115200 >> 8); @@ -318,11 +262,6 @@ void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) { * free to modify it. */ static int8_t CDC_Itf_Receive(USBD_HandleTypeDef *pdev, uint8_t* Buf, uint32_t *Len) { -#if 0 - // this sends the data over the UART using DMA - HAL_UART_Transmit_DMA(&UartHandle, Buf, *Len); -#endif - // copy the incoming data into the circular buffer for (uint8_t *src = Buf, *top = Buf + *Len; src < top; ++src) { if (mp_interrupt_char != -1 && *src == mp_interrupt_char) { diff --git a/stmhal/usbd_msc_storage.c b/stmhal/usbd_msc_storage.c index cec973741..f825c3d70 100644 --- a/stmhal/usbd_msc_storage.c +++ b/stmhal/usbd_msc_storage.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ /** @@ -20,13 +20,13 @@ * * http://www.st.com/software_license_agreement_liberty_v2 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * - * Heavily modified by dpgeorge for Micro Python. + * Heavily modified by dpgeorge for MicroPython. * ****************************************************************************** */ @@ -134,13 +134,6 @@ int8_t FLASH_STORAGE_PreventAllowMediumRemoval(uint8_t lun, uint8_t param) { */ int8_t FLASH_STORAGE_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len) { storage_read_blocks(buf, blk_addr, blk_len); - /* - for (int i = 0; i < blk_len; i++) { - if (!storage_read_block(buf + i * FLASH_BLOCK_SIZE, blk_addr + i)) { - return -1; - } - } - */ return 0; } @@ -154,13 +147,6 @@ int8_t FLASH_STORAGE_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t */ int8_t FLASH_STORAGE_Write (uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len) { storage_write_blocks(buf, blk_addr, blk_len); - /* - for (int i = 0; i < blk_len; i++) { - if (!storage_write_block(buf + i * FLASH_BLOCK_SIZE, blk_addr + i)) { - return -1; - } - } - */ return 0; } @@ -213,20 +199,6 @@ static const int8_t SDCARD_STORAGE_Inquirydata[] = { // 36 bytes * @retval Status */ int8_t SDCARD_STORAGE_Init(uint8_t lun) { - /* -#ifndef USE_STM3210C_EVAL - NVIC_InitTypeDef NVIC_InitStructure; - NVIC_InitStructure.NVIC_IRQChannel = SDIO_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority =0; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); -#endif - if( SD_Init() != 0) - { - return (-1); - } - */ if (!sdcard_power_on()) { return -1; } @@ -243,20 +215,8 @@ int8_t SDCARD_STORAGE_Init(uint8_t lun) { * @retval Status */ int8_t SDCARD_STORAGE_GetCapacity(uint8_t lun, uint32_t *block_num, uint16_t *block_size) { -/* -#ifdef USE_STM3210C_EVAL - SD_CardInfo SDCardInfo; - SD_GetCardInfo(&SDCardInfo); -#else - if(SD_GetStatus() != 0 ) { - return (-1); - } -#endif - */ - *block_size = SDCARD_BLOCK_SIZE; *block_num = sdcard_get_capacity_in_bytes() / SDCARD_BLOCK_SIZE; - return 0; } From 761e4c7ff62896c7d8f8c3dfc3cc98a4cc4f2f6f Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 19 Jul 2017 13:12:10 +1000 Subject: [PATCH 016/403] all: Remove trailing spaces, per coding conventions. --- .gitignore | 2 +- CODECONVENTIONS.md | 2 +- bare-arm/stm32f405.ld | 10 +++++----- esp8266/hspi_register.h | 2 +- examples/embedding/Makefile.upylib | 2 +- extmod/modubinascii.c | 2 +- minimal/stm32f405.ld | 4 ++-- mpy-cross/Makefile | 2 +- py/asmarm.c | 2 +- py/formatfloat.c | 16 ++++++++-------- py/mkrules.mk | 2 +- py/objtype.c | 2 +- py/runtime.c | 2 +- stmhal/boards/common.ld | 10 +++++----- stmhal/boards/stm32f401xd.ld | 2 +- stmhal/boards/stm32f401xe.ld | 2 +- stmhal/boards/stm32f405.ld | 2 +- stmhal/boards/stm32f411.ld | 4 ++-- stmhal/boards/stm32f429.ld | 6 +++--- stmhal/boards/stm32l476xe.ld | 4 ++-- stmhal/boards/stm32l476xg.ld | 4 ++-- stmhal/i2c.c | 2 +- stmhal/sdcard.c | 2 +- stmhal/timer.c | 2 +- stmhal/uart.c | 2 +- tests/README | 2 +- tools/codestats.sh | 6 +++--- windows/msvc/gettimeofday.c | 2 +- windows/sleep.c | 2 +- 29 files changed, 52 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index 280db388f..5e841a89c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ *.dis *.exe -# Packages +# Packages ############ # Logs and Databases diff --git a/CODECONVENTIONS.md b/CODECONVENTIONS.md index f9dce71dd..982b95831 100644 --- a/CODECONVENTIONS.md +++ b/CODECONVENTIONS.md @@ -73,7 +73,7 @@ White space: keyword and the opening parenthesis. - Put 1 space after a comma, and 1 space around operators. -Braces: +Braces: - Use braces for all blocks, even no-line and single-line pieces of code. - Put opening braces on the end of the line it belongs to, not on diff --git a/bare-arm/stm32f405.ld b/bare-arm/stm32f405.ld index 345a92d3c..dd688a024 100644 --- a/bare-arm/stm32f405.ld +++ b/bare-arm/stm32f405.ld @@ -11,7 +11,7 @@ MEMORY CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x010000 /* 64 KiB */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x020000 /* 128 KiB */ } - + /* top end of the stack */ _estack = ORIGIN(RAM) + LENGTH(RAM); @@ -30,7 +30,7 @@ SECTIONS . = ALIGN(4); } >FLASH_ISR - + /* The program code and other data goes into FLASH */ .text : { @@ -46,7 +46,7 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ _sidata = _etext; /* This is used by the startup in order to initialize the .data secion */ } >FLASH_TEXT - + /* .ARM.extab : { @@ -60,7 +60,7 @@ SECTIONS __exidx_end = .; } >FLASH */ - + /* This is the initialized data section The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH (inidata). @@ -76,7 +76,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ } >RAM - + /* Uninitialized data section */ .bss : { diff --git a/esp8266/hspi_register.h b/esp8266/hspi_register.h index 30a5ff588..4dd335b40 100644 --- a/esp8266/hspi_register.h +++ b/esp8266/hspi_register.h @@ -3,7 +3,7 @@ * Modified by David Ogilvy (MetalPhreak) * Based on original file included in SDK 1.0.0 * - * Missing defines from previous SDK versions have + * Missing defines from previous SDK versions have * been added and are noted with comments. The * names of these defines are likely to change. */ diff --git a/examples/embedding/Makefile.upylib b/examples/embedding/Makefile.upylib index 4663ad30a..bb48fd507 100644 --- a/examples/embedding/Makefile.upylib +++ b/examples/embedding/Makefile.upylib @@ -56,7 +56,7 @@ endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. # The unix port of micropython on OSX must be compiled with clang, -# while cross-compile ports require gcc, so we test here for OSX and +# while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) CC = clang diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index cf250d27f..4dda3c442 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -118,7 +118,7 @@ mp_obj_t mod_binascii_a2b_base64(mp_obj_t data) { vstr_init_len(&vstr, 0); } else { - vstr_init_len(&vstr, ((bufinfo.len / 4) * 3) - ((in[bufinfo.len-1] == '=') ? ((in[bufinfo.len-2] == '=') ? 2 : 1 ) : 0)); + vstr_init_len(&vstr, ((bufinfo.len / 4) * 3) - ((in[bufinfo.len-1] == '=') ? ((in[bufinfo.len-2] == '=') ? 2 : 1 ) : 0)); } byte *out = (byte*)vstr.buf; for (mp_uint_t i = bufinfo.len; i; i -= 4) { diff --git a/minimal/stm32f405.ld b/minimal/stm32f405.ld index b4aeda744..a202294a5 100644 --- a/minimal/stm32f405.ld +++ b/minimal/stm32f405.ld @@ -9,7 +9,7 @@ MEMORY CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x010000 /* 64 KiB */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x020000 /* 128 KiB */ } - + /* top end of the stack */ _estack = ORIGIN(RAM) + LENGTH(RAM); @@ -45,7 +45,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ } >RAM - + /* Uninitialized data section */ .bss : { diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile index f5b643c6c..c04adaf6a 100644 --- a/mpy-cross/Makefile +++ b/mpy-cross/Makefile @@ -45,7 +45,7 @@ endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. # The unix port of micropython on OSX must be compiled with clang, -# while cross-compile ports require gcc, so we test here for OSX and +# while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) CC = clang diff --git a/py/asmarm.c b/py/asmarm.c index da07680e3..ff22aba90 100644 --- a/py/asmarm.c +++ b/py/asmarm.c @@ -135,7 +135,7 @@ STATIC uint asm_arm_op_orr_reg(uint rd, uint rn, uint rm) { void asm_arm_bkpt(asm_arm_t *as) { // bkpt #0 - emit_al(as, 0x1200070); + emit_al(as, 0x1200070); } // locals: diff --git a/py/formatfloat.c b/py/formatfloat.c index ea5a07977..2f10d425a 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -161,7 +161,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch if (fmt == 'g' && prec == 0) { prec = 1; } - int e, e1; + int e, e1; int dec = 0; char e_sign = '\0'; int num_digits = 0; @@ -209,7 +209,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch e_sign_char = '+'; } } else if (fp_isless1(f)) { - e++; + e++; f *= FPCONST(10.0); } @@ -232,7 +232,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch num_digits = prec; if (num_digits) { - *s++ = '.'; + *s++ = '.'; while (--e && num_digits) { *s++ = '0'; num_digits--; @@ -266,7 +266,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch f *= FPCONST(0.1); } - // If the user specified fixed format (fmt == 'f') and e makes the + // If the user specified fixed format (fmt == 'f') and e makes the // number too big to fit into the available buffer, then we'll // switch to the 'e' format. @@ -327,7 +327,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch if (prec == 0) { prec = 1; } - num_digits = prec; + num_digits = prec; } // Print the digits of the mantissa @@ -365,7 +365,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch if (rs == buf) { break; } - rs--; + rs--; } if (*rs == '0') { // We need to insert a 1 @@ -380,13 +380,13 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch e_sign = '+'; } } else { - e++; + e++; } } else { // Need at extra digit at the end to make room for the leading '1' s++; } - char *ss = s; + char *ss = s; while (ss > rs) { *ss = ss[-1]; ss--; diff --git a/py/mkrules.mk b/py/mkrules.mk index 00ed27917..e66082001 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -6,7 +6,7 @@ endif # This file expects that OBJ contains a list of all of the object files. # The directory portion of each object file is used to locate the source -# and should not contain any ..'s but rather be relative to the top of the +# and should not contain any ..'s but rather be relative to the top of the # tree. # # So for example, py/map.c would have an object file name py/map.o diff --git a/py/objtype.c b/py/objtype.c index 2a119e40f..0c0826cf9 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -375,7 +375,7 @@ STATIC mp_obj_t instance_unary_op(mp_uint_t op, mp_obj_t self_in) { if (member[0] == MP_OBJ_NULL) { // https://docs.python.org/3/reference/datamodel.html#object.__hash__ // "User-defined classes have __eq__() and __hash__() methods by default; - // with them, all objects compare unequal (except with themselves) and + // with them, all objects compare unequal (except with themselves) and // x.__hash__() returns an appropriate value such that x == y implies // both that x is y and hash(x) == hash(y)." return MP_OBJ_NEW_SMALL_INT((mp_uint_t)self_in); diff --git a/py/runtime.c b/py/runtime.c index a8a1f73fa..ecc3ae2f5 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -127,7 +127,7 @@ void mp_deinit(void) { //mp_obj_dict_free(&dict_main); //mp_map_deinit(&MP_STATE_VM(mp_loaded_modules_map)); - // call port specific deinitialization if any + // call port specific deinitialization if any #ifdef MICROPY_PORT_INIT_FUNC MICROPY_PORT_DEINIT_FUNC; #endif diff --git a/stmhal/boards/common.ld b/stmhal/boards/common.ld index fcae1b4c6..e5dea49d0 100644 --- a/stmhal/boards/common.ld +++ b/stmhal/boards/common.ld @@ -27,7 +27,7 @@ SECTIONS . = ALIGN(4); } >FLASH_ISR - + /* The program code and other data goes into FLASH */ .text : { @@ -40,10 +40,10 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ } >FLASH_TEXT - + /* used by the startup to initialize data */ _sidata = LOADADDR(.data); - + /* This is the initialized data section The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH (inidata). @@ -51,13 +51,13 @@ SECTIONS .data : { . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ *(.data*) /* .data* sections */ . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ } >RAM AT> FLASH_TEXT - + /* Uninitialized data section */ .bss : { diff --git a/stmhal/boards/stm32f401xd.ld b/stmhal/boards/stm32f401xd.ld index 53aa83d53..415c25849 100644 --- a/stmhal/boards/stm32f401xd.ld +++ b/stmhal/boards/stm32f401xd.ld @@ -15,7 +15,7 @@ MEMORY /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; - + /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ diff --git a/stmhal/boards/stm32f401xe.ld b/stmhal/boards/stm32f401xe.ld index a91eee079..a2e693b49 100644 --- a/stmhal/boards/stm32f401xe.ld +++ b/stmhal/boards/stm32f401xe.ld @@ -15,7 +15,7 @@ MEMORY /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; - + /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ diff --git a/stmhal/boards/stm32f405.ld b/stmhal/boards/stm32f405.ld index 1a256c131..c6107913f 100644 --- a/stmhal/boards/stm32f405.ld +++ b/stmhal/boards/stm32f405.ld @@ -16,7 +16,7 @@ MEMORY /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; - + /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ diff --git a/stmhal/boards/stm32f411.ld b/stmhal/boards/stm32f411.ld index 0b7bcb553..d156e852a 100644 --- a/stmhal/boards/stm32f411.ld +++ b/stmhal/boards/stm32f411.ld @@ -11,11 +11,11 @@ MEMORY FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 0x060000 /* sectors 5,6,7 3*128KiB = 384 KiB */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x020000 /* 128 KiB */ } - + /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; - + /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ diff --git a/stmhal/boards/stm32f429.ld b/stmhal/boards/stm32f429.ld index 0feb5bd62..f358233a6 100644 --- a/stmhal/boards/stm32f429.ld +++ b/stmhal/boards/stm32f429.ld @@ -4,18 +4,18 @@ /* Specify the memory areas */ MEMORY -{ +{ FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x0200000 /* entire flash, 2048 KiB */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 0x0004000 /* sector 0, 16 KiB */ FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 0x0088000 /* sectors 5,6,7,8, 4*128KiB = 512 KiB (could increase it more) */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x0030000 /* 192 KiB */ SDRAM(xrw) : ORIGIN = 0xC0000000, LENGTH = 0x0800000 /* 8 MByte */ } - + /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; - + /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ diff --git a/stmhal/boards/stm32l476xe.ld b/stmhal/boards/stm32l476xe.ld index 114158d8c..bb9895d2a 100644 --- a/stmhal/boards/stm32l476xe.ld +++ b/stmhal/boards/stm32l476xe.ld @@ -4,7 +4,7 @@ /* Specify the memory areas */ MEMORY -{ +{ FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 0x0004000 /* sectors 0-7, 16 KiB */ FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 0x005C000 /* sectors 8-191, 368 KiB */ @@ -16,7 +16,7 @@ MEMORY /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; - + /* Define the top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ diff --git a/stmhal/boards/stm32l476xg.ld b/stmhal/boards/stm32l476xg.ld index b9c29d624..684078c43 100644 --- a/stmhal/boards/stm32l476xg.ld +++ b/stmhal/boards/stm32l476xg.ld @@ -4,7 +4,7 @@ /* Specify the memory areas */ MEMORY -{ +{ FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 0x0004000 /* sectors 0-7, 16 KiB */ FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 0x007C000 /* sectors 8-255, 496 KiB */ @@ -18,7 +18,7 @@ ENTRY(Reset_Handler) /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; - + /* Define the top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ diff --git a/stmhal/i2c.c b/stmhal/i2c.c index d0d877818..f77222715 100644 --- a/stmhal/i2c.c +++ b/stmhal/i2c.c @@ -283,7 +283,7 @@ void i2c_init(I2C_HandleTypeDef *i2c) { const pyb_i2c_obj_t *self = &pyb_i2c_obj[i2c_unit - 1]; dma_invalidate_channel(self->tx_dma_descr); dma_invalidate_channel(self->rx_dma_descr); - + if (0) { #if defined(MICROPY_HW_I2C1_SCL) } else if (i2c->Instance == I2C1) { diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c index c7ddbbde3..5260e0a50 100644 --- a/stmhal/sdcard.c +++ b/stmhal/sdcard.c @@ -216,7 +216,7 @@ void sdcard_power_off(void) { if (!sd_handle.Instance) { return; } - HAL_SD_DeInit(&sd_handle); + HAL_SD_DeInit(&sd_handle); sd_handle.Instance = NULL; } diff --git a/stmhal/timer.c b/stmhal/timer.c index 39f168fc8..6513f95d3 100644 --- a/stmhal/timer.c +++ b/stmhal/timer.c @@ -1149,7 +1149,7 @@ STATIC mp_obj_t pyb_timer_period(mp_uint_t n_args, const mp_obj_t *args) { // Reset the counter to zero. Otherwise, if counter >= period it will // continue counting until it wraps (at either 16 or 32 bits depending // on the timer). - __HAL_TIM_SetCounter(&self->tim, 0); + __HAL_TIM_SetCounter(&self->tim, 0); return mp_const_none; } } diff --git a/stmhal/uart.c b/stmhal/uart.c index 735c6f168..b4ff40e79 100644 --- a/stmhal/uart.c +++ b/stmhal/uart.c @@ -656,7 +656,7 @@ STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, mp_uint_t n_args, con self->read_buf_len = args.read_buf_len.u_int + 1; // +1 to adjust for usable length of buffer self->read_buf = m_new(byte, self->read_buf_len << self->char_width); __HAL_UART_ENABLE_IT(&self->uart, UART_IT_RXNE); - HAL_NVIC_SetPriority(self->irqn, IRQ_PRI_UART, IRQ_SUBPRI_UART); + HAL_NVIC_SetPriority(self->irqn, IRQ_PRI_UART, IRQ_SUBPRI_UART); HAL_NVIC_EnableIRQ(self->irqn); } diff --git a/tests/README b/tests/README index b028cd062..3458f36a8 100644 --- a/tests/README +++ b/tests/README @@ -13,6 +13,6 @@ condition a test. The run-tests script uses small scripts in the feature_check directory to check whether each such feature is present, and skips the relevant tests if not. -When creating new tests, anything that relies on float support should go in the +When creating new tests, anything that relies on float support should go in the float/ subdirectory. Anything that relies on import x, where x is not a built-in module, should go in the import/ subdirectory. diff --git a/tools/codestats.sh b/tools/codestats.sh index c868199e1..5272f3e9c 100755 --- a/tools/codestats.sh +++ b/tools/codestats.sh @@ -28,9 +28,9 @@ bin_stmhal=stmhal/build-PYBV10/firmware.elf bin_barearm_1=bare-arm/build/flash.elf bin_barearm_2=bare-arm/build/firmware.elf bin_minimal=minimal/build/firmware.elf -bin_cc3200_1=cc3200/build/LAUNCHXL/application.axf -bin_cc3200_2=cc3200/build/LAUNCHXL/release/application.axf -bin_cc3200_3=cc3200/build/WIPY/release/application.axf +bin_cc3200_1=cc3200/build/LAUNCHXL/application.axf +bin_cc3200_2=cc3200/build/LAUNCHXL/release/application.axf +bin_cc3200_3=cc3200/build/WIPY/release/application.axf # start at zero size; if build fails reuse previous valid size size_unix="0" diff --git a/windows/msvc/gettimeofday.c b/windows/msvc/gettimeofday.c index 363d59d7b..6d7264ae7 100644 --- a/windows/msvc/gettimeofday.c +++ b/windows/msvc/gettimeofday.c @@ -43,7 +43,7 @@ int gettimeofday(struct timeval *tp, struct timezone *tz) { // to microseconds ft.tm /= 10; - + // convert to unix format // number of microseconds intervals between the 1st january 1601 and the 1st january 1970 (369 years + 89 leap days) const unsigned __int64 deltaEpoch = 11644473600000000ull; diff --git a/windows/sleep.c b/windows/sleep.c index 214d6d622..b8f0a2e9b 100644 --- a/windows/sleep.c +++ b/windows/sleep.c @@ -31,7 +31,7 @@ HANDLE waitTimer = NULL; void init_sleep(void) { - waitTimer = CreateWaitableTimer(NULL, TRUE, NULL); + waitTimer = CreateWaitableTimer(NULL, TRUE, NULL); } void deinit_sleep(void) { From 46620061197e51d386c9eece6ef840d762ecad02 Mon Sep 17 00:00:00 2001 From: Alex Robbins Date: Thu, 6 Jul 2017 18:21:27 -0500 Subject: [PATCH 017/403] esp8266/mpconfigport.h: Make socket a weak link This way it can be overridden by a socket module in Python, as in other ports. --- esp8266/mpconfigport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h index f7df43577..ab5591bb7 100644 --- a/esp8266/mpconfigport.h +++ b/esp8266/mpconfigport.h @@ -162,7 +162,6 @@ extern const struct _mp_obj_module_t mp_module_onewire; #define MICROPY_PORT_BUILTIN_MODULES \ { MP_OBJ_NEW_QSTR(MP_QSTR_esp), (mp_obj_t)&esp_module }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&mp_module_lwip }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_lwip }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&network_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&utime_module }, \ @@ -176,6 +175,7 @@ extern const struct _mp_obj_module_t mp_module_onewire; { MP_OBJ_NEW_QSTR(MP_QSTR_json), (mp_obj_t)&mp_module_ujson }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_errno), (mp_obj_t)&mp_module_uerrno }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_select), (mp_obj_t)&mp_module_uselect }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&mp_module_lwip }, \ #define MP_STATE_PORT MP_STATE_VM From 4368ae31424f93f3272209ea61847f2406dd23ad Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 20 Jul 2017 00:20:53 +0300 Subject: [PATCH 018/403] extmod/modussl_axtls: Allow to close ssl stream multiple times. Make sure that 2nd close has no effect and operations on closed streams are handled properly. --- extmod/modussl_axtls.c | 22 +++++++++++++++++++--- tests/extmod/ussl_basic.py | 8 ++++++++ tests/extmod/ussl_basic.py.exp | 3 ++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index a27f0f1fe..a5ab8896c 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -102,6 +102,11 @@ STATIC void socket_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kin STATIC mp_uint_t socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errcode) { mp_obj_ssl_socket_t *o = MP_OBJ_TO_PTR(o_in); + if (o->ssl_sock == NULL) { + *errcode = EBADF; + return MP_STREAM_ERROR; + } + while (o->bytes_left == 0) { mp_int_t r = ssl_read(o->ssl_sock, &o->buf); if (r == SSL_OK) { @@ -131,6 +136,12 @@ STATIC mp_uint_t socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errc STATIC mp_uint_t socket_write(mp_obj_t o_in, const void *buf, mp_uint_t size, int *errcode) { mp_obj_ssl_socket_t *o = MP_OBJ_TO_PTR(o_in); + + if (o->ssl_sock == NULL) { + *errcode = EBADF; + return MP_STREAM_ERROR; + } + mp_int_t r = ssl_write(o->ssl_sock, buf, size); if (r < 0) { *errcode = r; @@ -151,9 +162,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking); STATIC mp_obj_t socket_close(mp_obj_t self_in) { mp_obj_ssl_socket_t *self = MP_OBJ_TO_PTR(self_in); - ssl_free(self->ssl_sock); - ssl_ctx_free(self->ssl_ctx); - return mp_stream_close(self->sock); + if (self->ssl_sock != NULL) { + ssl_free(self->ssl_sock); + ssl_ctx_free(self->ssl_ctx); + self->ssl_sock = NULL; + return mp_stream_close(self->sock); + } + + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_close_obj, socket_close); diff --git a/tests/extmod/ussl_basic.py b/tests/extmod/ussl_basic.py index 9f8019a0b..e8710ed51 100644 --- a/tests/extmod/ussl_basic.py +++ b/tests/extmod/ussl_basic.py @@ -43,6 +43,14 @@ # close ss.close() +# close 2nd time +ss.close() + +# read on closed socket +try: + ss.read(10) +except OSError as er: + print('read:', repr(er)) # write on closed socket try: diff --git a/tests/extmod/ussl_basic.py.exp b/tests/extmod/ussl_basic.py.exp index b4dd03860..cb9c51f7a 100644 --- a/tests/extmod/ussl_basic.py.exp +++ b/tests/extmod/ussl_basic.py.exp @@ -5,4 +5,5 @@ setblocking: NotImplementedError 4 b'' read: OSError(-261,) -write: OSError(-256,) +read: OSError(9,) +write: OSError(9,) From 6c1b7e008d48799c2324e8fa44acd9af365e62e2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 21 Jul 2017 15:11:24 +1000 Subject: [PATCH 019/403] tests: Rename exec1.py to builtin_exec.py. --- tests/basics/{exec1.py => builtin_exec.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/basics/{exec1.py => builtin_exec.py} (100%) diff --git a/tests/basics/exec1.py b/tests/basics/builtin_exec.py similarity index 100% rename from tests/basics/exec1.py rename to tests/basics/builtin_exec.py From bb3bddabb53e00965f9becba6df6af99c6c9bc77 Mon Sep 17 00:00:00 2001 From: Tom Collins Date: Tue, 11 Jul 2017 15:27:42 -0700 Subject: [PATCH 020/403] py/builtinevex: Add typechecking of globals/locals args to eval/exec. --- py/builtinevex.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/py/builtinevex.c b/py/builtinevex.c index d9a3833cc..4390d0cc7 100644 --- a/py/builtinevex.c +++ b/py/builtinevex.c @@ -113,12 +113,15 @@ STATIC mp_obj_t eval_exec_helper(size_t n_args, const mp_obj_t *args, mp_parse_i // work out the context mp_obj_dict_t *globals = mp_globals_get(); mp_obj_dict_t *locals = mp_locals_get(); - if (n_args > 1) { - globals = MP_OBJ_TO_PTR(args[1]); - if (n_args > 2) { - locals = MP_OBJ_TO_PTR(args[2]); - } else { - locals = globals; + for (size_t i = 1; i < 3 && i < n_args; ++i) { + if (args[i] != mp_const_none) { + if (!MP_OBJ_IS_TYPE(args[i], &mp_type_dict)) { + mp_raise_TypeError(NULL); + } + locals = MP_OBJ_TO_PTR(args[i]); + if (i == 1) { + globals = locals; + } } } From 6cfe73759707e410d48783303ada318658d21e02 Mon Sep 17 00:00:00 2001 From: Tom Collins Date: Tue, 11 Jul 2017 15:59:05 -0700 Subject: [PATCH 021/403] tests/basics/builtin_exec: Test various globals/locals args to exec(). --- tests/basics/builtin_exec.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/basics/builtin_exec.py b/tests/basics/builtin_exec.py index 59de5d69a..fd4e65c53 100644 --- a/tests/basics/builtin_exec.py +++ b/tests/basics/builtin_exec.py @@ -4,3 +4,29 @@ d = {} exec("def bar(): return 84", d) print(d["bar"]()) + +# passing None/dict as args to globals/locals +foo = 11 +exec('print(foo)') +exec('print(foo)', None) +exec('print(foo)', {'foo':3}, None) +exec('print(foo)', None, {'foo':3}) +exec('print(foo)', None, {'bar':3}) +exec('print(foo)', {'bar':3}, locals()) + +try: + exec('print(foo)', {'bar':3}, None) +except NameError: + print('NameError') + +# invalid arg passed to globals +try: + exec('print(1)', 'foo') +except TypeError: + print('TypeError') + +# invalid arg passed to locals +try: + exec('print(1)', None, 123) +except TypeError: + print('TypeError') From 8c9e22c12740477035bd5d78e43beeb6df598588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mali=C5=84ski?= Date: Wed, 19 Jul 2017 09:44:44 +0200 Subject: [PATCH 022/403] docs/pyboard/tutorial/amp_skin: Add example for playing large WAV files. --- docs/pyboard/tutorial/amp_skin.rst | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/pyboard/tutorial/amp_skin.rst b/docs/pyboard/tutorial/amp_skin.rst index 64f139bb7..697637f9d 100644 --- a/docs/pyboard/tutorial/amp_skin.rst +++ b/docs/pyboard/tutorial/amp_skin.rst @@ -69,4 +69,30 @@ Then you can do:: >>> f = wave.open('test.wav') >>> dac.write_timed(f.readframes(f.getnframes()), f.getframerate()) -This should play the WAV file. +This should play the WAV file. Note that this will read the whole file into RAM +so it has to be small enough to fit in it. + +To play larger wave files you will have to use the micro-SD card to store it. +Also the file must be read and sent to the DAC in small chunks that will fit +the RAM limit of the microcontroller. Here is an example function that can +play 8-bit wave files with up to 16kHz sampling:: + + import wave + from pyb import DAC + from pyb import delay + dac = DAC(1) + + def play(filename): + f = wave.open(filename, 'r') + total_frames = f.getnframes() + framerate = f.getframerate() + + for position in range(0, total_frames, framerate): + f.setpos(position) + dac.write_timed(f.readframes(framerate), framerate) + delay(1000) + +This function reads one second worth of data and sends it to DAC. It then waits +one second and moves the file cursor to the new position to read the next second +of data in the next iteration of the for-loop. It plays one second of audio at +a time every one second. From 6ede921731aaf6ab6c8bcbeb4e53a9ad04b2900b Mon Sep 17 00:00:00 2001 From: Peter Hinch Date: Wed, 19 Jul 2017 16:57:42 +0100 Subject: [PATCH 023/403] eps8266/general: Add known issue of WiFi RX buffers overflow. --- docs/esp8266/general.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/esp8266/general.rst b/docs/esp8266/general.rst index 6d186fcd2..68ed701be 100644 --- a/docs/esp8266/general.rst +++ b/docs/esp8266/general.rst @@ -122,3 +122,26 @@ Due to limitations of the ESP8266 chip the internal real-time clock (RTC) will overflow every 7:45h. If a long-term working RTC time is required then ``time()`` or ``localtime()`` must be called at least once within 7 hours. MicroPython will then handle the overflow. + +Sockets and WiFi buffers overflow +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Socket instances remain active until they are explicitly closed. This has two +consequences. Firstly they occupy RAM, so an application which opens sockets +without closing them may eventually run out of memory. Secondly not properly +closed socket can cause the low-level part of the vendor WiFi stack to emit +``Lmac`` errors. This occurs if data comes in for a socket and is not +processed in a timely manner. This can overflow the WiFi stack input queue +and lead to a deadlock. The only recovery is by a hard reset. + +The above may also happen after an application terminates and quits to the REPL +for any reason including an exception. Subsequent arrival of data provokes the +failure with the above error message repeatedly issued. So, sockets should be +closed in any case, regardless whether an application terminates successfully +or by an exeption, for example using try/finally:: + + sock = socket(...) + try: + # Use sock + finally: + s.close() From 205c368fa1e03e93af3b45ae08ac02f87ca866b5 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 21 Jul 2017 12:08:18 +0300 Subject: [PATCH 024/403] eps8266/general: Fix typo in recent example. --- docs/esp8266/general.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/esp8266/general.rst b/docs/esp8266/general.rst index 68ed701be..e23acb469 100644 --- a/docs/esp8266/general.rst +++ b/docs/esp8266/general.rst @@ -144,4 +144,4 @@ or by an exeption, for example using try/finally:: try: # Use sock finally: - s.close() + sock.close() From a6bec531771f2e2103148ed98dc96d4ce90e44e1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 19 Jul 2017 12:21:52 +1000 Subject: [PATCH 025/403] minimal/Makefile: Enable gc-sections to remove unused code. --- minimal/Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/minimal/Makefile b/minimal/Makefile index d61515797..994d26880 100644 --- a/minimal/Makefile +++ b/minimal/Makefile @@ -22,23 +22,21 @@ DFU = ../tools/dfu.py PYDFU = ../tools/pydfu.py CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT) +LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref --gc-sections else +LD = gcc CFLAGS = -m32 $(INC) -Wall -Werror -std=c99 $(COPT) +LDFLAGS = -m32 -Wl,-Map=$@.map,--cref -Wl,--gc-sections endif -#Debugging/Optimization +# Tune for Debugging or Optimization ifeq ($(DEBUG), 1) CFLAGS += -O0 -ggdb else CFLAGS += -Os -DNDEBUG +CFLAGS += -fdata-sections -ffunction-sections endif -ifeq ($(CROSS), 1) -LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref -else -LD = gcc -LDFLAGS = -m32 -Wl,-Map=$@.map,--cref -endif LIBS = SRC_C = \ From 71173cd57de9fc0a84c899e9f1d1e00c8910ade2 Mon Sep 17 00:00:00 2001 From: Alexander Steffen Date: Sat, 15 Jul 2017 11:39:05 +0200 Subject: [PATCH 026/403] cc3200: Use the name MicroPython consistently in code. In a few places the cc3200 port uses the incorrect spelling Micropython instead of MicroPython. --- cc3200/ftp/ftp.c | 2 +- cc3200/main.c | 2 +- cc3200/mptask.c | 2 +- cc3200/mptask.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cc3200/ftp/ftp.c b/cc3200/ftp/ftp.c index 1febe291f..b56e3f4ce 100644 --- a/cc3200/ftp/ftp.c +++ b/cc3200/ftp/ftp.c @@ -335,7 +335,7 @@ void ftp_run (void) { ftp_data.loggin.uservalid = false; ftp_data.loggin.passvalid = false; strcpy (ftp_path, "/"); - ftp_send_reply (220, "Micropython FTP Server"); + ftp_send_reply (220, "MicroPython FTP Server"); break; } } diff --git a/cc3200/main.c b/cc3200/main.c index 7c6c4b545..1ffb98188 100644 --- a/cc3200/main.c +++ b/cc3200/main.c @@ -89,7 +89,7 @@ int main (void) { #ifndef DEBUG OsiTaskHandle mpTaskHandle; #endif - mpTaskHandle = xTaskCreateStatic(TASK_Micropython, "MicroPy", + mpTaskHandle = xTaskCreateStatic(TASK_MicroPython, "MicroPy", MICROPY_TASK_STACK_LEN, NULL, MICROPY_TASK_PRIORITY, mpTaskStack, &mpTaskTCB); ASSERT(mpTaskHandle != NULL); diff --git a/cc3200/mptask.c b/cc3200/mptask.c index d446711a2..50c3c769d 100644 --- a/cc3200/mptask.c +++ b/cc3200/mptask.c @@ -112,7 +112,7 @@ static const char fresh_boot_py[] = "# boot.py -- run on boot-up\r\n" DECLARE PUBLIC FUNCTIONS ******************************************************************************/ -void TASK_Micropython (void *pvParameters) { +void TASK_MicroPython (void *pvParameters) { // get the top of the stack to initialize the garbage collector uint32_t sp = gc_helper_get_sp(); diff --git a/cc3200/mptask.h b/cc3200/mptask.h index 9276cfc3e..5345ecfda 100644 --- a/cc3200/mptask.h +++ b/cc3200/mptask.h @@ -41,6 +41,6 @@ extern StackType_t mpTaskStack[]; /****************************************************************************** DECLARE PUBLIC FUNCTIONS ******************************************************************************/ -extern void TASK_Micropython (void *pvParameters); +extern void TASK_MicroPython (void *pvParameters); #endif // MICROPY_INCLUDED_CC3200_MPTASK_H From 41e50eb157e33f4c7b5b1527f7f47530db91f8ce Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 22 Jul 2017 12:28:06 +0200 Subject: [PATCH 027/403] Type of setup.state is u8 --- esp32/modules/setup.py | 6 +++--- esp32/modules/splash.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esp32/modules/setup.py b/esp32/modules/setup.py index f3bc6a005..afafdf771 100644 --- a/esp32/modules/setup.py +++ b/esp32/modules/setup.py @@ -11,7 +11,7 @@ def store_settings(nickname): def is_developer(nickname): if (nickname==""): - badge.nvs_set_str('badge', 'setup.state', '2') # Skip the sponsors + badge.nvs_set_u8('badge', 'setup.state', 2) # Skip the sponsors return True return False @@ -20,11 +20,11 @@ def action_home(pressed): appglue.start_app("") def set_setup_state(): - s_old = int(badge.nvs_get_str('badge', 'setup.state', '0')) + s_old = badge.nvs_get_u8('badge', 'setup.state', 0) s_new = 2 if (s_old==0): s_new = 1 - badge.nvs_set_str('badge', 'setup.state', str(s_new)) + badge.nvs_set_u8('badge', 'setup.state', s_new) def draw_setup_completed(): ugfx.clear(ugfx.WHITE) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 8c48bf5c7..3926f50aa 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -421,13 +421,13 @@ def check_ota_available(): # WELCOME (SETUP, SPONSORS OR CLOCK) def welcome(): - setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) + setupcompleted = badge.nvs_get_u8('badge', 'setup.state', 0) if (setupcompleted==0): # First boot (open setup) print("[SPLASH] Setup not completed. Running setup!") appglue.start_app("setup") elif (setupcompleted==1): # Second boot (after setup) print("[SPLASH] Showing sponsors once...") - badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once + badge.nvs_set_u8('badge', 'setup.state', 2) # Only force show sponsors once appglue.start_app("sponsors") else: # Setup completed print("[SPLASH] Normal boot.") From 64951c56d4fcaa812d706a2d0d7aa08418216b04 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 22 Jul 2017 12:37:56 +0200 Subject: [PATCH 028/403] reverting 41e50eb157e33f4c7b5b1527f7f47530db91f8ce It causes crashes.. --- esp32/modules/setup.py | 6 +++--- esp32/modules/splash.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esp32/modules/setup.py b/esp32/modules/setup.py index afafdf771..f3bc6a005 100644 --- a/esp32/modules/setup.py +++ b/esp32/modules/setup.py @@ -11,7 +11,7 @@ def store_settings(nickname): def is_developer(nickname): if (nickname==""): - badge.nvs_set_u8('badge', 'setup.state', 2) # Skip the sponsors + badge.nvs_set_str('badge', 'setup.state', '2') # Skip the sponsors return True return False @@ -20,11 +20,11 @@ def action_home(pressed): appglue.start_app("") def set_setup_state(): - s_old = badge.nvs_get_u8('badge', 'setup.state', 0) + s_old = int(badge.nvs_get_str('badge', 'setup.state', '0')) s_new = 2 if (s_old==0): s_new = 1 - badge.nvs_set_u8('badge', 'setup.state', s_new) + badge.nvs_set_str('badge', 'setup.state', str(s_new)) def draw_setup_completed(): ugfx.clear(ugfx.WHITE) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 3926f50aa..8c48bf5c7 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -421,13 +421,13 @@ def check_ota_available(): # WELCOME (SETUP, SPONSORS OR CLOCK) def welcome(): - setupcompleted = badge.nvs_get_u8('badge', 'setup.state', 0) + setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) if (setupcompleted==0): # First boot (open setup) print("[SPLASH] Setup not completed. Running setup!") appglue.start_app("setup") elif (setupcompleted==1): # Second boot (after setup) print("[SPLASH] Showing sponsors once...") - badge.nvs_set_u8('badge', 'setup.state', 2) # Only force show sponsors once + badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once appglue.start_app("sponsors") else: # Setup completed print("[SPLASH] Normal boot.") From 7901741bf192cb239bb6b5f76464432852bc8e25 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 22 Jul 2017 17:12:15 +0300 Subject: [PATCH 029/403] tools/pyboard: Add license header. --- tools/pyboard.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/pyboard.py b/tools/pyboard.py index 921ffc52d..d15f520ac 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -1,4 +1,28 @@ #!/usr/bin/env python +# +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# Copyright (c) 2014-2016 Damien P. George +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. """ pyboard interface From 736dd2405f83cc8f1f38bb29008de4006a8039de Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Sat, 22 Jul 2017 17:26:23 +0200 Subject: [PATCH 030/403] corrected version use --- esp32/modules/launcher.py | 5 ++--- esp32/modules/version.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index a81339128..2efbac822 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -5,8 +5,7 @@ import time import esp import appglue - -version = "Gouden Ganzeveer" +import version ugfx.init() ugfx.input_init() @@ -29,7 +28,7 @@ cursor_pos = line_end+5 ugfx.line(cursor_pos, 46, cursor_pos, 66, ugfx.BLACK) -ugfx.string_box(148,110,148,18, version,"Roboto_Regular12",ugfx.BLACK, ugfx.justifyLeft) +ugfx.string_box(148,110,148,18, version.name,"Roboto_Regular12",ugfx.BLACK, ugfx.justifyLeft) ugfx.flush() options = None install_path = None diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 326ce2db8..42e7c9e63 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 0 -name = "Eenzame Eenhoorn" +build = 1 +name = "Snorrende Snor" From c5ca01a24c557878faa90648aad1ece1729fc66e Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 22 Jul 2017 17:31:22 +0200 Subject: [PATCH 031/403] Change lipo voltages and timer interval --- esp32/modules/splash.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 8c48bf5c7..7001bd7c5 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -462,9 +462,9 @@ def load_settings(): #if (sleep_duration>120): # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") global battery_volt_min - battery_volt_min = badge.nvs_get_u16('splash', 'battery.volt.min', 3800) # mV + battery_volt_min = badge.nvs_get_u16('splash', 'battery.volt.min', 3700) # mV global battery_volt_max - battery_volt_max = badge.nvs_get_u16('splash', 'battery.volt.max', 4300) # mV + battery_volt_max = badge.nvs_get_u16('splash', 'battery.volt.max', 4200) # mV global battery_percent_empty battery_percent_empty = badge.nvs_get_u8('splash', 'battery.percent.empty', 1) # % global ntp_timeout @@ -472,9 +472,9 @@ def load_settings(): global bpp_after_count bpp_after_count = badge.nvs_get_u8('splash', 'bpp.count', 5) global splash_timer_interval - splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 500) + splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 200) global timer_loop_amount - timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 10) + timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) # MAIN def splash_main(): From bea51fcff2e3d10eee618ff873ef03291888bfc7 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Sat, 22 Jul 2017 17:37:21 +0200 Subject: [PATCH 032/403] Boekenwuurm --- esp32/modules/magic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/magic.py b/esp32/modules/magic.py index 647a07b62..7bd5ce5a2 100644 --- a/esp32/modules/magic.py +++ b/esp32/modules/magic.py @@ -1,6 +1,6 @@ import ugfx, appglue, hashlib, ubinascii, time, uos -names = ["Niek Blankers", "Sebastian Oort", "Bas van Sisseren", "Jeroen Domburg", "Gavan Fantom", "Markus Bechtold", "Thomas Roos", "Anne Jan Brouwer", "Renze Nicolai", "Aram Verstegen", "Arnout Engelen", "Alexandre Dulaunoy", " Eric Poulsen", "Damien P. George"] +names = ["Niek Blankers", "Sebastian Oort", "Bas van Sisseren", "Jeroen Domburg", "Christel Sanders", "Markus Bechtold", "Thomas Roos", "Anne Jan Brouwer", "Renze Nicolai", "Aram Verstegen", "Arnout Engelen", "Alexandre Dulaunoy", " Eric Poulsen", "Damien P. George"] def action_exit(pushed): if (pushed): From 1adceca7c33f4cd495388ef8eded8c51209eccae Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 22 Jul 2017 17:46:00 +0200 Subject: [PATCH 033/403] Fix countdown for sleep timer --- esp32/modules/splash.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 7001bd7c5..3429526da 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -312,6 +312,7 @@ def badge_sleep_forever(): def splashTimer_callback(tmr): global loopCnt global timer_loop_amount + #print("[TIMER] "+str(loopCnt)) if loopCnt<1: loopCnt = timer_loop_amount cstate = badge.battery_charge_status() @@ -475,6 +476,8 @@ def load_settings(): splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 200) global timer_loop_amount timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) + global loopCnt + loopCnt = timer_loop_amount # MAIN def splash_main(): @@ -508,7 +511,7 @@ def splash_main(): # GLOBALS (With defaults that will probably never be used) splashTimer = machine.Timer(0) services = [] -timer_loop_amount = 10 +timer_loop_amount = 9999 loopCnt = timer_loop_amount header_fg = ugfx.BLACK header_bg = ugfx.WHITE From 13740c00ad0aaa53abcb70ae443cd0ac9e0fc9f8 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 22 Jul 2017 17:55:22 +0200 Subject: [PATCH 034/403] Reset countdown on interaction --- esp32/modules/splash.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 3429526da..9ac18179a 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -277,7 +277,12 @@ def start_ota(pushed): if(pushed): print("[SPLASH] Starting OTA...") appglue.start_ota() - + +# NOTHING +def nothing(pressed): + if (pressed): + reset_countdown() + # MAGIC def actually_start_magic(): print("[SPLASH] Starting magic...") @@ -286,6 +291,7 @@ def actually_start_magic(): magic = 0 def start_magic(pushed): + reset_countdown() global magic if(pushed): magic = magic + 1 @@ -312,7 +318,7 @@ def badge_sleep_forever(): def splashTimer_callback(tmr): global loopCnt global timer_loop_amount - #print("[TIMER] "+str(loopCnt)) + print("[TIMER] "+str(loopCnt)) if loopCnt<1: loopCnt = timer_loop_amount cstate = badge.battery_charge_status() @@ -338,6 +344,11 @@ def splashTimer_callback(tmr): if (loop_services(loopCnt)): loopCnt = timer_loop_amount loopCnt = loopCnt - 1 + +def reset_countdown(): + global loopCnt + global timer_loop_amount + loopCnt = timer_loop_amount def start_sleep_counter(): global splashTimer @@ -497,6 +508,12 @@ def splash_main(): welcome() ugfx.input_attach(ugfx.BTN_START, start_launcher) ugfx.input_attach(ugfx.BTN_A, start_magic) + ugfx.input_attach(ugfx.BTN_B, nothing) + ugfx.input_attach(ugfx.BTN_SELECT, nothing) + ugfx.input_attach(ugfx.JOY_UP, nothing) + ugfx.input_attach(ugfx.JOY_DOWN, nothing) + ugfx.input_attach(ugfx.JOY_LEFT, nothing) + ugfx.input_attach(ugfx.JOY_RIGHT, nothing) global splashTimer setup_services() start_sleep_counter() @@ -527,7 +544,7 @@ def splash_main(): splash_timer_interval = 500 update_available = False -update_name = "BIG FAT ERROR" +update_name = "????" update_build = 0 splash_main() From f6cabfebd6d02a1c3e12f269c0055e5ed3f3cd54 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 22 Jul 2017 17:55:58 +0200 Subject: [PATCH 035/403] Remove verbose debugging message --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 9ac18179a..7df5280e7 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -318,7 +318,7 @@ def badge_sleep_forever(): def splashTimer_callback(tmr): global loopCnt global timer_loop_amount - print("[TIMER] "+str(loopCnt)) + #print("[TIMER] "+str(loopCnt)) if loopCnt<1: loopCnt = timer_loop_amount cstate = badge.battery_charge_status() From 337dbc075cb7002dcf4ab444a120949750e18bd2 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Sun, 23 Jul 2017 10:47:06 +0200 Subject: [PATCH 036/403] Up uPy heap size to 80k --- esp32/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/main.c b/esp32/main.c index f5bcac72f..c7e8dbbd3 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -62,7 +62,7 @@ #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1) #define MP_TASK_STACK_SIZE ( 8 * 1024) #define MP_TASK_STACK_LEN (MP_TASK_STACK_SIZE / sizeof(StackType_t)) -#define MP_TASK_HEAP_SIZE (64 * 1024) +#define MP_TASK_HEAP_SIZE (80 * 1024) STATIC StaticTask_t mp_task_tcb; STATIC StackType_t mp_task_stack[MP_TASK_STACK_LEN] __attribute__((aligned (8))); From 09be7ffc6a60e47ea8f9a0548017fda15e3a6ec5 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 11:08:39 +0200 Subject: [PATCH 037/403] report tls error messages instead of crashing. --- extmod/modussl_mbedtls.c | 80 +++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 13 deletions(-) diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index f74cdade3..a3f16a04c 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -33,6 +33,8 @@ #include #include +#include + #include "py/nlr.h" #include "py/runtime.h" #include "py/stream.h" @@ -46,9 +48,12 @@ #include "mbedtls/entropy.h" #include "mbedtls/ctr_drbg.h" #include "mbedtls/debug.h" +#include "mbedtls/error.h" #include "wildcard_sha2017_org.h" +#define TAG "modussl_mbedtls.c" + typedef struct _mp_obj_ssl_socket_t { mp_obj_base_t base; mp_obj_t sock; @@ -86,6 +91,11 @@ int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) { if (mp_is_nonblocking_error(err)) { return MBEDTLS_ERR_SSL_WANT_WRITE; } + + char errstr[256]; + mbedtls_strerror(err, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "sock_stream->write(): error %d: %s", -err, errstr); + return -err; } return out_sz; @@ -102,6 +112,11 @@ int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) { if (mp_is_nonblocking_error(err)) { return MBEDTLS_ERR_SSL_WANT_READ; } + + char errstr[256]; + mbedtls_strerror(err, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "sock_stream->read(): error %d: %s", -err, errstr); + return -err; } return out_sz; @@ -139,8 +154,11 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { mbedtls_entropy_init(&o->entropy); ret = mbedtls_ctr_drbg_seed(&o->ctr_drbg, mbedtls_entropy_func, &o->entropy, NULL, 0); if (ret != 0) { - printf("ret=%d\n", ret); - assert(0); + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_ctr_drbg_seed(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); } bool sha2017_subdomain = false; @@ -158,8 +176,11 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { if (sha2017_subdomain) { ret = mbedtls_x509_crt_parse_der(&o->cacert, wildcard_sha2017_org, 856); if(ret < 0) { - printf("mbedtls_x509_crt_parse returned -0x%x\n\n", -ret); - assert(0); + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_x509_crt_parse_der(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); } } @@ -168,7 +189,11 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT); if (ret != 0) { - assert(0); + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_ssl_config_defaults(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); } if (sha2017_subdomain) { @@ -182,14 +207,22 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { ret = mbedtls_ssl_setup(&o->ssl, &o->conf); if (ret != 0) { - assert(0); + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_ssl_setup(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); } if (args->server_hostname.u_obj != mp_const_none) { const char *sni = mp_obj_str_get_str(args->server_hostname.u_obj); ret = mbedtls_ssl_set_hostname(&o->ssl, sni); if (ret != 0) { - assert(0); + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_ssl_set_hostname(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); } } @@ -203,25 +236,46 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { const byte *key = (const byte*)mp_obj_str_get_data(args->key.u_obj, &key_len); // len should include terminating null ret = mbedtls_pk_parse_key(&o->pkey, key, key_len + 1, NULL, 0); - assert(ret == 0); + if (ret != 0) { + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_pk_parse_key(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); + } size_t cert_len; const byte *cert = (const byte*)mp_obj_str_get_data(args->cert.u_obj, &cert_len); // len should include terminating null ret = mbedtls_x509_crt_parse(&o->cert, cert, cert_len + 1); - assert(ret == 0); + if (ret != 0) { + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_x509_crt_parse(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); + } ret = mbedtls_ssl_conf_own_cert(&o->conf, &o->cert, &o->pkey); - assert(ret == 0); + if (ret != 0) { + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_ssl_conf_own_cert(): error %d: %s", -ret, errstr); + + mp_raise_OSError(MP_EIO); + } } if (args->server_side.u_bool) { - assert(0); + ESP_LOGW(TAG, "args->server_side.u_bool set"); + mp_raise_OSError(MP_EIO); } else { while ((ret = mbedtls_ssl_handshake(&o->ssl)) != 0) { if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { - //assert(0); - printf("mbedtls_ssl_handshake error: -%x\n", -ret); + char errstr[256]; + mbedtls_strerror(ret, errstr, sizeof(errstr)); + ESP_LOGW(TAG, "mbedtls_ssl_handshake(): error %d: %s", -ret, errstr); + mp_raise_OSError(MP_EIO); } } From 2788866039b8dbf129b0d2a26d4679f1ad304fd9 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Sun, 23 Jul 2017 11:19:08 +0200 Subject: [PATCH 038/403] Fix input in installer --- esp32/modules/installer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 9fdd49fe3..a360a2571 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -61,20 +61,22 @@ def start_app(pushed): selected = packages[options.selected_index()]["slug"] appglue.start_app(selected) +def start_launcher(pushed): + if(pushed): + appglue.start_app('launcher') + ugfx.input_init() window = ugfx.Container(0, 0, ugfx.width(), ugfx.height()) ugfx.input_attach(ugfx.JOY_UP, show_description) ugfx.input_attach(ugfx.JOY_DOWN, show_description) + ugfx.input_attach(ugfx.BTN_A, woezel_it) -ugfx.input_attach(ugfx.BTN_B, woezel_it) +ugfx.input_attach(ugfx.BTN_B, start_launcher) ugfx.input_attach(ugfx.BTN_START, start_app) -ugfx.input_attach(ugfx.JOY_LEFT, lambda pushed: ugfx.flush() if pushed else 0) -ugfx.input_attach(ugfx.JOY_RIGHT, lambda pushed: ugfx.flush() if pushed else 0) - text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) ugfx.set_lut(ugfx.LUT_FULL) From fc7aba8481f1247109fcc32369920d8f9172eae9 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 11:39:14 +0200 Subject: [PATCH 039/403] Simple esp_log replacement to support the ESP_LOGx() log-messages. --- unix/esp_log.c | 25 +++++++++++++++++++ unix/esp_log.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 unix/esp_log.c create mode 100644 unix/esp_log.h diff --git a/unix/esp_log.c b/unix/esp_log.c new file mode 100644 index 000000000..9adc86719 --- /dev/null +++ b/unix/esp_log.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include "esp_log.h" + +uint32_t +esp_log_timestamp(void) +{ + static time_t t_first = 0; + if (t_first) { + t_first = time(NULL); + return 0; + } + return time(NULL) - t_first; +} + +void +esp_log_write(esp_log_level_t level, const char* tag, const char* format, ...) +{ + va_list ap; + va_start(ap, format); + vprintf(format, ap); + va_end(ap); +} diff --git a/unix/esp_log.h b/unix/esp_log.h new file mode 100644 index 000000000..8fe325416 --- /dev/null +++ b/unix/esp_log.h @@ -0,0 +1,67 @@ +#ifndef ESP_LOG_H +#define ESP_LOG_H + +/* based on Espressif's esp-idf code */ + +#include +#include +#include "sdkconfig.h" + +typedef enum { + ESP_LOG_NONE, + ESP_LOG_ERROR, + ESP_LOG_WARN, + ESP_LOG_INFO, + ESP_LOG_DEBUG, + ESP_LOG_VERBOSE +} esp_log_level_t; + +uint32_t esp_log_timestamp(void); + +void esp_log_write(esp_log_level_t level, const char* tag, const char* format, ...) __attribute__ ((format (printf, 3, 4))); + + +#if CONFIG_LOG_COLORS +#define LOG_COLOR_BLACK "30" +#define LOG_COLOR_RED "31" +#define LOG_COLOR_GREEN "32" +#define LOG_COLOR_BROWN "33" +#define LOG_COLOR_BLUE "34" +#define LOG_COLOR_PURPLE "35" +#define LOG_COLOR_CYAN "36" +#define LOG_COLOR(COLOR) "\033[0;" COLOR "m" +#define LOG_BOLD(COLOR) "\033[1;" COLOR "m" +#define LOG_RESET_COLOR "\033[0m" +#define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED) +#define LOG_COLOR_W LOG_COLOR(LOG_COLOR_BROWN) +#define LOG_COLOR_I LOG_COLOR(LOG_COLOR_GREEN) +#define LOG_COLOR_D +#define LOG_COLOR_V +#else //CONFIG_LOG_COLORS +#define LOG_COLOR_E +#define LOG_COLOR_W +#define LOG_COLOR_I +#define LOG_COLOR_D +#define LOG_COLOR_V +#define LOG_RESET_COLOR +#endif //CONFIG_LOG_COLORS + +#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%d) %s: " format LOG_RESET_COLOR "\n" + +#ifndef LOG_LOCAL_LEVEL +#define LOG_LOCAL_LEVEL ((esp_log_level_t) CONFIG_LOG_DEFAULT_LEVEL) +#endif + +#define ESP_EARLY_LOGE( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { ets_printf(LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_EARLY_LOGW( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_WARN) { ets_printf(LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_EARLY_LOGI( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { ets_printf(LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_EARLY_LOGD( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_DEBUG) { ets_printf(LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_EARLY_LOGV( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_VERBOSE) { ets_printf(LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } + +#define ESP_LOGE( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_LOGW( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_WARN) { esp_log_write(ESP_LOG_WARN, tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_LOGI( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_LOGD( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_DEBUG) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } +#define ESP_LOGV( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_VERBOSE) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } + +#endif // ESP_LOG_H From 47c4063b33504ac79b5e4965ea9c67e2388d3d05 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 11:53:20 +0200 Subject: [PATCH 040/403] add esp_log.c to Makefile --- unix/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/unix/Makefile b/unix/Makefile index 7f66a221a..3659fd481 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -176,6 +176,7 @@ SRC_C = \ alloc.c \ coverage.c \ fatfs_port.c \ + esp_log.c \ $(SRC_MOD) OPT_GFXDRIVER = SDL From b45e4d19f8a5d164c0c7688389599fc67c3ba7d2 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 13:10:16 +0200 Subject: [PATCH 041/403] code cleanup of the badge.nvs_* code. (fixes issue #93) --- esp32/modbadge.c | 117 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 83 insertions(+), 34 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 121899034..a013fb68e 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -28,6 +28,8 @@ * THE SOFTWARE. */ +#include + #include "modbadge.h" #include "py/mperrno.h" @@ -42,13 +44,28 @@ STATIC mp_obj_t badge_init_() { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_init_obj, badge_init_); -// NVS +/*** nvs access ***/ + +/* nvs: strings */ +static void _nvs_check_namespace_key(const char *namespace, const char *key) { + if (strlen(namespace) == 0 || strlen(namespace) > 15) { + mp_raise_msg(&mp_type_AttributeError, "Invalid namespace"); + } + if (strlen(key) == 0 || strlen(key) > 15) { + mp_raise_msg(&mp_type_AttributeError, "Invalid key"); + } +} STATIC mp_obj_t badge_nvs_get_str_(mp_uint_t n_args, const mp_obj_t *args) { - mp_uint_t len; - const char *namespace = mp_obj_str_get_data(args[0], &len); - const char *key = mp_obj_str_get_data(args[1], &len); - char value[256]; // TODO wut? + const char *namespace = mp_obj_str_get_str(args[0]); + const char *key = mp_obj_str_get_str(args[1]); + _nvs_check_namespace_key(namespace, key); + + // current max string length in esp-idf is 1984 bytes, but that + // would abuse our stack too much. we only allow strings with a + // max length of 255 chars. + char value[256]; + size_t length = sizeof(value); esp_err_t err = badge_nvs_get_str(namespace, key, value, &length); if (err != ESP_OK) { @@ -57,71 +74,103 @@ STATIC mp_obj_t badge_nvs_get_str_(mp_uint_t n_args, const mp_obj_t *args) { } return mp_const_none; } + return mp_obj_new_str(value, length-1, false); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_nvs_get_str_obj, 2, 3, badge_nvs_get_str_); -STATIC mp_obj_t badge_nvs_set_str_(mp_obj_t namespace, mp_obj_t key, mp_obj_t value) { - esp_err_t err = badge_nvs_set_str(mp_obj_str_get_str(namespace), mp_obj_str_get_str(key), mp_obj_str_get_str(value)); - if (err != ESP_OK) { - mp_raise_msg(&mp_type_ValueError, "TODO error things"); +STATIC mp_obj_t badge_nvs_set_str_(mp_obj_t _namespace, mp_obj_t _key, mp_obj_t _value) { + const char *namespace = mp_obj_str_get_str(_namespace); + const char *key = mp_obj_str_get_str(_key); + const char *value = mp_obj_str_get_str(_value); + _nvs_check_namespace_key(namespace, key); + if (strlen(value) > 255) { + mp_raise_msg(&mp_type_AttributeError, "Value string too long"); } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_str_obj, badge_nvs_set_str_); -STATIC mp_obj_t badge_nvs_set_u8_(mp_obj_t namespace, mp_obj_t key, mp_obj_t value) { - uint8_t u8value = mp_obj_get_int(value); - esp_err_t err = badge_nvs_set_u8(mp_obj_str_get_str(namespace), mp_obj_str_get_str(key), u8value); + esp_err_t err = badge_nvs_set_str(namespace, key, value); if (err != ESP_OK) { - mp_raise_msg(&mp_type_ValueError, "TODO error things"); + mp_raise_msg(&mp_type_ValueError, "Failed to store data in nvs"); } + return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u8_obj, badge_nvs_set_u8_); +STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_str_obj, badge_nvs_set_str_); +/* nvs: u8 */ STATIC mp_obj_t badge_nvs_get_u8_(mp_uint_t n_args, const mp_obj_t *args) { - mp_uint_t len; - const char *namespace = mp_obj_str_get_data(args[0], &len); - const char *key = mp_obj_str_get_data(args[1], &len); - uint8_t u8value = mp_obj_get_int(args[2]); - esp_err_t err = badge_nvs_get_u8(namespace, key, &u8value); + const char *namespace = mp_obj_str_get_str(args[0]); + const char *key = mp_obj_str_get_str(args[1]); + _nvs_check_namespace_key(namespace, key); + + uint8_t value = 0; + esp_err_t err = badge_nvs_get_u8(namespace, key, &value); if (err != ESP_OK) { if (n_args > 2) { return args[2]; } return mp_const_none; } - return mp_obj_new_int(u8value); + + return mp_obj_new_int(value); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_nvs_get_u8_obj, 2, 3, badge_nvs_get_u8_); -STATIC mp_obj_t badge_nvs_set_u16_(mp_obj_t namespace, mp_obj_t key, mp_obj_t value) { - uint16_t u16value = mp_obj_get_int(value); - esp_err_t err = badge_nvs_set_u16(mp_obj_str_get_str(namespace), mp_obj_str_get_str(key), u16value); +STATIC mp_obj_t badge_nvs_set_u8_(mp_obj_t _namespace, mp_obj_t _key, mp_obj_t _value) { + const char *namespace = mp_obj_str_get_str(_namespace); + const char *key = mp_obj_str_get_str(_key); + int value = mp_obj_get_int(_value); + _nvs_check_namespace_key(namespace, key); + if (value < 0 || value > 255) { + mp_raise_msg(&mp_type_AttributeError, "Value out of range"); + } + + esp_err_t err = badge_nvs_set_u8(namespace, key, value); if (err != ESP_OK) { - mp_raise_msg(&mp_type_ValueError, "TODO error things"); + mp_raise_msg(&mp_type_ValueError, "Failed to store data in nvs"); } + return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); +STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u8_obj, badge_nvs_set_u8_); +/* nvs: u16 */ STATIC mp_obj_t badge_nvs_get_u16_(mp_uint_t n_args, const mp_obj_t *args) { - mp_uint_t len; - const char *namespace = mp_obj_str_get_data(args[0], &len); - const char *key = mp_obj_str_get_data(args[1], &len); - uint16_t u16value = mp_obj_get_int(args[2]); - esp_err_t err = badge_nvs_get_u16(namespace, key, &u16value); + const char *namespace = mp_obj_str_get_str(args[0]); + const char *key = mp_obj_str_get_str(args[1]); + _nvs_check_namespace_key(namespace, key); + + uint16_t value = 0; + esp_err_t err = badge_nvs_get_u16(namespace, key, &value); if (err != ESP_OK) { if (n_args > 2) { return args[2]; } return mp_const_none; } - return mp_obj_new_int(u16value); + + return mp_obj_new_int(value); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_nvs_get_u16_obj, 2, 3, badge_nvs_get_u16_); +STATIC mp_obj_t badge_nvs_set_u16_(mp_obj_t _namespace, mp_obj_t _key, mp_obj_t _value) { + const char *namespace = mp_obj_str_get_str(_namespace); + const char *key = mp_obj_str_get_str(_key); + int value = mp_obj_get_int(_value); + _nvs_check_namespace_key(namespace, key); + if (value < 0 || value > 65535) { + mp_raise_msg(&mp_type_AttributeError, "Value out of range"); + } + + esp_err_t err = badge_nvs_set_u16(namespace, key, value); + if (err != ESP_OK) { + mp_raise_msg(&mp_type_ValueError, "Failed to store data in nvs"); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); + // EINK From a7867cd647a2aff9cbfc3768a3a4c5c3fd763d91 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 13:15:11 +0200 Subject: [PATCH 042/403] shorten some keys. nvs doesn't support keys longer than 15 chars. battery.volt.min -> bat.volt.min battery.volt.max -> bat.volt.max battery.percent.empty -> bat.perc.empty --- esp32/modules/splash.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 7df5280e7..f6bb467ae 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -474,11 +474,11 @@ def load_settings(): #if (sleep_duration>120): # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") global battery_volt_min - battery_volt_min = badge.nvs_get_u16('splash', 'battery.volt.min', 3700) # mV + battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3700) # mV global battery_volt_max - battery_volt_max = badge.nvs_get_u16('splash', 'battery.volt.max', 4200) # mV + battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV global battery_percent_empty - battery_percent_empty = badge.nvs_get_u8('splash', 'battery.percent.empty', 1) # % + battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 1) # % global ntp_timeout ntp_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries global bpp_after_count From 77448852b1d7132bb6d3ea5c99e2edf6ef80865c Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 22 Jul 2017 20:06:57 +0200 Subject: [PATCH 043/403] Stuff --- esp32/modules/launcher.py | 6 ++++++ esp32/modules/splash.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 2efbac822..25d9b1911 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -66,6 +66,10 @@ def expandhome(s): s = s.replace("~/", h + "/") return s +def gohome(pressed): + if(pressed): + appglue.home() + def get_install_path(): global install_path if install_path is None: @@ -107,6 +111,8 @@ def perform_uninstall(ok): ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) +ugfx.input_attach(ugfx.BTN_START, gohome) + ugfx.set_lut(ugfx.LUT_FULL) ugfx.flush() ugfx.set_lut(ugfx.LUT_FASTER) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index f6bb467ae..07e898d8f 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -319,6 +319,8 @@ def splashTimer_callback(tmr): global loopCnt global timer_loop_amount #print("[TIMER] "+str(loopCnt)) + #print("[BATTERY] "+str(badge.battery_volt_sense())+" ["+str(badge.battery_charge_status())+"]") + if loopCnt<1: loopCnt = timer_loop_amount cstate = badge.battery_charge_status() @@ -384,7 +386,6 @@ def wifi_connect(): return True # CHECK OTA VERSION - def download_ota_info(): import gc import urequests as requests From f3afed735c0d0a6b7fcbfaecd172221951a95bc1 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 23 Jul 2017 13:12:46 +0200 Subject: [PATCH 044/403] setup.state as u8 --- esp32/modules/setup.py | 6 +++--- esp32/modules/splash.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esp32/modules/setup.py b/esp32/modules/setup.py index f3bc6a005..afafdf771 100644 --- a/esp32/modules/setup.py +++ b/esp32/modules/setup.py @@ -11,7 +11,7 @@ def store_settings(nickname): def is_developer(nickname): if (nickname==""): - badge.nvs_set_str('badge', 'setup.state', '2') # Skip the sponsors + badge.nvs_set_u8('badge', 'setup.state', 2) # Skip the sponsors return True return False @@ -20,11 +20,11 @@ def action_home(pressed): appglue.start_app("") def set_setup_state(): - s_old = int(badge.nvs_get_str('badge', 'setup.state', '0')) + s_old = badge.nvs_get_u8('badge', 'setup.state', 0) s_new = 2 if (s_old==0): s_new = 1 - badge.nvs_set_str('badge', 'setup.state', str(s_new)) + badge.nvs_set_u8('badge', 'setup.state', s_new) def draw_setup_completed(): ugfx.clear(ugfx.WHITE) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 07e898d8f..686f23f0f 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -434,13 +434,13 @@ def check_ota_available(): # WELCOME (SETUP, SPONSORS OR CLOCK) def welcome(): - setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) + setupcompleted = badge.nvs_get_u8('badge', 'setup.state', 0) if (setupcompleted==0): # First boot (open setup) print("[SPLASH] Setup not completed. Running setup!") appglue.start_app("setup") elif (setupcompleted==1): # Second boot (after setup) print("[SPLASH] Showing sponsors once...") - badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once + badge.nvs_set_u8('badge', 'setup.state', 2) # Only force show sponsors once appglue.start_app("sponsors") else: # Setup completed print("[SPLASH] Normal boot.") From f41d9394c6a3269d227b793eb5f282a256595dfd Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 23 Jul 2017 13:16:02 +0200 Subject: [PATCH 045/403] Make keys shorter --- esp32/modules/splash.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 686f23f0f..ab6582269 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -475,19 +475,19 @@ def load_settings(): #if (sleep_duration>120): # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") global battery_volt_min - battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3700) # mV + battery_volt_min = badge.nvs_get_u16('splash', 'batt.vmin', 3700) # mV global battery_volt_max - battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV + battery_volt_max = badge.nvs_get_u16('splash', 'batt.vmax', 4200) # mV global battery_percent_empty - battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 1) # % + battery_percent_empty = badge.nvs_get_u8('splash', 'batt.pempty', 1) # % global ntp_timeout ntp_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries global bpp_after_count bpp_after_count = badge.nvs_get_u8('splash', 'bpp.count', 5) global splash_timer_interval - splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 200) + splash_timer_interval = badge.nvs_get_u16('splash', 'tmr.interval', 200) global timer_loop_amount - timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) + timer_loop_amount = badge.nvs_get_u8('splash', 'tmr.amount', 25) global loopCnt loopCnt = timer_loop_amount From 3acf9be9376e2a4a0fcd7e60659a1e9d2c2f8110 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 13:34:12 +0200 Subject: [PATCH 046/403] fix whitespace --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index ab6582269..212fc98c9 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -320,7 +320,7 @@ def splashTimer_callback(tmr): global timer_loop_amount #print("[TIMER] "+str(loopCnt)) #print("[BATTERY] "+str(badge.battery_volt_sense())+" ["+str(badge.battery_charge_status())+"]") - + if loopCnt<1: loopCnt = timer_loop_amount cstate = badge.battery_charge_status() From 3abd66095937bad388274b72b1c6f27d5d6773f7 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 15:06:37 +0200 Subject: [PATCH 047/403] expose badge.nvs_erase_key() --- esp32/modbadge.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index a013fb68e..3d5b0d246 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -45,8 +45,6 @@ STATIC mp_obj_t badge_init_() { STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_init_obj, badge_init_); /*** nvs access ***/ - -/* nvs: strings */ static void _nvs_check_namespace_key(const char *namespace, const char *key) { if (strlen(namespace) == 0 || strlen(namespace) > 15) { mp_raise_msg(&mp_type_AttributeError, "Invalid namespace"); @@ -56,6 +54,20 @@ static void _nvs_check_namespace_key(const char *namespace, const char *key) { } } +STATIC mp_obj_t badge_nvs_erase_key_(mp_obj_t _namespace, mp_obj_t _key) { + const char *namespace = mp_obj_str_get_str(_namespace); + const char *key = mp_obj_str_get_str(_key); + _nvs_check_namespace_key(namespace, key); + + esp_err_t err = badge_nvs_erase_key(namespace, key); + if (err != ESP_OK) { + mp_raise_msg(&mp_type_ValueError, "Failed to store data in nvs"); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(badge_nvs_erase_key_obj, badge_nvs_erase_key_); +/* nvs: strings */ STATIC mp_obj_t badge_nvs_get_str_(mp_uint_t n_args, const mp_obj_t *args) { const char *namespace = mp_obj_str_get_str(args[0]); const char *key = mp_obj_str_get_str(args[1]); @@ -339,6 +351,7 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_eink_init), MP_ROM_PTR(&badge_eink_init_obj)}, {MP_OBJ_NEW_QSTR(MP_QSTR_power_init), (mp_obj_t)&badge_power_init_obj}, + {MP_ROM_QSTR(MP_QSTR_nvs_erase_key), MP_ROM_PTR(&badge_nvs_erase_key_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_get_str), MP_ROM_PTR(&badge_nvs_get_str_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_set_str), MP_ROM_PTR(&badge_nvs_set_str_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_get_u8), MP_ROM_PTR(&badge_nvs_get_u8_obj)}, From bd620204f2aca1d54e2cb26f2a33c460d43a739c Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Sun, 23 Jul 2017 17:08:07 +0200 Subject: [PATCH 048/403] First step refractoring splash --- esp32/modules/splash.py | 344 ++++++++++++++++++---------------------- 1 file changed, 152 insertions(+), 192 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index f6bb467ae..b50302027 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,4 +1,4 @@ -import ugfx, time, badge, machine, uos, appglue, deepsleep, network, esp +import ugfx, time, badge, machine, uos, appglue, deepsleep, network, esp, gc # SHA2017 badge home screen # Renze Nicolai 2017 @@ -9,13 +9,13 @@ def get_reboot_counter(): def set_reboot_counter(value): esp.rtcmem_write(1023, value) - + def increment_reboot_counter(): val = get_reboot_counter() if (val<255): val = val + 1 set_reboot_counter(val) - + # BPP def bpp_execute(): print("[SPLASH] Executing BPP...") @@ -23,7 +23,7 @@ def bpp_execute(): esp.rtcmem_write(0,2) esp.rtcmem_write(0,~2) deepsleep.reboot() - + def bpp_check(): global bpp_after_count if (get_reboot_counter()>bpp_after_count): @@ -45,7 +45,7 @@ def setup_services(): except OSError: print("[SPLASH] Listing app files for app '"+app+"' failed!") return False - + found = False for f in files: if (f=="service.py"): @@ -86,7 +86,7 @@ def draw_services(): y = y - abs(space_used) except BaseException as msg: print("[SPLASH] Service draw exception: ", msg) - + # RTC def clockstring(): [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() @@ -101,47 +101,29 @@ def clockstring(): hourstr = "0"+hourstr minstr = str(min) if (min<10): - minstr = "0"+minstr + minstr = "0"+minstr return daystr+"-"+monthstr+"-"+str(year)+" "+hourstr+":"+minstr -def disableWifi(): - import network - nw = network.WLAN(network.STA_IF) - nw.active(False) -def get_time_ntp(disable): - import ntp - current_datetime = time.time() - - if (current_datetime<1482192000): #If clock on time before 2017 - draw_msg("Configuring clock...", "Welcome!") - if (wifi_connect()): - draw_msg("Configuring clock...", "NTP...") - ntp.set_NTP_time() - draw_msg("Configuring clock...", "Done!") - if (disable): - disableWifi() - return True - else: - return False +def get_time_ntp(): + draw_msg("Configuring clock...", "Welcome!") + if (connectWiFi()): + draw_msg("Configuring clock...", "NTP...") + ntp.set_NTP_time() + draw_msg("Configuring clock...", "Done!") return True - + else: + return False + # BATTERY -def battery_percent_internal(vempty, vfull, vbatt): - percent = round(((vbatt-vempty)*100)/(vfull-vempty)) - if (percent<0): - percent = 0 - if (percent>100): - percent = 100 - return percent - -def battery_percent(): - vbatt = 0 - for i in range(0,10): - vbatt = vbatt + badge.battery_volt_sense() - global battery_volt_min - global battery_volt_max - percent = battery_percent_internal(battery_volt_min, battery_volt_max, round(vbatt/10)) +def battery_percent(vbatt): + global battery_volt_min + global battery_volt_max + percent = round(((vbatt-vempty)*100)/(vfull-vempty)) + if (percent<0): + percent = 0 + elif (percent>100): + percent = 100 return percent # GRAPHICS @@ -151,7 +133,7 @@ def draw_msg(title, desc): ugfx.string(0, 25, desc, "Roboto_Regular12", ugfx.BLACK) ugfx.set_lut(ugfx.LUT_FASTER) ugfx.flush() - + def draw_dialog(title, desc, msg): ugfx.clear(ugfx.WHITE) ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) @@ -167,7 +149,7 @@ def draw_logo(x,y,h): ugfx.line(x, y + 47, x + 14 + len, y + 47, ugfx.BLACK) ugfx.line(x + 10 + len, y + 27, x + 10 + len, y + 45, ugfx.BLACK) ugfx.string(x + 10, y + 50,"Anyway","Roboto_BlackItalic24",ugfx.BLACK) - + def draw_helper_clear(full): if full: ugfx.clear(ugfx.BLACK) @@ -175,7 +157,7 @@ def draw_helper_clear(full): ugfx.clear(ugfx.WHITE) if full: ugfx.flush() - + def draw_helper_battery(percent,cstate): global header_fg global header_bg @@ -193,40 +175,40 @@ def draw_helper_battery(percent,cstate): ugfx.string(5,5,"empty","Roboto_Regular12",header_bg) else: ugfx.string(2,5,"no batt","Roboto_Regular12",header_bg) - + def draw_helper_header(text): global header_fg global header_bg ugfx.area(0,0,ugfx.width(),23,header_bg) ugfx.string(45, 1, text,"DejaVuSans20",header_fg) - + def draw_helper_footer(text_l, text_r): ugfx.string(0, ugfx.height()-13, text_l, "Roboto_Regular12",ugfx.BLACK) l = ugfx.get_string_width(text_r,"Roboto_Regular12") ugfx.string(ugfx.width()-l, ugfx.height()-13, text_r, "Roboto_Regular12",ugfx.BLACK) - + def draw_helper_nick(default): nick = badge.nvs_get_str("owner", "name", default) ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) htext = badge.nvs_get_str("owner", "htext", "") if (htext!=""): draw_logo(160, 25, htext) - + def draw_helper_flush(full): if (full): ugfx.set_lut(ugfx.LUT_FULL) ugfx.flush() ugfx.set_lut(ugfx.LUT_FASTER) - -def draw_home(percent, cstate, status, full_clear, going_to_sleep): + +def draw_home(full_clear, going_to_sleep): global update_available global update_name global update_build - + if (update_available): status = "OTA update available" - - draw_helper_clear(full_clear) + + draw_helper_clear(full_clear) # CLEAR SCREEN global header_hide_while_sleeping if (header_hide_while_sleeping and going_to_sleep): print("[SPLASH] Hiding header while sleeping") @@ -243,27 +225,19 @@ def draw_home(percent, cstate, status, full_clear, going_to_sleep): info = "[ ANY: Exit BPP ]" else: info = "[ START: LAUNCHER ]" - + clock = clockstring() if (update_available): ugfx.string(0, 25, "Update to version "+str(update_build)+ " '"+update_name+"' available","Roboto_Regular12",ugfx.BLACK) info = "[ B: OTA UPDATE ] "+info clock = "" - + draw_helper_footer(clock,info) draw_helper_nick("Unknown") draw_services() draw_helper_flush(True) - -def draw_batterylow(percent): - draw_helper_clear(True) - draw_helper_header("") - draw_helper_battery(percent, False) - draw_helper_footer("BATTERY LOW, CONNECT CHARGER!", "") - draw_helper_nick(":( Zzzz...") - draw_helper_flush(False) - + # START LAUNCHER def start_launcher(pushed): if(pushed): @@ -272,24 +246,24 @@ def start_launcher(pushed): splashTimer.deinit() increment_reboot_counter() appglue.start_app("launcher") - + def start_ota(pushed): if(pushed): print("[SPLASH] Starting OTA...") appglue.start_ota() - + # NOTHING def nothing(pressed): if (pressed): reset_countdown() - + # MAGIC def actually_start_magic(): print("[SPLASH] Starting magic...") esp.rtcmem_write_string("magic") deepsleep.reboot() -magic = 0 +magic = 0 def start_magic(pushed): reset_countdown() global magic @@ -299,7 +273,7 @@ def start_magic(pushed): actually_start_magic() else: print("[SPLASH] Magic in "+str(10-magic)+"...") - + # SLEEP def badge_sleep(): increment_reboot_counter() @@ -307,13 +281,17 @@ def badge_sleep(): print("[SPLASH] Going to sleep now...") badge.eink_busy_wait() #Always wait for e-ink deepsleep.start_sleeping(sleep_duration*1000) - -def badge_sleep_forever(): - increment_reboot_counter() - print("[SPLASH] Going to sleep WITHOUT TIME WAKEUP now...") - badge.eink_busy_wait() #Always wait for e-ink - deepsleep.start_sleeping(0) #Sleep until button interrupt occurs - + +def sleepIfEmpty(vbatt): + global battery_volt_min + if (vbatt > 100) and (vbatt < battery_volt_min): + increment_reboot_counter() + print("[SPLASH] Going to sleep WITHOUT TIME WAKEUP now...") + badge.eink_busy_wait() #Always wait for e-ink + deepsleep.start_sleeping(0) #Sleep until button interrupt occurs + else: + return True + # TIMER def splashTimer_callback(tmr): global loopCnt @@ -321,115 +299,97 @@ def splashTimer_callback(tmr): #print("[TIMER] "+str(loopCnt)) if loopCnt<1: loopCnt = timer_loop_amount - cstate = badge.battery_charge_status() - percent = battery_percent() - vbatt = badge.battery_volt_sense() - if (cstate) or (percent>98) or (vbatt<100): #If charging, charged or without battery - global header_status_string - draw_home(percent, cstate, header_status_string, False, False) #Update display - else: - global battery_percent_empty - if (percent<=battery_percent_empty): - draw_batterylow(percent) - ugfx.flush() - badge_sleep_forever() - else: - if (bpp_check()): - draw_home(percent, cstate, "BPP", False, True) - bpp_execute() - else: - draw_home(percent, cstate, "Zzz...", False, True) - badge_sleep() + draw_home(False, True) else: - if (loop_services(loopCnt)): - loopCnt = timer_loop_amount - loopCnt = loopCnt - 1 - + if not (loop_services(loopCnt)): + loopCnt = loopCnt - 1 + def reset_countdown(): global loopCnt global timer_loop_amount loopCnt = timer_loop_amount - + def start_sleep_counter(): global splashTimer global splash_timer_interval splashTimer.init(period=splash_timer_interval, mode=machine.Timer.PERIODIC, callback=splashTimer_callback) - + def stop_sleep_counter(): global splashTimer splashTimer.deinit() - + def restart_sleep_counter(): stop_sleep_counter() start_sleep_counter() - + # WIFI -def wifi_connect(): - import wifi - wifi.init() - ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') - draw_msg("Configuring clock...", "Connecting to '"+ssid+"'...") - global ntp_timeout - timeout = ntp_timeout - while not wifi.sta_if.isconnected(): - time.sleep(0.1) - timeout = timeout - 1 - if (timeout<1): - draw_msg("Error", "Timeout while connecting!") - disableWifi() - time.sleep(1) - return False +def disableWiFi(): + nw = network.WLAN(network.STA_IF) + nw.active(False) + +def connectWiFi(): + nw = network.WLAN(network.STA_IF) + if not nw.isconnected(): + nw.active(True) + ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') + password = badge.nvs_get_str('badge', 'wifi.password') + if password: + sta_if.connect(ssid, password) else: - pass + sta_if.connect(ssid) + + draw_msg("Wi-Fi active", "Connecting to '"+ssid+"'...") + + global wifi_timeout + timeout = wifi_timeout + while not nw.isconnected(): + time.sleep(0.1) + timeout = timeout - 1 + if (timeout<1): + draw_msg("Error", "Timeout while connecting!") + disableWiFi() + time.sleep(1) + return False return True - + # CHECK OTA VERSION def download_ota_info(): - import gc import urequests as requests draw_msg("Loading...", "Downloading JSON...") - gc.collect() result = False try: data = requests.get("https://badge.sha2017.org/version") except: draw_msg("Error", "Could not download JSON!") - utime.sleep(5) + time.sleep(5) return False try: result = data.json() except: data.close() draw_msg("Error", "Could not decode JSON!") - utime.sleep(5) + time.sleep(5) return False data.close() return result def check_ota_available(): - import wifi - import network global update_available global update_name global update_build - if not wifi.sta_if.isconnected(): - if not wifi_connect(): - disableWifi() - return False - json = download_ota_info() - if (json): - import version - if (json["build"]>version.build): - update_available = True - update_name = json["name"] - update_build = json["build"] - ugfx.input_attach(ugfx.BTN_B, start_ota) - else: - disableWifi() - return False - disableWifi() - return True + + if connectWiFi(): + json = download_ota_info() + if (json): + import version + if (json["build"] > version.build): + update_available = True + update_name = json["name"] + update_build = json["build"] + ugfx.input_attach(ugfx.BTN_B, start_ota) + return True + return False # WELCOME (SETUP, SPONSORS OR CLOCK) def welcome(): @@ -443,15 +403,12 @@ def welcome(): appglue.start_app("sponsors") else: # Setup completed print("[SPLASH] Normal boot.") - if (machine.reset_cause() != machine.DEEPSLEEP_RESET): - print("[SPLASH] Cold boot, checking if OTA available...") - get_time_ntp(False) - check_ota_available() - else: - get_time_ntp(True) # SETTINGS FROM NVS def load_settings(): + global header_status_string + header_status_string = "" + header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) if (header_inv>0): global header_fg @@ -472,15 +429,17 @@ def load_settings(): print("[SPLASH] Sleep duration set to less than 30 seconds. Forcing 30 seconds.") sleep_duration = 30 #if (sleep_duration>120): - # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") + # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") global battery_volt_min - battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3700) # mV + battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3500) # mV + # Just bellow brownout, real battery voltage may be higher due to voltage drop over polyfuse global battery_volt_max - battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV + battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4100) # mV + # Lower than charge voltage, to display (almost) full when battery has stopped charging global battery_percent_empty - battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 1) # % - global ntp_timeout - ntp_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries + battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 25) # % + global wifi_timeout + wifi_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries global bpp_after_count bpp_after_count = badge.nvs_get_u8('splash', 'bpp.count', 5) global splash_timer_interval @@ -489,42 +448,44 @@ def load_settings(): timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) global loopCnt loopCnt = timer_loop_amount - + # MAIN -def splash_main(): - cstate = badge.battery_charge_status() - percent = battery_percent() - vbatt = badge.battery_volt_sense() - print("[SPLASH] Vbatt = "+str(vbatt)) - load_settings() - - global header_status_string - header_status_string = "" - - ugfx.init() - global battery_percent_empty - if (cstate) or (percent>battery_percent_empty) or (vbatt<100): - ugfx.input_init() - welcome() - ugfx.input_attach(ugfx.BTN_START, start_launcher) - ugfx.input_attach(ugfx.BTN_A, start_magic) - ugfx.input_attach(ugfx.BTN_B, nothing) - ugfx.input_attach(ugfx.BTN_SELECT, nothing) - ugfx.input_attach(ugfx.JOY_UP, nothing) - ugfx.input_attach(ugfx.JOY_DOWN, nothing) - ugfx.input_attach(ugfx.JOY_LEFT, nothing) - ugfx.input_attach(ugfx.JOY_RIGHT, nothing) - global splashTimer - setup_services() - start_sleep_counter() - full_clear = False - if (get_reboot_counter()==0): - full_clear = True - draw_home(percent, cstate, header_status_string, full_clear, False) +def splash_main(): + + load_settings() # Settings + + ugfx.input_init() # Inputs + ugfx.input_attach(ugfx.BTN_START, start_launcher) + ugfx.input_attach(ugfx.BTN_A, start_magic) + ugfx.input_attach(ugfx.BTN_B, nothing) + ugfx.input_attach(ugfx.BTN_SELECT, nothing) + ugfx.input_attach(ugfx.JOY_UP, nothing) + ugfx.input_attach(ugfx.JOY_DOWN, nothing) + ugfx.input_attach(ugfx.JOY_LEFT, nothing) + ugfx.input_attach(ugfx.JOY_RIGHT, nothing) + + welcome() + gc.collect() + + doOTA = True + if (time.time() < 1482192000): #If clock on time before 2017 + doOTA = get_time_ntp() + + if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and doOTA: + print("[SPLASH] Cold boot, checking if OTA available...") + check_ota_available() + + gc.collect() + + if (get_reboot_counter()==0): + draw_home(True, False) else: - draw_batterylow(percent) - badge_sleep_forever() - + draw_home(False, False) + + setup_services() + start_sleep_counter() + + # GLOBALS (With defaults that will probably never be used) splashTimer = machine.Timer(0) services = [] @@ -538,7 +499,7 @@ def splash_main(): battery_volt_min = 3800 battery_volt_max = 4300 battery_percent_empty = 1 -ntp_timeout = 40 +wifi_timeout = 40 bpp_after_count = 5 header_status_string = "" splash_timer_interval = 500 @@ -548,4 +509,3 @@ def splash_main(): update_build = 0 splash_main() - From c174c7eef07221d25b581be66ea1c110a7e7f93a Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Sun, 23 Jul 2017 18:56:40 +0200 Subject: [PATCH 049/403] Remove deprecated led function --- esp32/modbadge.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index a013fb68e..f9f992d01 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -308,14 +308,6 @@ STATIC mp_obj_t badge_leds_send_data_(mp_uint_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_leds_send_data_obj, 2,2 ,badge_leds_send_data_); -STATIC mp_obj_t badge_leds_set_state_(mp_uint_t n_args, const mp_obj_t *args) { - mp_uint_t len; - uint8_t *leds = (uint8_t *)mp_obj_str_get_data(args[0], &len); - return mp_obj_new_int(badge_leds_send_data(leds, len)); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_leds_set_state_obj, 1,1 ,badge_leds_set_state_); -#endif - #if defined(PORTEXP_PIN_NUM_VIBRATOR) || defined(MPR121_PIN_NUM_VIBRATOR) STATIC mp_obj_t badge_vibrator_init_() { badge_vibrator_init(); @@ -352,7 +344,6 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_leds_enable), (mp_obj_t)&badge_leds_enable_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_leds_disable), (mp_obj_t)&badge_leds_disable_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_leds_send_data), (mp_obj_t)&badge_leds_send_data_obj}, - {MP_OBJ_NEW_QSTR(MP_QSTR_leds_set_state), (mp_obj_t)&badge_leds_set_state_obj}, #endif #if defined(PORTEXP_PIN_NUM_VIBRATOR) || defined(MPR121_PIN_NUM_VIBRATOR) From c598febb273891595f84e885461e7ddf7cf9b271 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 23 Jul 2017 18:56:46 +0200 Subject: [PATCH 050/403] lower max_files from 8 to 3. --- extmod/vfs_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/vfs_native.c b/extmod/vfs_native.c index 138ce29ed..320096edf 100644 --- a/extmod/vfs_native.c +++ b/extmod/vfs_native.c @@ -400,7 +400,7 @@ STATIC mp_obj_t native_vfs_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t m // mount the block device const esp_vfs_fat_mount_config_t mount_config = { - .max_files = 8, + .max_files = 3, // every open file costs 4236 bytes of heap. .format_if_mount_failed = true, }; From 022d5ec88c3156b77cf9797dfa51812bc24efb81 Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Sun, 23 Jul 2017 21:23:13 +0200 Subject: [PATCH 051/403] Return to homescreen from launcher with START --- esp32/modules/launcher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 2efbac822..d58bd8e13 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -107,6 +107,8 @@ def perform_uninstall(ok): ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) +ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) + ugfx.set_lut(ugfx.LUT_FULL) ugfx.flush() ugfx.set_lut(ugfx.LUT_FASTER) From 4666abb59dd0c7704a0333485a82fbdc2317062e Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Sun, 23 Jul 2017 22:04:59 +0200 Subject: [PATCH 052/403] Add button functions to launcher --- esp32/modules/launcher.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index d58bd8e13..8d488e3c8 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -14,22 +14,29 @@ ugfx.clear(ugfx.WHITE) ugfx.flush() -ugfx.string_box(148,22,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,45,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,70,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) +ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) +ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) +ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) #the line under the text str_len = ugfx.get_string_width("Hacking","PermanentMarker22") line_begin = 148 + int((148-str_len)/2) line_end = str_len+line_begin -ugfx.line(line_begin, 68, line_end, 68, ugfx.BLACK) +ugfx.line(line_begin, 46, line_end, 46, ugfx.BLACK) #the cursor past the text cursor_pos = line_end+5 -ugfx.line(cursor_pos, 46, cursor_pos, 66, ugfx.BLACK) +ugfx.line(cursor_pos, 22, cursor_pos, 44, ugfx.BLACK) -ugfx.string_box(148,110,148,18, version.name,"Roboto_Regular12",ugfx.BLACK, ugfx.justifyLeft) -ugfx.flush() +# Instructions +ugfx.line(148, 78, 296, 78, ugfx.BLACK) +ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) +ugfx.string_box(148,78,148,18, " B: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) +ugfx.string_box(148,92,148,18, " START: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) +ugfx.line(148, 110, 296, 110, ugfx.BLACK) +ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + +# ugfx.flush() options = None install_path = None From a02a45281312c161bb17b424de965c0059f15a1e Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Sun, 23 Jul 2017 22:07:22 +0200 Subject: [PATCH 053/403] Reduce WiFi timeout to 10s --- esp32/modules/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index a360a2571..ed8f302cc 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -14,7 +14,7 @@ ugfx.string(140,75, "WiFi","PermanentMarker22",ugfx.WHITE) ugfx.flush() -timeout = 500 +timeout = 100 while not wifi.sta_if.isconnected(): time.sleep(0.1) timeout = timeout - 1 From 30d55762e1200e75d81974c296757d1e0a3b1245 Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Sun, 23 Jul 2017 22:20:36 +0200 Subject: [PATCH 054/403] Okay, maybe 25s timeout is more appropriate (still rather long) --- esp32/modules/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index ed8f302cc..1fb80d7e9 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -14,7 +14,7 @@ ugfx.string(140,75, "WiFi","PermanentMarker22",ugfx.WHITE) ugfx.flush() -timeout = 100 +timeout = 250 while not wifi.sta_if.isconnected(): time.sleep(0.1) timeout = timeout - 1 From d07fdc1af9b24d7c97734432b3e901e2b4883909 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Sun, 23 Jul 2017 23:45:01 +0200 Subject: [PATCH 055/403] plz to be ending your #ifdef's, kthx bye --- esp32/modbadge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 682a6499a..90863b66e 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -319,6 +319,7 @@ STATIC mp_obj_t badge_leds_send_data_(mp_uint_t n_args, const mp_obj_t *args) { return mp_obj_new_int(badge_leds_send_data(leds, len)); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_leds_send_data_obj, 2,2 ,badge_leds_send_data_); +#endif #if defined(PORTEXP_PIN_NUM_VIBRATOR) || defined(MPR121_PIN_NUM_VIBRATOR) STATIC mp_obj_t badge_vibrator_init_() { From 9257a3743e7f8878d3ab24f58c61ebd71995550b Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Mon, 24 Jul 2017 01:51:37 +0200 Subject: [PATCH 056/403] More python code --- esp32/modules/appglue.py | 8 +- esp32/modules/services.py | 61 ++++++++ esp32/modules/splash.py | 285 ++++++++++---------------------------- 3 files changed, 138 insertions(+), 216 deletions(-) create mode 100644 esp32/modules/services.py diff --git a/esp32/modules/appglue.py b/esp32/modules/appglue.py index 1ce84c167..e53df17a0 100644 --- a/esp32/modules/appglue.py +++ b/esp32/modules/appglue.py @@ -2,11 +2,12 @@ def start_app(app): ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, "Please wait...", "PermanentMarker22", ugfx.BLACK) + ugfx.string(0, 0, "Rebooting..", "PermanentMarker22", ugfx.BLACK) if (app==""): ugfx.string(0, 25, "Returning to homescreen...","Roboto_Regular12",ugfx.BLACK) else: ugfx.string(0, 25, "Starting "+app+"...","Roboto_Regular12",ugfx.BLACK) + ugfx.set_lut(ugfx.LUT_FASTEST) ugfx.flush() esp.rtcmem_write_string(app) badge.eink_busy_wait() @@ -19,3 +20,8 @@ def start_ota(): esp.rtcmem_write(0,1) esp.rtcmem_write(1,~1) deepsleep.reboot() + +def start_bpp(): + esp.rtcmem_write(0,2) + esp.rtcmem_write(1,~2) + deepsleep.reboot() diff --git a/esp32/modules/services.py b/esp32/modules/services.py new file mode 100644 index 000000000..ea6917411 --- /dev/null +++ b/esp32/modules/services.py @@ -0,0 +1,61 @@ +import uos + +# SHA2017 badge services +# Renze Nicolai +# Thomas Roos + +def setup(): + global services + try: + apps = uos.listdir('lib') + except OSError: + print("[SERVICES] Can't setup services: no lib folder!") + return False + status = True #True if no error occured + for app in apps: + try: + files = uos.listdir('lib/'+app) + except OSError: + print("[SERVICES] Listing app files for app '"+app+"' failed!") + return False + + found = False + for f in files: + if (f=="service.py"): + found = True + print("[SERVICES] Running service "+app+"...") + try: + srv = __import__('lib/'+app+'/service') + services.append(srv) #Add to global list + srv.setup() + except BaseException as msg: + print("Exception in service setup "+app+": ", msg) + status = False #Error: status is now False + break + if not found: + print("[SERVICES] App '"+app+"' has no service") + return status + +def loop(lcnt): + noSleep = False + global services + for srv in services: + try: + if (srv.loop(lcnt)): + noSleep = True + except BaseException as msg: + print("[SERVICES] Service loop exception: ", msg) + return noSleep + +def draw(): + noSleep = False + global services + x = 0 + y = 114 + for srv in services: + try: + space_used = srv.draw(x,y) + if (space_used>0): + y = y - abs(space_used) + except BaseException as msg: + print("[SERVICES] Service draw exception: ", msg) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index b50302027..d27923a0d 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,93 +1,19 @@ -import ugfx, time, badge, machine, uos, appglue, deepsleep, network, esp, gc +import ugfx, time, badge, machine, appglue, deepsleep, network, esp, gc, services # SHA2017 badge home screen -# Renze Nicolai 2017 - -# Reboot counter (Used for BPP) -def get_reboot_counter(): - return esp.rtcmem_read(1023) - -def set_reboot_counter(value): - esp.rtcmem_write(1023, value) - -def increment_reboot_counter(): - val = get_reboot_counter() - if (val<255): - val = val + 1 - set_reboot_counter(val) +# Renze Nicolai +# Thomas Roos # BPP -def bpp_execute(): - print("[SPLASH] Executing BPP...") - set_reboot_counter(0) - esp.rtcmem_write(0,2) - esp.rtcmem_write(0,~2) - deepsleep.reboot() - -def bpp_check(): - global bpp_after_count - if (get_reboot_counter()>bpp_after_count): +def bpp_time(): + val = esp.rtcmem_read(255) + if esp.rtcmem_read(255)() > 5: return True + else: + val += 1 return False -# SERVICES -def setup_services(): - global services - try: - apps = uos.listdir('lib') - except OSError: - print("[SPLASH] Can't setup services: no lib folder!") - return False - status = True #True if no error occured - for app in apps: - try: - files = uos.listdir('lib/'+app) - except OSError: - print("[SPLASH] Listing app files for app '"+app+"' failed!") - return False - - found = False - for f in files: - if (f=="service.py"): - found = True - print("[SPLASH] Running service "+app+"...") - try: - srv = __import__('lib/'+app+'/service') - services.append(srv) #Add to global list - srv.setup() - except BaseException as msg: - print("Exception in service setup "+app+": ", msg) - status = False #Error: status is now False - break - if not found: - print("[SPLASH] App '"+app+"' has no service") - return status - -def loop_services(lcnt): - noSleep = False - global services - for srv in services: - try: - if (srv.loop(lcnt)): - noSleep = True - except BaseException as msg: - print("[SPLASH] Service loop exception: ", msg) - return noSleep - -def draw_services(): - noSleep = False - global services - x = 0 - y = ugfx.height() - 14 - for srv in services: - try: - space_used = srv.draw(x,y) - if (space_used>0): - y = y - abs(space_used) - except BaseException as msg: - print("[SPLASH] Service draw exception: ", msg) - -# RTC +# TIME def clockstring(): [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() monthstr = str(month) @@ -104,11 +30,10 @@ def clockstring(): minstr = "0"+minstr return daystr+"-"+monthstr+"-"+str(year)+" "+hourstr+":"+minstr - -def get_time_ntp(): - draw_msg("Configuring clock...", "Welcome!") +def set_time_ntp(): + draw_msg("Configuring clock...", "Connecting to WiFi...") if (connectWiFi()): - draw_msg("Configuring clock...", "NTP...") + draw_msg("Configuring clock...", "Setting time over NTP...") ntp.set_NTP_time() draw_msg("Configuring clock...", "Done!") return True @@ -131,7 +56,7 @@ def draw_msg(title, desc): ugfx.clear(ugfx.WHITE) ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) ugfx.string(0, 25, desc, "Roboto_Regular12", ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTER) + ugfx.set_lut(ugfx.LUT_FASTEST) ugfx.flush() def draw_dialog(title, desc, msg): @@ -208,17 +133,12 @@ def draw_home(full_clear, going_to_sleep): if (update_available): status = "OTA update available" - draw_helper_clear(full_clear) # CLEAR SCREEN - global header_hide_while_sleeping - if (header_hide_while_sleeping and going_to_sleep): - print("[SPLASH] Hiding header while sleeping") - else: - draw_helper_header(status) - global header_hide_battery_while_sleeping - if (header_hide_battery_while_sleeping and going_to_sleep): - print("[SPLASH] Hiding battery while sleeping") - else: - draw_helper_battery(percent, cstate) + if full_clear: + draw_helper_clear(full_clear) # CLEAR SCREEN + + draw_helper_header(status) + draw_helper_battery(percent, cstate) + if (going_to_sleep): info = "[ ANY: Wake up ]" elif (status=="BPP"): @@ -300,27 +220,12 @@ def splashTimer_callback(tmr): if loopCnt<1: loopCnt = timer_loop_amount draw_home(False, True) + gc.collect() else: if not (loop_services(loopCnt)): loopCnt = loopCnt - 1 def reset_countdown(): - global loopCnt - global timer_loop_amount - loopCnt = timer_loop_amount - -def start_sleep_counter(): - global splashTimer - global splash_timer_interval - splashTimer.init(period=splash_timer_interval, mode=machine.Timer.PERIODIC, callback=splashTimer_callback) - -def stop_sleep_counter(): - global splashTimer - splashTimer.deinit() - -def restart_sleep_counter(): - stop_sleep_counter() - start_sleep_counter() # WIFI def disableWiFi(): @@ -338,7 +243,7 @@ def connectWiFi(): else: sta_if.connect(ssid) - draw_msg("Wi-Fi active", "Connecting to '"+ssid+"'...") + draw_msg("Wi-Fi actived", "Connecting to '"+ssid+"'...") global wifi_timeout timeout = wifi_timeout @@ -391,70 +296,10 @@ def check_ota_available(): return True return False -# WELCOME (SETUP, SPONSORS OR CLOCK) -def welcome(): - setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) - if (setupcompleted==0): # First boot (open setup) - print("[SPLASH] Setup not completed. Running setup!") - appglue.start_app("setup") - elif (setupcompleted==1): # Second boot (after setup) - print("[SPLASH] Showing sponsors once...") - badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once - appglue.start_app("sponsors") - else: # Setup completed - print("[SPLASH] Normal boot.") - -# SETTINGS FROM NVS -def load_settings(): - global header_status_string - header_status_string = "" - - header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) - if (header_inv>0): - global header_fg - global header_bg - header_fg = ugfx.WHITE - header_bg = ugfx.BLACK - header_hws = badge.nvs_get_u8('splash', 'header.hws', 0) #Hide While Sleeping - if (header_hws>0): - global header_hide_while_sleeping - header_hide_while_sleeping = True - header_hbws = badge.nvs_get_u8('splash', 'header.hbws', 0) #Hide Battery While Sleeping - if (header_hbws>0): - global header_hide_battery_while_sleeping - header_hide_battery_while_sleeping = True - global sleep_duration - sleep_duration = badge.nvs_get_u8('splash', 'sleep.duration', 60) - if (sleep_duration<30): - print("[SPLASH] Sleep duration set to less than 30 seconds. Forcing 30 seconds.") - sleep_duration = 30 - #if (sleep_duration>120): - # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") - global battery_volt_min - battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3500) # mV - # Just bellow brownout, real battery voltage may be higher due to voltage drop over polyfuse - global battery_volt_max - battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4100) # mV - # Lower than charge voltage, to display (almost) full when battery has stopped charging - global battery_percent_empty - battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 25) # % - global wifi_timeout - wifi_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries - global bpp_after_count - bpp_after_count = badge.nvs_get_u8('splash', 'bpp.count', 5) - global splash_timer_interval - splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 200) - global timer_loop_amount - timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) - global loopCnt - loopCnt = timer_loop_amount +def inputInit(): -# MAIN -def splash_main(): - - load_settings() # Settings - - ugfx.input_init() # Inputs +def checkFirstBoot(): + ugfx.input_init() ugfx.input_attach(ugfx.BTN_START, start_launcher) ugfx.input_attach(ugfx.BTN_A, start_magic) ugfx.input_attach(ugfx.BTN_B, nothing) @@ -464,48 +309,58 @@ def splash_main(): ugfx.input_attach(ugfx.JOY_LEFT, nothing) ugfx.input_attach(ugfx.JOY_RIGHT, nothing) - welcome() - gc.collect() - doOTA = True - if (time.time() < 1482192000): #If clock on time before 2017 - doOTA = get_time_ntp() +# MAIN +header_status_string = "" - if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and doOTA: - print("[SPLASH] Cold boot, checking if OTA available...") - check_ota_available() +header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) +if (header_inv>0): + header_fg = ugfx.WHITE + header_bg = ugfx.BLACK +header_hws = badge.nvs_get_u8('splash', 'header.hws', 0) #Hide While Sleeping +if (header_hws>0): + header_hide_while_sleeping = True +header_hbws = badge.nvs_get_u8('splash', 'header.hbws', 0) #Hide Battery While Sleeping +if (header_hbws>0): + header_hide_battery_while_sleeping = True +sleep_duration = badge.nvs_get_u8('splash', 'sleep.duration', 60) +if (sleep_duration<30): + print("[SPLASH] Sleep duration set to less than 30 seconds. Forcing 30 seconds.") + sleep_duration = 30 +#if (sleep_duration>120): +# print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") +battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3500) # mV +# Just bellow brownout, real battery voltage may be higher due to voltage drop over polyfuse +battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4100) # mV +# Lower than charge voltage, to display (almost) full when battery has stopped charging +battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 25) # % +wifi_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries +bpp_after_count = badge.nvs_get_u8('splash', 'bpp.count', 5) +splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 200) +timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) +loopCnt = timer_loop_amount - gc.collect() +inputInit() - if (get_reboot_counter()==0): - draw_home(True, False) - else: - draw_home(False, False) +checkFirstBoot() - setup_services() - start_sleep_counter() +if (time.time() < 1482192000): #If clock on time before 2017 + doOTA = set_time_ntp() +else: + doOTA = True +if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and doOTA: + check_ota_available() -# GLOBALS (With defaults that will probably never be used) -splashTimer = machine.Timer(0) -services = [] -timer_loop_amount = 9999 -loopCnt = timer_loop_amount -header_fg = ugfx.BLACK -header_bg = ugfx.WHITE -sleep_duration = 60 -header_hide_while_sleeping = False -header_hide_battery_while_sleeping = False -battery_volt_min = 3800 -battery_volt_max = 4300 -battery_percent_empty = 1 -wifi_timeout = 40 -bpp_after_count = 5 -header_status_string = "" -splash_timer_interval = 500 -update_available = False -update_name = "????" -update_build = 0 +if (esp.rtcmem_read(255)==0): + draw_home(True, False) +else: + draw_home(False, False) -splash_main() +services.setup() + +splashTimer = machine.Timer(0) +splashTimer.init(period=100, mode=machine.Timer.PERIODIC, callback=splashTimer_callback) +# FIXME PEROID flexibel maken +gc.collect() From 3c4e026d9410dbcd77d7756b6cc1860684267556 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 10:29:27 +1000 Subject: [PATCH 057/403] esp32: Enable "btree" database module. --- esp32/Makefile | 2 +- esp32/mpconfigport.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index 94db4a52d..fe3e092df 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -6,7 +6,7 @@ QSTR_DEFS = qstrdefsport.h MICROPY_PY_USSL = 0 MICROPY_SSL_AXTLS = 0 MICROPY_FATFS = 1 -MICROPY_PY_BTREE = 0 +MICROPY_PY_BTREE = 1 #FROZEN_DIR = scripts FROZEN_MPY_DIR = modules diff --git a/esp32/mpconfigport.h b/esp32/mpconfigport.h index 1dadd397e..61b2a2641 100644 --- a/esp32/mpconfigport.h +++ b/esp32/mpconfigport.h @@ -41,7 +41,7 @@ #define MICROPY_PY_BUILTINS_COMPLEX (1) #define MICROPY_CPYTHON_COMPAT (1) #define MICROPY_STREAMS_NON_BLOCK (1) -#define MICROPY_STREAMS_POSIX_API (0) +#define MICROPY_STREAMS_POSIX_API (1) #define MICROPY_MODULE_BUILTIN_INIT (1) #define MICROPY_MODULE_WEAK_LINKS (1) #define MICROPY_MODULE_FROZEN_STR (0) @@ -139,7 +139,6 @@ #define MICROPY_SSL_MBEDTLS (1) #define MICROPY_PY_WEBSOCKET (0) #define MICROPY_PY_FRAMEBUF (1) -#define MICROPY_PY_BTREE (0) // fatfs configuration #define MICROPY_FATFS_ENABLE_LFN (1) @@ -238,6 +237,8 @@ extern const struct _mp_obj_module_t mp_module_network; typedef int32_t mp_int_t; // must be pointer size typedef uint32_t mp_uint_t; // must be pointer size typedef long mp_off_t; +// ssize_t, off_t as required by POSIX-signatured functions in stream.h +#include // board specifics From d003daee06d0547c496169fcc306ed82082e34be Mon Sep 17 00:00:00 2001 From: Matthew Brener Date: Sun, 23 Jul 2017 22:53:34 +1000 Subject: [PATCH 058/403] docs/esp8266/tutorial: Fix typo, "its" to "it's" in powerctrl.rst. --- docs/esp8266/tutorial/powerctrl.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/esp8266/tutorial/powerctrl.rst b/docs/esp8266/tutorial/powerctrl.rst index 9e44339c8..3502624ab 100644 --- a/docs/esp8266/tutorial/powerctrl.rst +++ b/docs/esp8266/tutorial/powerctrl.rst @@ -22,7 +22,7 @@ processing power, at the expense of current consumption:: 160000000 You can change to the higher frequency just while your code does the heavy -processing and then change back when its finished. +processing and then change back when it's finished. Deep-sleep mode --------------- From 513dfcf4fe3277fa1cb1e383db0b60e4a3fc843b Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 15:07:48 +1000 Subject: [PATCH 059/403] extmod/modussl_mbedtls: Support server_side mode. To use server_side mode one must pass valid values in the "key" and "cert" parameters. --- extmod/modussl_mbedtls.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index 40dd8c049..ad29666ae 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -128,7 +128,7 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { } ret = mbedtls_ssl_config_defaults(&o->conf, - MBEDTLS_SSL_IS_CLIENT, + args->server_side.u_bool ? MBEDTLS_SSL_IS_SERVER : MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT); if (ret != 0) { @@ -172,15 +172,11 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { assert(ret == 0); } - if (args->server_side.u_bool) { - assert(0); - } else { - while ((ret = mbedtls_ssl_handshake(&o->ssl)) != 0) { - if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { - //assert(0); - printf("mbedtls_ssl_handshake error: -%x\n", -ret); - mp_raise_OSError(MP_EIO); - } + while ((ret = mbedtls_ssl_handshake(&o->ssl)) != 0) { + if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { + //assert(0); + printf("mbedtls_ssl_handshake error: -%x\n", -ret); + mp_raise_OSError(MP_EIO); } } From 1ed3356540f55c9ed4167c87166f6d18b2868f9c Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 15:50:47 +1000 Subject: [PATCH 060/403] py/py.mk: Make berkeley-db C-defs apply only to relevant source files. Otherwise they can interfere (eg redefinition of "abort") with other source files in a given uPy port. --- py/py.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py/py.mk b/py/py.mk index 70891677d..02f2df8e1 100644 --- a/py/py.mk +++ b/py/py.mk @@ -74,7 +74,7 @@ endif ifeq ($(MICROPY_PY_BTREE),1) BTREE_DIR = lib/berkeley-db-1.xx -CFLAGS_MOD += -D__DBINTERFACE_PRIVATE=1 -Dmpool_error=printf -Dabort=abort_ -Dvirt_fd_t=mp_obj_t "-DVIRT_FD_T_HEADER=" +BTREE_DEFS = -D__DBINTERFACE_PRIVATE=1 -Dmpool_error=printf -Dabort=abort_ -Dvirt_fd_t=mp_obj_t "-DVIRT_FD_T_HEADER=" INC += -I../$(BTREE_DIR)/PORT/include SRC_MOD += extmod/modbtree.c SRC_MOD += $(addprefix $(BTREE_DIR)/,\ @@ -95,7 +95,9 @@ mpool/mpool.c \ ) CFLAGS_MOD += -DMICROPY_PY_BTREE=1 # we need to suppress certain warnings to get berkeley-db to compile cleanly -$(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter +# and we have separate BTREE_DEFS so the definitions don't interfere with other source code +$(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter $(BTREE_DEFS) +$(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif # py object files From 17aa9a23fea55a61a1677116c765b68ddbbf2e8d Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 15:57:37 +1000 Subject: [PATCH 061/403] esp32/Makefile: Separate ESP-specific inc dirs to avoid header clashes. --- esp32/Makefile | 76 ++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index fe3e092df..e8b0e38ee 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -49,45 +49,47 @@ INC += -I../lib/mp-readline INC += -I../lib/netutils INC += -I../lib/timeutils INC += -I$(BUILD) -INC += -I$(ESPCOMP)/bootloader_support/include -INC += -I$(ESPCOMP)/driver/include -INC += -I$(ESPCOMP)/driver/include/driver -INC += -I$(ESPCOMP)/nghttp/port/include -INC += -I$(ESPCOMP)/nghttp/nghttp2/lib/includes -INC += -I$(ESPCOMP)/esp32/include -INC += -I$(ESPCOMP)/soc/include -INC += -I$(ESPCOMP)/soc/esp32/include -INC += -I$(ESPCOMP)/ethernet/include -INC += -I$(ESPCOMP)/expat/include/expat -INC += -I$(ESPCOMP)/expat/port/include -INC += -I$(ESPCOMP)/heap/include -INC += -I$(ESPCOMP)/json/include -INC += -I$(ESPCOMP)/json/port/include -INC += -I$(ESPCOMP)/log/include -INC += -I$(ESPCOMP)/newlib/include -INC += -I$(ESPCOMP)/nvs_flash/include -INC += -I$(ESPCOMP)/freertos/include -INC += -I$(ESPCOMP)/tcpip_adapter/include -INC += -I$(ESPCOMP)/lwip/include/lwip -INC += -I$(ESPCOMP)/lwip/include/lwip/port -INC += -I$(ESPCOMP)/lwip/include/lwip/posix -INC += -I$(ESPCOMP)/mbedtls/include -INC += -I$(ESPCOMP)/mbedtls/port/include -INC += -I$(ESPCOMP)/spi_flash/include -INC += -I$(ESPCOMP)/vfs/include -INC += -I$(ESPCOMP)/newlib/platform_include -INC += -I$(ESPCOMP)/xtensa-debug-module/include -INC += -I$(ESPCOMP)/wpa_supplicant/include -INC += -I$(ESPCOMP)/wpa_supplicant/port/include -INC += -I$(ESPCOMP)/ethernet/include -INC += -I$(ESPCOMP)/app_trace/include - -CFLAGS = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM $(INC) + +INC_ESPCOMP += -I$(ESPCOMP)/bootloader_support/include +INC_ESPCOMP += -I$(ESPCOMP)/driver/include +INC_ESPCOMP += -I$(ESPCOMP)/driver/include/driver +INC_ESPCOMP += -I$(ESPCOMP)/nghttp/port/include +INC_ESPCOMP += -I$(ESPCOMP)/nghttp/nghttp2/lib/includes +INC_ESPCOMP += -I$(ESPCOMP)/esp32/include +INC_ESPCOMP += -I$(ESPCOMP)/soc/include +INC_ESPCOMP += -I$(ESPCOMP)/soc/esp32/include +INC_ESPCOMP += -I$(ESPCOMP)/ethernet/include +INC_ESPCOMP += -I$(ESPCOMP)/expat/include/expat +INC_ESPCOMP += -I$(ESPCOMP)/expat/port/include +INC_ESPCOMP += -I$(ESPCOMP)/heap/include +INC_ESPCOMP += -I$(ESPCOMP)/json/include +INC_ESPCOMP += -I$(ESPCOMP)/json/port/include +INC_ESPCOMP += -I$(ESPCOMP)/log/include +INC_ESPCOMP += -I$(ESPCOMP)/newlib/include +INC_ESPCOMP += -I$(ESPCOMP)/nvs_flash/include +INC_ESPCOMP += -I$(ESPCOMP)/freertos/include +INC_ESPCOMP += -I$(ESPCOMP)/tcpip_adapter/include +INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip +INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/port +INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/posix +INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/include +INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/port/include +INC_ESPCOMP += -I$(ESPCOMP)/spi_flash/include +INC_ESPCOMP += -I$(ESPCOMP)/vfs/include +INC_ESPCOMP += -I$(ESPCOMP)/newlib/platform_include +INC_ESPCOMP += -I$(ESPCOMP)/xtensa-debug-module/include +INC_ESPCOMP += -I$(ESPCOMP)/wpa_supplicant/include +INC_ESPCOMP += -I$(ESPCOMP)/wpa_supplicant/port/include +INC_ESPCOMP += -I$(ESPCOMP)/ethernet/include +INC_ESPCOMP += -I$(ESPCOMP)/app_trace/include + +CFLAGS_BASE = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM +CFLAGS = $(CFLAGS_BASE) $(INC) $(INC_ESPCOMP) CFLAGS += -DIDF_VER=\"$(IDF_VER)\" CFLAGS += $(CFLAGS_MOD) # this is what ESPIDF uses for c++ compilation -CXXFLAGS = -std=gnu++11 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DESP_PLATFORM $(INC) +CXXFLAGS = -std=gnu++11 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DESP_PLATFORM $(INC) $(INC_ESPCOMP) LDFLAGS = -nostdlib -Map=$(@:.elf=.map) --cref LDFLAGS += --gc-sections -static -EL @@ -274,12 +276,14 @@ ESPIDF_EXPAT_O = $(addprefix $(ESPCOMP)/expat/,\ # Assembler .S files need only basic flags, and in particular should not have # -Os because that generates subtly different code. +# We also need custom CFLAGS for .c files because FreeRTOS has headers with +# generic names (eg queue.h) which can clash with other files in the port. CFLAGS_ASM = -I$(ESPCOMP)/esp32/include -I$(ESPCOMP)/soc/esp32/include -I$(ESPCOMP)/freertos/include/freertos -I. $(BUILD)/$(ESPCOMP)/freertos/portasm.o: CFLAGS = $(CFLAGS_ASM) $(BUILD)/$(ESPCOMP)/freertos/xtensa_context.o: CFLAGS = $(CFLAGS_ASM) $(BUILD)/$(ESPCOMP)/freertos/xtensa_intr_asm.o: CFLAGS = $(CFLAGS_ASM) $(BUILD)/$(ESPCOMP)/freertos/xtensa_vectors.o: CFLAGS = $(CFLAGS_ASM) -$(BUILD)/$(ESPCOMP)/freertos/%.o: CFLAGS += -I$(ESPCOMP)/freertos/include/freertos +$(BUILD)/$(ESPCOMP)/freertos/%.o: CFLAGS = $(CFLAGS_BASE) -I. $(INC_ESPCOMP) -I$(ESPCOMP)/freertos/include/freertos ESPIDF_FREERTOS_O = $(addprefix $(ESPCOMP)/freertos/,\ croutine.o \ event_groups.o \ From 046d15f074398cc2968fc66ae2fd25dc31100109 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 15:58:40 +1000 Subject: [PATCH 062/403] esp32: Changes to follow latest version of upstream uPy. --- esp32/Makefile | 9 ++------- esp32/mpconfigport.h | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index e8b0e38ee..bd70fbda7 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -120,7 +120,6 @@ SRC_C = \ mphalport.c \ fatfs_port.c \ help.c \ - esponewire.c \ modutime.c \ moduos.c \ machine_timer.c \ @@ -140,11 +139,8 @@ SRC_C = \ mpthreadport.c \ $(SRC_MOD) -ESP8266_SRC_C = $(addprefix esp8266/,\ - modonewire.c \ - ) - EXTMOD_SRC_C = $(addprefix extmod/,\ + modonewire.c \ ) LIB_SRC_C = $(addprefix lib/,\ @@ -187,13 +183,12 @@ DRIVERS_SRC_C = $(addprefix drivers/,\ OBJ_MP = OBJ_MP += $(PY_O) OBJ_MP += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) -OBJ_MP += $(addprefix $(BUILD)/, $(ESP8266_SRC_C:.c=.o)) OBJ_MP += $(addprefix $(BUILD)/, $(EXTMOD_SRC_C:.c=.o)) OBJ_MP += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o)) OBJ_MP += $(addprefix $(BUILD)/, $(DRIVERS_SRC_C:.c=.o)) # List of sources for qstr extraction -SRC_QSTR += $(SRC_C) $(ESP8266_SRC_C) $(EXTMOD_SRC_C) $(LIB_SRC_C) $(DRIVERS_SRC_C) +SRC_QSTR += $(SRC_C) $(EXTMOD_SRC_C) $(LIB_SRC_C) $(DRIVERS_SRC_C) # Append any auto-generated sources that are needed by sources listed in SRC_QSTR SRC_QSTR_AUTO_DEPS += diff --git a/esp32/mpconfigport.h b/esp32/mpconfigport.h index 61b2a2641..cd408e157 100644 --- a/esp32/mpconfigport.h +++ b/esp32/mpconfigport.h @@ -160,21 +160,21 @@ // extra built in modules to add to the list of known ones extern const struct _mp_obj_module_t esp_module; -extern const struct _mp_obj_module_t onewire_module; extern const struct _mp_obj_module_t utime_module; extern const struct _mp_obj_module_t uos_module; extern const struct _mp_obj_module_t mp_module_usocket; extern const struct _mp_obj_module_t mp_module_machine; extern const struct _mp_obj_module_t mp_module_network; +extern const struct _mp_obj_module_t mp_module_onewire; #define MICROPY_PORT_BUILTIN_MODULES \ { MP_OBJ_NEW_QSTR(MP_QSTR_esp), (mp_obj_t)&esp_module }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&onewire_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&utime_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&uos_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_usocket }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&mp_module_network }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&mp_module_onewire }, \ #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ { MP_OBJ_NEW_QSTR(MP_QSTR_binascii), (mp_obj_t)&mp_module_ubinascii }, \ From 96de4d137fa9695df995fd5b237b832dedb5514b Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 16:14:04 +1000 Subject: [PATCH 063/403] esp32: Make firmware.bin start at 0x1000 to allow flash size autodetect. The firmware.bin file must now be flashed starting at address 0x1000, and it should no longer matter what flash size the firmware was built for. --- esp32/Makefile | 2 +- esp32/makeimg.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index bd70fbda7..1d0adf660 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -578,7 +578,7 @@ $(BUILD)/firmware.bin: $(BUILD)/bootloader.bin $(BUILD)/partitions.bin $(BUILD)/ deploy: $(BUILD)/firmware.bin $(ECHO) "Writing $^ to the board" - $(Q)$(ESPTOOL) --chip esp32 --port $(PORT) --baud $(BAUD) write_flash -z --flash_mode $(FLASH_MODE) --flash_freq $(FLASH_FREQ) --flash_size $(FLASH_SIZE) 0 $^ + $(Q)$(ESPTOOL) --chip esp32 --port $(PORT) --baud $(BAUD) write_flash -z --flash_mode $(FLASH_MODE) --flash_freq $(FLASH_FREQ) 0x1000 $^ erase: $(ECHO) "Erasing flash" diff --git a/esp32/makeimg.py b/esp32/makeimg.py index a79b8f8e6..aeedbff7e 100644 --- a/esp32/makeimg.py +++ b/esp32/makeimg.py @@ -11,7 +11,7 @@ ] file_out = sys.argv[4] -cur_offset = 0 +cur_offset = OFFSET_BOOTLOADER with open(file_out, 'wb') as fout: for name, offset, file_in in files_in: assert offset >= cur_offset From 92f36eb7e6f545d735cf98b8425bb8f15c8edf0c Mon Sep 17 00:00:00 2001 From: Aram Date: Mon, 24 Jul 2017 09:59:29 +0200 Subject: [PATCH 064/403] Added extra urandom functions --- unix/mpconfigport.h | 1 + 1 file changed, 1 insertion(+) diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 8712d0f31..03f6646f2 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -130,6 +130,7 @@ #define MICROPY_PY_UBINASCII (1) #define MICROPY_PY_UBINASCII_CRC32 (1) #define MICROPY_PY_URANDOM (1) +#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1) #ifndef MICROPY_PY_USELECT_POSIX #define MICROPY_PY_USELECT_POSIX (1) #endif From a559098fecd0a0e2aa98d2a8b3b6ba080b4e096f Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 18:41:24 +1000 Subject: [PATCH 065/403] py/mperrno: Allow mperrno.h to be correctly included before other hdrs. Before this patch the mperrno.h file could be included and would silently succeed with incorrect config settings, because mpconfig.h was not yet included. --- py/mperrno.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/py/mperrno.h b/py/mperrno.h index c515ed488..f439f6555 100644 --- a/py/mperrno.h +++ b/py/mperrno.h @@ -26,6 +26,8 @@ #ifndef MICROPY_INCLUDED_PY_MPERRNO_H #define MICROPY_INCLUDED_PY_MPERRNO_H +#include "py/mpconfig.h" + #if MICROPY_USE_INTERNAL_ERRNO // MP_Exxx errno's are defined directly as numeric values @@ -138,7 +140,11 @@ #endif #if MICROPY_PY_UERRNO + +#include "py/obj.h" + qstr mp_errno_to_str(mp_obj_t errno_val); + #endif #endif // MICROPY_INCLUDED_PY_MPERRNO_H From aa7be82a4dff59b22763abbe1bd5e74c0e37b453 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 24 Jul 2017 18:43:14 +1000 Subject: [PATCH 066/403] all: Don't include system errno.h when it's not needed. --- cc3200/mods/pybuart.c | 1 - extmod/modbtree.c | 2 +- extmod/modussl_axtls.c | 1 - extmod/modussl_mbedtls.c | 1 - extmod/modwebrepl.c | 1 - extmod/modwebsocket.c | 5 ++--- extmod/uos_dupterm.c | 1 - extmod/vfs_fat_file.c | 1 - mpy-cross/main.c | 1 - py/reader.c | 1 - 10 files changed, 3 insertions(+), 12 deletions(-) diff --git a/cc3200/mods/pybuart.c b/cc3200/mods/pybuart.c index 92bb3e46e..06938bdd4 100644 --- a/cc3200/mods/pybuart.c +++ b/cc3200/mods/pybuart.c @@ -27,7 +27,6 @@ #include #include -#include #include #include "py/mpconfig.h" diff --git a/extmod/modbtree.c b/extmod/modbtree.c index 127dd71a3..229daaf0f 100644 --- a/extmod/modbtree.c +++ b/extmod/modbtree.c @@ -26,7 +26,7 @@ #include #include -#include +#include // for declaration of global errno variable #include #include "py/nlr.h" diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index a5ab8896c..be1aa0359 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -26,7 +26,6 @@ #include #include -#include #include "py/nlr.h" #include "py/runtime.h" diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index ad29666ae..f4b551cb9 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -29,7 +29,6 @@ #include #include -#include #include "py/nlr.h" #include "py/runtime.h" diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c index ce3c7dcbd..9e3f16fe7 100644 --- a/extmod/modwebrepl.c +++ b/extmod/modwebrepl.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "py/nlr.h" #include "py/obj.h" diff --git a/extmod/modwebsocket.c b/extmod/modwebsocket.c index 9e17d6a6d..6c6e32c1a 100644 --- a/extmod/modwebsocket.c +++ b/extmod/modwebsocket.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "py/nlr.h" #include "py/obj.h" @@ -88,7 +87,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int self->buf_pos += out_sz; self->to_recv -= out_sz; if (self->to_recv != 0) { - *errcode = EAGAIN; + *errcode = MP_EAGAIN; return MP_STREAM_ERROR; } } @@ -267,7 +266,7 @@ STATIC mp_uint_t websocket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t return cur; } default: - *errcode = EINVAL; + *errcode = MP_EINVAL; return MP_STREAM_ERROR; } } diff --git a/extmod/uos_dupterm.c b/extmod/uos_dupterm.c index d888099df..29a62ab89 100644 --- a/extmod/uos_dupterm.c +++ b/extmod/uos_dupterm.c @@ -24,7 +24,6 @@ * THE SOFTWARE. */ -#include #include #include "py/mpconfig.h" diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index edffa37c7..22907c12a 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -28,7 +28,6 @@ #if MICROPY_VFS && MICROPY_VFS_FAT #include -#include #include "py/nlr.h" #include "py/runtime.h" diff --git a/mpy-cross/main.c b/mpy-cross/main.c index 4c88c7222..ca8d9633f 100644 --- a/mpy-cross/main.c +++ b/mpy-cross/main.c @@ -28,7 +28,6 @@ #include #include #include -#include #include "py/mpstate.h" #include "py/compile.h" diff --git a/py/reader.c b/py/reader.c index 5df45c495..c4d18d53d 100644 --- a/py/reader.c +++ b/py/reader.c @@ -71,7 +71,6 @@ void mp_reader_new_mem(mp_reader_t *reader, const byte *buf, size_t len, size_t #include #include #include -#include typedef struct _mp_reader_posix_t { bool close_fd; From 10842da71ba866ae3be610cac082933e95f12094 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Mon, 24 Jul 2017 12:19:01 +0200 Subject: [PATCH 067/403] Added appglue.start_bpp() --- esp32/modules/appglue.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esp32/modules/appglue.py b/esp32/modules/appglue.py index 1ce84c167..44e858af4 100644 --- a/esp32/modules/appglue.py +++ b/esp32/modules/appglue.py @@ -19,3 +19,8 @@ def start_ota(): esp.rtcmem_write(0,1) esp.rtcmem_write(1,~1) deepsleep.reboot() + +def start_bpp(): + esp.rtcmem_write(0,2) + esp.rtcmem_write(1,~2) + deepsleep.reboot() From f4bab051fdfd3b68b3c7281ea0c3d7d6741e65cb Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Mon, 24 Jul 2017 17:11:52 +0200 Subject: [PATCH 068/403] More magic people, ESP_IDF update --- esp32/Makefile | 2 +- esp32/modules/magic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index e5eed9c43..9e9b5171e 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -32,7 +32,7 @@ ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py BADGE = $(IDF_PATH)/.. # verify the ESP IDF version -ESPIDF_SUPHASH := 8d71d38298444d859f6bbb2aa92bc1c09f19e664 +ESPIDF_SUPHASH := f2f337f6df006ed4e820d06f38a662c16df8c1a4 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) diff --git a/esp32/modules/magic.py b/esp32/modules/magic.py index 7bd5ce5a2..0eaad0b3d 100644 --- a/esp32/modules/magic.py +++ b/esp32/modules/magic.py @@ -1,6 +1,6 @@ import ugfx, appglue, hashlib, ubinascii, time, uos -names = ["Niek Blankers", "Sebastian Oort", "Bas van Sisseren", "Jeroen Domburg", "Christel Sanders", "Markus Bechtold", "Thomas Roos", "Anne Jan Brouwer", "Renze Nicolai", "Aram Verstegen", "Arnout Engelen", "Alexandre Dulaunoy", " Eric Poulsen", "Damien P. George"] +names = ["Niek Blankers", "Sebastian Oort", "Bas van Sisseren", "Jeroen Domburg", "Christel Sanders", "Markus Bechtold", "Thomas Roos", "Anne Jan Brouwer", "Renze Nicolai", "Aram Verstegen", "Arnout Engelen", "Alexandre Dulaunoy", " Eric Poulsen", "Damien P. George", "uGFX", "EMF Badge Team"] def action_exit(pushed): if (pushed): From 38804134e52babbeef14d45cc2a67c216a33e78f Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Mon, 24 Jul 2017 17:25:08 +0200 Subject: [PATCH 069/403] ussl should be smaller now --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index 9e9b5171e..009f86cae 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -32,7 +32,7 @@ ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py BADGE = $(IDF_PATH)/.. # verify the ESP IDF version -ESPIDF_SUPHASH := f2f337f6df006ed4e820d06f38a662c16df8c1a4 +ESPIDF_SUPHASH := ff86defb82fecef9d21b4f3fcf72b5be2881ec2d ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) From 200aec4e8b7f8a1946dff9697cf19bd3eaa16e27 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Mon, 24 Jul 2017 17:48:23 +0200 Subject: [PATCH 070/403] Uppded TASK_HEAP to 88K --- esp32/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/main.c b/esp32/main.c index c7e8dbbd3..ec6f7dd6b 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -62,7 +62,7 @@ #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1) #define MP_TASK_STACK_SIZE ( 8 * 1024) #define MP_TASK_STACK_LEN (MP_TASK_STACK_SIZE / sizeof(StackType_t)) -#define MP_TASK_HEAP_SIZE (80 * 1024) +#define MP_TASK_HEAP_SIZE (88 * 1024) STATIC StaticTask_t mp_task_tcb; STATIC StackType_t mp_task_stack[MP_TASK_STACK_LEN] __attribute__((aligned (8))); From 7e04cc317812e0dc06d9757dbdf9ca664feefa22 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 01:17:30 +0200 Subject: [PATCH 071/403] More python, but getting there! --- esp32/modules/deepsleep.py | 12 +- esp32/modules/services.py | 10 +- esp32/modules/splash.py | 240 +++++++++++++------------------------ 3 files changed, 93 insertions(+), 169 deletions(-) diff --git a/esp32/modules/deepsleep.py b/esp32/modules/deepsleep.py index fa37aa7e6..2eed2379b 100644 --- a/esp32/modules/deepsleep.py +++ b/esp32/modules/deepsleep.py @@ -1,11 +1,11 @@ -import machine as m +import machine -p = m.Pin(25) -r = m.RTC() -r.wake_on_ext0(pin = p, level = 0) +pin = machine.Pin(25) +rtc = machine.RTC() +rtc.wake_on_ext0(pin = pin, level = 0) def start_sleeping(time=0): - m.deepsleep(time) + machine.deepsleep(time) def reboot(): - m.deepsleep(1) + machine.deepsleep(1) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index ea6917411..6f941544b 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -11,30 +11,27 @@ def setup(): except OSError: print("[SERVICES] Can't setup services: no lib folder!") return False - status = True #True if no error occured + found = False for app in apps: try: files = uos.listdir('lib/'+app) except OSError: print("[SERVICES] Listing app files for app '"+app+"' failed!") - return False - found = False for f in files: if (f=="service.py"): found = True - print("[SERVICES] Running service "+app+"...") + print("[SERVICES] Found service "+app+"...") try: srv = __import__('lib/'+app+'/service') services.append(srv) #Add to global list srv.setup() except BaseException as msg: print("Exception in service setup "+app+": ", msg) - status = False #Error: status is now False break if not found: print("[SERVICES] App '"+app+"' has no service") - return status + return found def loop(lcnt): noSleep = False @@ -48,7 +45,6 @@ def loop(lcnt): return noSleep def draw(): - noSleep = False global services x = 0 y = 114 diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index d27923a0d..1bb9edfa7 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -3,36 +3,11 @@ # SHA2017 badge home screen # Renze Nicolai # Thomas Roos - -# BPP -def bpp_time(): - val = esp.rtcmem_read(255) - if esp.rtcmem_read(255)() > 5: - return True - else: - val += 1 - return False - # TIME -def clockstring(): - [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() - monthstr = str(month) - if (month<10): - monthstr = "0"+monthstr - daystr = str(mday) - if (mday<10): - daystr = "0"+daystr - hourstr = str(hour) - if (hour<10): - hourstr = "0"+hourstr - minstr = str(min) - if (min<10): - minstr = "0"+minstr - return daystr+"-"+monthstr+"-"+str(year)+" "+hourstr+":"+minstr def set_time_ntp(): draw_msg("Configuring clock...", "Connecting to WiFi...") - if (connectWiFi()): + if connectWiFi()) draw_msg("Configuring clock...", "Setting time over NTP...") ntp.set_NTP_time() draw_msg("Configuring clock...", "Done!") @@ -99,7 +74,7 @@ def draw_helper_battery(percent,cstate): else: ugfx.string(5,5,"empty","Roboto_Regular12",header_bg) else: - ugfx.string(2,5,"no batt","Roboto_Regular12",header_bg) + ugfx.string(2,5,"no batt","Roat_status = boto_Regular12",header_bg) def draw_helper_header(text): global header_fg @@ -125,33 +100,41 @@ def draw_helper_flush(full): ugfx.flush() ugfx.set_lut(ugfx.LUT_FASTER) -def draw_home(full_clear, going_to_sleep): - global update_available - global update_name - global update_build +def draw_home(do_BPP): + + vBatt = badge.battery_volt_sense() + vBatt += vDrop + + width = (vBatt-vMin) / (vMax-vMin) * 38 + width = 0 if width < 0 + width = 38 if width > 38 - if (update_available): - status = "OTA update available" + ugfx.box(2,2,40,18,ugfx.BLACK) + ugfx.box(42,7,2,8,ugfx.BLACK) + ugfx.area(3,3,w,16,ugfx.BLACK) + + + if badge.battery_charge_status(): + bat_status = 'Charging...' + elif vbat > 100: + bat_status = str(round(vBatt/1000, 2)) + 'v' + else: + bat_status = 'No battery' + + ugfx.string(47, 2, bat_status,'Roboto_Regular18',ugfx.BLACK) - if full_clear: - draw_helper_clear(full_clear) # CLEAR SCREEN - draw_helper_header(status) - draw_helper_battery(percent, cstate) - if (going_to_sleep): + if do_BPP: info = "[ ANY: Wake up ]" - elif (status=="BPP"): - info = "[ ANY: Exit BPP ]" + elif OTA_available: + info = "[ B: OTA ] [ START: LAUNCHER ]" + ugfx.string(0, 108, 'OTA ready!', "Roboto_Regular18",ugfx.BLACK) else: info = "[ START: LAUNCHER ]" - clock = clockstring() - - if (update_available): - ugfx.string(0, 25, "Update to version "+str(update_build)+ " '"+update_name+"' available","Roboto_Regular12",ugfx.BLACK) - info = "[ B: OTA UPDATE ] "+info - clock = "" + l = ugfx.get_string_width(info,"Roboto_Regular12") + ugfx.string(296-l, 115, info, "Roboto_Regular12",ugfx.BLACK) draw_helper_footer(clock,info) draw_helper_nick("Unknown") @@ -159,48 +142,25 @@ def draw_home(full_clear, going_to_sleep): draw_helper_flush(True) # START LAUNCHER -def start_launcher(pushed): - if(pushed): - print("[SPLASH] Starting launcher...") - global splashTimer - splashTimer.deinit() - increment_reboot_counter() - appglue.start_app("launcher") +def press_start(pushed): + appglue.start_app("launcher") if pushed def start_ota(pushed): - if(pushed): - print("[SPLASH] Starting OTA...") - appglue.start_ota() + appglue.start_ota() if pushed # NOTHING -def nothing(pressed): - if (pressed): - reset_countdown() - -# MAGIC -def actually_start_magic(): - print("[SPLASH] Starting magic...") - esp.rtcmem_write_string("magic") - deepsleep.reboot() - -magic = 0 -def start_magic(pushed): - reset_countdown() - global magic - if(pushed): - magic = magic + 1 - if (magic>10): - actually_start_magic() +def press_nothing(pushed): + loopCnt = badge.nvs_get_u8('splash', 'timer.amount', 25) if pushed + +def press_a(pushed): + if pushed: + loopCnt = badge.nvs_get_u8('splash', 'timer.amount', 25) + magic += 1 + if magic > 9: + appglue.start_app('magic') else: print("[SPLASH] Magic in "+str(10-magic)+"...") -# SLEEP -def badge_sleep(): - increment_reboot_counter() - global sleep_duration - print("[SPLASH] Going to sleep now...") - badge.eink_busy_wait() #Always wait for e-ink - deepsleep.start_sleeping(sleep_duration*1000) def sleepIfEmpty(vbatt): global battery_volt_min @@ -214,18 +174,17 @@ def sleepIfEmpty(vbatt): # TIMER def splashTimer_callback(tmr): - global loopCnt - global timer_loop_amount - #print("[TIMER] "+str(loopCnt)) - if loopCnt<1: - loopCnt = timer_loop_amount - draw_home(False, True) - gc.collect() + try: + loopCount + except NameError: + loopCount = badge.nvs_get_u8('splash', 'timer.amount', 25) + draw_home(False) else: - if not (loop_services(loopCnt)): - loopCnt = loopCnt - 1 - -def reset_countdown(): + if loopCnt<1: + draw_home(True) + else: + if not services.loop(loopCnt): + loopCnt -= 1 # WIFI def disableWiFi(): @@ -238,15 +197,11 @@ def connectWiFi(): nw.active(True) ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') password = badge.nvs_get_str('badge', 'wifi.password') - if password: - sta_if.connect(ssid, password) - else: - sta_if.connect(ssid) + sta_if.connect(ssid, password) if password else sta_if.connect(ssid) draw_msg("Wi-Fi actived", "Connecting to '"+ssid+"'...") - global wifi_timeout - timeout = wifi_timeout + timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) while not nw.isconnected(): time.sleep(0.1) timeout = timeout - 1 @@ -280,87 +235,60 @@ def download_ota_info(): return result def check_ota_available(): - global update_available - global update_name - global update_build - if connectWiFi(): json = download_ota_info() if (json): import version if (json["build"] > version.build): - update_available = True - update_name = json["name"] - update_build = json["build"] ugfx.input_attach(ugfx.BTN_B, start_ota) return True return False def inputInit(): - -def checkFirstBoot(): ugfx.input_init() - ugfx.input_attach(ugfx.BTN_START, start_launcher) - ugfx.input_attach(ugfx.BTN_A, start_magic) - ugfx.input_attach(ugfx.BTN_B, nothing) - ugfx.input_attach(ugfx.BTN_SELECT, nothing) - ugfx.input_attach(ugfx.JOY_UP, nothing) - ugfx.input_attach(ugfx.JOY_DOWN, nothing) - ugfx.input_attach(ugfx.JOY_LEFT, nothing) - ugfx.input_attach(ugfx.JOY_RIGHT, nothing) - + ugfx.input_attach(ugfx.BTN_START, press_start) + ugfx.input_attach(ugfx.BTN_A, press_a) + ugfx.input_attach(ugfx.BTN_B, press_nothing) + ugfx.input_attach(ugfx.BTN_SELECT, press_nothing) + ugfx.input_attach(ugfx.JOY_UP, press_nothing) + ugfx.input_attach(ugfx.JOY_DOWN, press_nothing) + ugfx.input_attach(ugfx.JOY_LEFT, press_nothing) + ugfx.input_attach(ugfx.JOY_RIGHT, press_nothing) -# MAIN -header_status_string = "" +def checkFirstBoot(): + setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) + if (setupcompleted==0): # First boot (open setup) + print("[SPLASH] Setup not completed. Running setup!") + appglue.start_app("setup") + elif (setupcompleted==1): # Second boot (after setup) + print("[SPLASH] Showing sponsors once...") + badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once + appglue.start_app("sponsors") + else: # Setup completed + print("[SPLASH] Normal boot.") header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) -if (header_inv>0): - header_fg = ugfx.WHITE - header_bg = ugfx.BLACK -header_hws = badge.nvs_get_u8('splash', 'header.hws', 0) #Hide While Sleeping -if (header_hws>0): - header_hide_while_sleeping = True -header_hbws = badge.nvs_get_u8('splash', 'header.hbws', 0) #Hide Battery While Sleeping -if (header_hbws>0): - header_hide_battery_while_sleeping = True -sleep_duration = badge.nvs_get_u8('splash', 'sleep.duration', 60) -if (sleep_duration<30): - print("[SPLASH] Sleep duration set to less than 30 seconds. Forcing 30 seconds.") - sleep_duration = 30 -#if (sleep_duration>120): -# print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") -battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3500) # mV -# Just bellow brownout, real battery voltage may be higher due to voltage drop over polyfuse -battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4100) # mV -# Lower than charge voltage, to display (almost) full when battery has stopped charging -battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 25) # % -wifi_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries -bpp_after_count = badge.nvs_get_u8('splash', 'bpp.count', 5) -splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 200) -timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) -loopCnt = timer_loop_amount + +vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV +vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV +vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 100) # mV inputInit() +magic = 0 checkFirstBoot() -if (time.time() < 1482192000): #If clock on time before 2017 - doOTA = set_time_ntp() -else: - doOTA = True +: #If clock on time before 2017 +doOTA = set_time_ntp() if (time.time() < 1482192000) else doOTA = True if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and doOTA: - check_ota_available() + OTA_available = check_ota_available() +disableWiFi() -if (esp.rtcmem_read(255)==0): - draw_home(True, False) -else: - draw_home(False, False) +foundService = services.setup() -services.setup() +splashTimer = machine.Timer(-1) +splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.PERIODIC, callback=splashTimer_callback) -splashTimer = machine.Timer(0) -splashTimer.init(period=100, mode=machine.Timer.PERIODIC, callback=splashTimer_callback) -# FIXME PEROID flexibel maken gc.collect() From 4d1fb6107fdedb0dda8dfb1491c033bf731222c6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 25 Jul 2017 11:32:04 +1000 Subject: [PATCH 072/403] py/mpz: Make mpz_is_zero() an inline function. It's more efficient as an inline function, and saves code size. --- py/mpz.c | 4 ---- py/mpz.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/py/mpz.c b/py/mpz.c index f5675a291..80473df88 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -939,10 +939,6 @@ void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byte *buf) z->len = mpn_remove_trailing_zeros(z->dig, z->dig + z->len); } -bool mpz_is_zero(const mpz_t *z) { - return z->len == 0; -} - #if 0 these functions are unused diff --git a/py/mpz.h b/py/mpz.h index 878febf8b..2ff404ffa 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -111,7 +111,7 @@ void mpz_set_from_float(mpz_t *z, mp_float_t src); size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg, unsigned int base); void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byte *buf); -bool mpz_is_zero(const mpz_t *z); +static inline bool mpz_is_zero(const mpz_t *z) { return z->len == 0; } int mpz_cmp(const mpz_t *lhs, const mpz_t *rhs); void mpz_abs_inpl(mpz_t *dest, const mpz_t *z); From 04552ff71b6c722b21597d93481f024c72457cef Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 25 Jul 2017 11:49:22 +1000 Subject: [PATCH 073/403] py: Implement raising a big-int to a negative power. Before this patch raising a big-int to a negative power would just return 0. Now it returns a floating-point number with the correct value. --- py/mpz.c | 4 ---- py/mpz.h | 1 + py/objint_longlong.c | 7 +++++++ py/objint_mpz.c | 7 +++++++ tests/float/int_big_float.py | 4 ++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/py/mpz.c b/py/mpz.c index 80473df88..f58e262e2 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -946,10 +946,6 @@ bool mpz_is_pos(const mpz_t *z) { return z->len > 0 && z->neg == 0; } -bool mpz_is_neg(const mpz_t *z) { - return z->len > 0 && z->neg != 0; -} - bool mpz_is_odd(const mpz_t *z) { return z->len > 0 && (z->dig[0] & 1) != 0; } diff --git a/py/mpz.h b/py/mpz.h index 2ff404ffa..55967cc4c 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -112,6 +112,7 @@ size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg, unsigne void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byte *buf); static inline bool mpz_is_zero(const mpz_t *z) { return z->len == 0; } +static inline bool mpz_is_neg(const mpz_t *z) { return z->len != 0 && z->neg != 0; } int mpz_cmp(const mpz_t *lhs, const mpz_t *rhs); void mpz_abs_inpl(mpz_t *dest, const mpz_t *z); diff --git a/py/objint_longlong.c b/py/objint_longlong.c index eb80407bc..1d184a7dc 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -191,6 +191,13 @@ mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { case MP_BINARY_OP_POWER: case MP_BINARY_OP_INPLACE_POWER: { + if (rhs_val < 0) { + #if MICROPY_PY_BUILTINS_FLOAT + return mp_obj_float_binary_op(op, lhs_val, rhs_in); + #else + mp_raise_ValueError("negative power with no float support"); + #endif + } long long ans = 1; while (rhs_val > 0) { if (rhs_val & 1) { diff --git a/py/objint_mpz.c b/py/objint_mpz.c index d818b6f40..26492aab4 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -290,6 +290,13 @@ mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { case MP_BINARY_OP_POWER: case MP_BINARY_OP_INPLACE_POWER: + if (mpz_is_neg(zrhs)) { + #if MICROPY_PY_BUILTINS_FLOAT + return mp_obj_float_binary_op(op, mpz_as_float(zlhs), rhs_in); + #else + mp_raise_ValueError("negative power with no float support"); + #endif + } mpz_pow_inpl(&res->mpz, zlhs, zrhs); break; diff --git a/tests/float/int_big_float.py b/tests/float/int_big_float.py index b1a26ca73..0bd166218 100644 --- a/tests/float/int_big_float.py +++ b/tests/float/int_big_float.py @@ -18,6 +18,10 @@ # this should delegate to complex print("%.5g" % (i * 1.2j).imag) +# negative power should produce float +print("%.5g" % (i ** -1)) +print("%.5g" % ((2 + i - i) ** -3)) + try: i / 0 except ZeroDivisionError: From a10467b58ab92352217c7ab42eafd320bb671565 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 3 Mar 2017 15:46:23 +1100 Subject: [PATCH 074/403] extmod/modussl_mbedtls: When reading and peer wants to close, return 0. If this particular code is returned then there's no more data, it's not really an error. --- extmod/modussl_mbedtls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index f4b551cb9..ef3f319fe 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -192,6 +192,10 @@ STATIC mp_uint_t socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errc mp_obj_ssl_socket_t *o = MP_OBJ_TO_PTR(o_in); int ret = mbedtls_ssl_read(&o->ssl, buf, size); + if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) { + // end of stream + return 0; + } if (ret >= 0) { return ret; } From 363087aa11a5121ecff38f9e3a2372a42fa224ac Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 24 Jul 2017 12:58:30 +0200 Subject: [PATCH 075/403] extmod/modframebuf: Fix invalid stride for odd widths in GS4_HMSB fmt. Since the stride is specified in pixels, in a 4-bit horizontal format it has to always be even, otherwise the computation is wrong and we can write outside of the buffer sometimes. --- extmod/modframebuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index 062a63c3b..00a48379b 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -237,12 +237,14 @@ STATIC mp_obj_t framebuf_make_new(const mp_obj_type_t *type, size_t n_args, size switch (o->format) { case FRAMEBUF_MVLSB: case FRAMEBUF_RGB565: - case FRAMEBUF_GS4_HMSB: break; case FRAMEBUF_MHLSB: case FRAMEBUF_MHMSB: o->stride = (o->stride + 7) & ~7; break; + case FRAMEBUF_GS4_HMSB: + o->stride = (o->stride + 1) & ~1; + break; default: mp_raise_ValueError("invalid format"); } From 0893b273b9471acb02510820f61753501dc04219 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 25 Jul 2017 14:00:45 +1000 Subject: [PATCH 076/403] extmod/modussl_mbedtls: Make socket.close() free all TLS resources. Also, use mp_stream_close() helper to close the underlying socket. --- extmod/modussl_mbedtls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index ef3f319fe..8c90c2cf4 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -227,15 +227,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking); STATIC mp_obj_t socket_close(mp_obj_t self_in) { mp_obj_ssl_socket_t *self = MP_OBJ_TO_PTR(self_in); + mbedtls_pk_free(&self->pkey); + mbedtls_x509_crt_free(&self->cert); mbedtls_x509_crt_free(&self->cacert); mbedtls_ssl_free(&self->ssl); mbedtls_ssl_config_free(&self->conf); mbedtls_ctr_drbg_free(&self->ctr_drbg); mbedtls_entropy_free(&self->entropy); - mp_obj_t dest[2]; - mp_load_method(self->sock, MP_QSTR_close, dest); - return mp_call_method_n_kw(0, 0, dest); + return mp_stream_close(self->sock); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_close_obj, socket_close); From f3687109d56793b73288e081a5f4ad6884ded28d Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 25 Jul 2017 14:06:44 +1000 Subject: [PATCH 077/403] extmod/modframebuf: Consistently use "col" as name for colour variables. Thanks to @kamikaze, aka Oleg Korsak, for the original idea and patch. --- extmod/modframebuf.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index 00a48379b..779214bb7 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -62,10 +62,10 @@ typedef struct _mp_framebuf_p_t { // Functions for MHLSB and MHMSB -STATIC void mono_horiz_setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t color) { +STATIC void mono_horiz_setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t col) { size_t index = (x + y * fb->stride) >> 3; int offset = fb->format == FRAMEBUF_MHMSB ? x & 0x07 : 7 - (x & 0x07); - ((uint8_t*)fb->buf)[index] = (((uint8_t*)fb->buf)[index] & ~(0x01 << offset)) | ((color != 0) << offset); + ((uint8_t*)fb->buf)[index] = (((uint8_t*)fb->buf)[index] & ~(0x01 << offset)) | ((col != 0) << offset); } STATIC uint32_t mono_horiz_getpixel(const mp_obj_framebuf_t *fb, int x, int y) { @@ -90,10 +90,10 @@ STATIC void mono_horiz_fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int // Functions for MVLSB format -STATIC void mvlsb_setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t color) { +STATIC void mvlsb_setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t col) { size_t index = (y >> 3) * fb->stride + x; uint8_t offset = y & 0x07; - ((uint8_t*)fb->buf)[index] = (((uint8_t*)fb->buf)[index] & ~(0x01 << offset)) | ((color != 0) << offset); + ((uint8_t*)fb->buf)[index] = (((uint8_t*)fb->buf)[index] & ~(0x01 << offset)) | ((col != 0) << offset); } STATIC uint32_t mvlsb_getpixel(const mp_obj_framebuf_t *fb, int x, int y) { @@ -114,19 +114,19 @@ STATIC void mvlsb_fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, in // Functions for RGB565 format -STATIC void rgb565_setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t color) { - ((uint16_t*)fb->buf)[x + y * fb->stride] = color; +STATIC void rgb565_setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t col) { + ((uint16_t*)fb->buf)[x + y * fb->stride] = col; } STATIC uint32_t rgb565_getpixel(const mp_obj_framebuf_t *fb, int x, int y) { return ((uint16_t*)fb->buf)[x + y * fb->stride]; } -STATIC void rgb565_fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, int h, uint32_t colour) { +STATIC void rgb565_fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, int h, uint32_t col) { uint16_t *b = &((uint16_t*)fb->buf)[x + y * fb->stride]; while (h--) { for (int ww = w; ww; --ww) { - *b++ = colour; + *b++ = col; } b += fb->stride - w; } @@ -156,7 +156,7 @@ STATIC void gs4_hmsb_fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, col &= 0x0f; uint8_t *pixel_pair = &((uint8_t*)fb->buf)[(x + y * fb->stride) >> 1]; uint8_t col_shifted_left = col << 4; - uint8_t colored_pixel_pair = col_shifted_left | col; + uint8_t col_pixel_pair = col_shifted_left | col; int pixel_count_till_next_line = (fb->stride - w) >> 1; bool odd_x = (x % 2 == 1); @@ -169,7 +169,7 @@ STATIC void gs4_hmsb_fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, ww--; } - memset(pixel_pair, colored_pixel_pair, ww >> 1); + memset(pixel_pair, col_pixel_pair, ww >> 1); pixel_pair += ww >> 1; if (ww % 2) { @@ -191,8 +191,8 @@ STATIC mp_framebuf_p_t formats[] = { [FRAMEBUF_MHMSB] = {mono_horiz_setpixel, mono_horiz_getpixel, mono_horiz_fill_rect}, }; -static inline void setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t color) { - formats[fb->format].setpixel(fb, x, y, color); +static inline void setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t col) { + formats[fb->format].setpixel(fb, x, y, col); } static inline uint32_t getpixel(const mp_obj_framebuf_t *fb, int x, int y) { @@ -277,9 +277,9 @@ STATIC mp_obj_t framebuf_fill_rect(size_t n_args, const mp_obj_t *args) { mp_int_t y = mp_obj_get_int(args[2]); mp_int_t width = mp_obj_get_int(args[3]); mp_int_t height = mp_obj_get_int(args[4]); - mp_int_t color = mp_obj_get_int(args[5]); + mp_int_t col = mp_obj_get_int(args[5]); - fill_rect(self, x, y, width, height, color); + fill_rect(self, x, y, width, height, col); return mp_const_none; } @@ -444,14 +444,13 @@ STATIC mp_obj_t framebuf_blit(size_t n_args, const mp_obj_t *args) { int y1 = MAX(0, -y); int x0end = MIN(self->width, x + source->width); int y0end = MIN(self->height, y + source->height); - uint32_t color; for (; y0 < y0end; ++y0) { int cx1 = x1; for (int cx0 = x0; cx0 < x0end; ++cx0) { - color = getpixel(source, cx1, y1); - if (color != (uint32_t)key) { - setpixel(self, cx0, y0, color); + uint32_t col = getpixel(source, cx1, y1); + if (col != (uint32_t)key) { + setpixel(self, cx0, y0, col); } ++cx1; } From db5708ba03f1f289918c03a5830b930495aa1815 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 12:03:39 +0200 Subject: [PATCH 078/403] Kinda works again.. :) --- esp32/modules/services.py | 4 +- esp32/modules/splash.py | 119 ++++++++++---------------------------- 2 files changed, 34 insertions(+), 89 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 6f941544b..4007b2096 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -11,7 +11,7 @@ def setup(): except OSError: print("[SERVICES] Can't setup services: no lib folder!") return False - found = False + found = False for app in apps: try: files = uos.listdir('lib/'+app) @@ -55,3 +55,5 @@ def draw(): y = y - abs(space_used) except BaseException as msg: print("[SERVICES] Service draw exception: ", msg) + +services = [] diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 1bb9edfa7..c7275eddf 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,4 +1,4 @@ -import ugfx, time, badge, machine, appglue, deepsleep, network, esp, gc, services +import ugfx, time, ntp, badge, machine, appglue, deepsleep, network, esp, gc, services # SHA2017 badge home screen # Renze Nicolai @@ -7,7 +7,7 @@ def set_time_ntp(): draw_msg("Configuring clock...", "Connecting to WiFi...") - if connectWiFi()) + if connectWiFi(): draw_msg("Configuring clock...", "Setting time over NTP...") ntp.set_NTP_time() draw_msg("Configuring clock...", "Done!") @@ -34,71 +34,6 @@ def draw_msg(title, desc): ugfx.set_lut(ugfx.LUT_FASTEST) ugfx.flush() -def draw_dialog(title, desc, msg): - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) - ugfx.string(0, 25, desc, "Roboto_Regular12", ugfx.BLACK) - ugfx.string(0, 50, msg, "Roboto_Regular12", ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTER) - ugfx.flush() - -def draw_logo(x,y,h): - ugfx.string(x + 20, y,"STILL","Roboto_BlackItalic24",ugfx.BLACK) - ugfx.string(x, y+25,h,"PermanentMarker22",ugfx.BLACK) - len = ugfx.get_string_width(h,"PermanentMarker22") - ugfx.line(x, y + 47, x + 14 + len, y + 47, ugfx.BLACK) - ugfx.line(x + 10 + len, y + 27, x + 10 + len, y + 45, ugfx.BLACK) - ugfx.string(x + 10, y + 50,"Anyway","Roboto_BlackItalic24",ugfx.BLACK) - -def draw_helper_clear(full): - if full: - ugfx.clear(ugfx.BLACK) - ugfx.flush() - ugfx.clear(ugfx.WHITE) - if full: - ugfx.flush() - -def draw_helper_battery(percent,cstate): - global header_fg - global header_bg - ugfx.area(2,2,40,18,header_fg) - ugfx.box(42,7,2,8,header_fg) - if (percent>0): - if (cstate): - ugfx.string(5,5,"chrg","Roboto_Regular12",header_bg) - else: - if (percent>10): - w = round((percent*38)/100) - ugfx.area(3,3,38,16,ugfx.WHITE) - ugfx.area(3,3,w,16,ugfx.BLACK) - else: - ugfx.string(5,5,"empty","Roboto_Regular12",header_bg) - else: - ugfx.string(2,5,"no batt","Roat_status = boto_Regular12",header_bg) - -def draw_helper_header(text): - global header_fg - global header_bg - ugfx.area(0,0,ugfx.width(),23,header_bg) - ugfx.string(45, 1, text,"DejaVuSans20",header_fg) - -def draw_helper_footer(text_l, text_r): - ugfx.string(0, ugfx.height()-13, text_l, "Roboto_Regular12",ugfx.BLACK) - l = ugfx.get_string_width(text_r,"Roboto_Regular12") - ugfx.string(ugfx.width()-l, ugfx.height()-13, text_r, "Roboto_Regular12",ugfx.BLACK) - -def draw_helper_nick(default): - nick = badge.nvs_get_str("owner", "name", default) - ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) - htext = badge.nvs_get_str("owner", "htext", "") - if (htext!=""): - draw_logo(160, 25, htext) - -def draw_helper_flush(full): - if (full): - ugfx.set_lut(ugfx.LUT_FULL) - ugfx.flush() - ugfx.set_lut(ugfx.LUT_FASTER) def draw_home(do_BPP): @@ -106,17 +41,20 @@ def draw_home(do_BPP): vBatt += vDrop width = (vBatt-vMin) / (vMax-vMin) * 38 - width = 0 if width < 0 - width = 38 if width > 38 + if width < 0: + width = 0 + elif width < 38: + width = 38 + ugfx.box(2,2,40,18,ugfx.BLACK) ugfx.box(42,7,2,8,ugfx.BLACK) - ugfx.area(3,3,w,16,ugfx.BLACK) + ugfx.area(3,3,width,16,ugfx.BLACK) if badge.battery_charge_status(): bat_status = 'Charging...' - elif vbat > 100: + elif vBatt > 100: bat_status = str(round(vBatt/1000, 2)) + 'v' else: bat_status = 'No battery' @@ -136,21 +74,24 @@ def draw_home(do_BPP): l = ugfx.get_string_width(info,"Roboto_Regular12") ugfx.string(296-l, 115, info, "Roboto_Regular12",ugfx.BLACK) - draw_helper_footer(clock,info) - draw_helper_nick("Unknown") - draw_services() - draw_helper_flush(True) + ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) + services.draw() + + ugfx.flush() # START LAUNCHER def press_start(pushed): - appglue.start_app("launcher") if pushed + if pushed: + appglue.start_app("launcher") def start_ota(pushed): - appglue.start_ota() if pushed + if pushed: + appglue.start_ota() # NOTHING def press_nothing(pushed): - loopCnt = badge.nvs_get_u8('splash', 'timer.amount', 25) if pushed + if pushed: + loopCnt = badge.nvs_get_u8('splash', 'timer.amount', 25) def press_a(pushed): if pushed: @@ -197,7 +138,7 @@ def connectWiFi(): nw.active(True) ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') password = badge.nvs_get_str('badge', 'wifi.password') - sta_if.connect(ssid, password) if password else sta_if.connect(ssid) + nw.connect(ssid, password) if password else nw.connect(ssid) draw_msg("Wi-Fi actived", "Connecting to '"+ssid+"'...") @@ -257,18 +198,18 @@ def inputInit(): def checkFirstBoot(): setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) - if (setupcompleted==0): # First boot (open setup) - print("[SPLASH] Setup not completed. Running setup!") - appglue.start_app("setup") - elif (setupcompleted==1): # Second boot (after setup) - print("[SPLASH] Showing sponsors once...") - badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once + if (setupcompleted==0): # First boot (open setup) + print("[SPLASH] Setup not completed. Running setup!") + appglue.start_app("setup") + elif (setupcompleted==1): # Second boot (after setup) + print("[SPLASH] Showing sponsors once...") + badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once appglue.start_app("sponsors") else: # Setup completed print("[SPLASH] Normal boot.") header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) - +nick = badge.nvs_get_str("owner", "name", 'John Doe') vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 100) # mV @@ -278,11 +219,13 @@ def checkFirstBoot(): checkFirstBoot() -: #If clock on time before 2017 -doOTA = set_time_ntp() if (time.time() < 1482192000) else doOTA = True +#If clock on time before 2017 +doOTA = set_time_ntp() if time.time() < 1482192000 else True if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and doOTA: OTA_available = check_ota_available() +else: + OTA_available = False disableWiFi() From 8d536661c6123a74b8b5f743a99c5fc6a22a5e75 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 13:16:10 +0200 Subject: [PATCH 079/403] remove broken logging --- esp32/modules/services.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 4007b2096..1ba7c367d 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -29,8 +29,6 @@ def setup(): except BaseException as msg: print("Exception in service setup "+app+": ", msg) break - if not found: - print("[SERVICES] App '"+app+"' has no service") return found def loop(lcnt): From 1722172c2f9caf98d41d002be002c75d1140e197 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 25 Jul 2017 13:48:22 +0200 Subject: [PATCH 080/403] Minimal sdkconfig.h for unix build --- esp32/Makefile | 2 +- unix/sdkconfig.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 unix/sdkconfig.h diff --git a/esp32/Makefile b/esp32/Makefile index 009f86cae..d1fb71185 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -32,7 +32,7 @@ ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py BADGE = $(IDF_PATH)/.. # verify the ESP IDF version -ESPIDF_SUPHASH := ff86defb82fecef9d21b4f3fcf72b5be2881ec2d +ESPIDF_SUPHASH := 9d7bd83209ab23b6df901c793e02e65532771d0e ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) diff --git a/unix/sdkconfig.h b/unix/sdkconfig.h new file mode 100644 index 000000000..d0d9591a5 --- /dev/null +++ b/unix/sdkconfig.h @@ -0,0 +1 @@ +#define CONFIG_LOG_DEFAULT_LEVEL 0 From 3ba24551b1ba0153986fa197e7081969a0d9d137 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 15:35:40 +0200 Subject: [PATCH 081/403] Update makefile --- esp32/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index d1fb71185..8d01d5421 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -18,7 +18,7 @@ include ../py/py.mk PORT ?= /dev/ttyUSB0 BAUD ?= 921600 FLASH_MODE ?= dio -FLASH_FREQ ?= 40m +FLASH_FREQ ?= 80m FLASH_SIZE ?= 16MB CROSS_COMPILE ?= xtensa-esp32-elf- @@ -32,7 +32,7 @@ ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py BADGE = $(IDF_PATH)/.. # verify the ESP IDF version -ESPIDF_SUPHASH := 9d7bd83209ab23b6df901c793e02e65532771d0e +ESPIDF_SUPHASH := 8b274cd5a5d193a82b49aef384c303b105eda700 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) @@ -325,6 +325,7 @@ ESPIDF_APP_UPDATE_O = $(addprefix $(ESPCOMP)/app_update/,\ ESPIDF_BOOTLOADER_O = $(addprefix $(ESPCOMP)/bootloader_support/src/,\ esp_image_format.o \ + bootloader_sha.o \ bootloader_flash.o \ ) @@ -777,6 +778,7 @@ $(BUILD)/%.o: %.cpp $(BUILD)/bootloader/$(ESPCOMP)/%.o: CFLAGS += -DBOOTLOADER_BUILD=1 -I$(ESPCOMP)/bootloader_support/include_priv -I$(ESPCOMP)/bootloader/include -I$(ESPCOMP)/bootloader_support/include -I$(ESPCOMP)/micro-ecc/micro-ecc -I$(ESPCOMP)/esp32 -Wno-error=format BOOTLOADER_OBJ = $(addprefix $(BUILD)/bootloader/$(ESPCOMP)/,\ bootloader_support/src/bootloader_flash.o \ + bootloader_support/src/bootloader_sha.o \ bootloader_support/src/bootloader_random.o \ bootloader_support/src/secure_boot_signatures.o \ bootloader_support/src/secure_boot.o \ From 58f78746ae883add3c74d6782b9a15598d8f8c4f Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 25 Jul 2017 16:01:36 +0200 Subject: [PATCH 082/403] cleanup --- esp32/Roboto-Black22.c | 1 - esp32/Roboto-BlackItalic24.c | 1 - esp32/Roboto-Regular12.c | 1 - esp32/Roboto-Regular18.c | 1 - esp32/Roboto-Regular22.c | 1 - esp32/imgv3_badgers.h | 255 ---- esp32/imgv3_hacking.h | 2306 ---------------------------------- esp32/imgv3_jpeg.h | 900 ------------- 8 files changed, 3466 deletions(-) delete mode 120000 esp32/Roboto-Black22.c delete mode 120000 esp32/Roboto-BlackItalic24.c delete mode 120000 esp32/Roboto-Regular12.c delete mode 120000 esp32/Roboto-Regular18.c delete mode 120000 esp32/Roboto-Regular22.c delete mode 100644 esp32/imgv3_badgers.h delete mode 100644 esp32/imgv3_hacking.h delete mode 100644 esp32/imgv3_jpeg.h diff --git a/esp32/Roboto-Black22.c b/esp32/Roboto-Black22.c deleted file mode 120000 index 8d6d50016..000000000 --- a/esp32/Roboto-Black22.c +++ /dev/null @@ -1 +0,0 @@ -../../components/ugfx/fonts/Roboto-Black22.c \ No newline at end of file diff --git a/esp32/Roboto-BlackItalic24.c b/esp32/Roboto-BlackItalic24.c deleted file mode 120000 index 3dbfd59fe..000000000 --- a/esp32/Roboto-BlackItalic24.c +++ /dev/null @@ -1 +0,0 @@ -../../components/ugfx/fonts/Roboto-BlackItalic24.c \ No newline at end of file diff --git a/esp32/Roboto-Regular12.c b/esp32/Roboto-Regular12.c deleted file mode 120000 index dbc62edc5..000000000 --- a/esp32/Roboto-Regular12.c +++ /dev/null @@ -1 +0,0 @@ -../../components/ugfx/fonts/Roboto-Regular12.c \ No newline at end of file diff --git a/esp32/Roboto-Regular18.c b/esp32/Roboto-Regular18.c deleted file mode 120000 index b32e02286..000000000 --- a/esp32/Roboto-Regular18.c +++ /dev/null @@ -1 +0,0 @@ -../../components/ugfx/fonts/Roboto-Regular18.c \ No newline at end of file diff --git a/esp32/Roboto-Regular22.c b/esp32/Roboto-Regular22.c deleted file mode 120000 index 5994d5a0c..000000000 --- a/esp32/Roboto-Regular22.c +++ /dev/null @@ -1 +0,0 @@ -../../components/ugfx/fonts/Roboto-Regular22.c \ No newline at end of file diff --git a/esp32/imgv3_badgers.h b/esp32/imgv3_badgers.h deleted file mode 100644 index 22c47768d..000000000 --- a/esp32/imgv3_badgers.h +++ /dev/null @@ -1,255 +0,0 @@ -/** - * This file was generated from "/Users/annejan/Downloads/badger1.png" using... - * - * file2c -dcs /Users/annejan/Downloads/badger1.png - * - */ -static const char badger1[] = { - 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, - 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x82, 0xF1, 0x66, - 0x6D, 0x00, 0x00, 0x00, 0x06, 0x50, 0x4C, 0x54, 0x45, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x55, - 0xC2, 0xD3, 0x7E, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0B, 0x13, 0x00, - 0x00, 0x0B, 0x13, 0x01, 0x00, 0x9A, 0x9C, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4D, 0x45, - 0x07, 0xE1, 0x05, 0x1A, 0x0F, 0x00, 0x0A, 0x0D, 0x01, 0xF4, 0x2F, 0x00, 0x00, 0x00, 0x1D, 0x69, - 0x54, 0x58, 0x74, 0x43, 0x6F, 0x6D, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4D, 0x50, - 0x64, 0x2E, 0x65, 0x07, 0x00, 0x00, 0x02, 0x59, 0x49, 0x44, 0x41, 0x54, 0x58, 0xC3, 0xCD, 0xD8, - 0xB1, 0x6E, 0xD4, 0x40, 0x10, 0x00, 0xD0, 0xB5, 0x1C, 0xC5, 0x14, 0xA7, 0x73, 0xCA, 0x14, 0x08, - 0xF3, 0x09, 0x94, 0x14, 0x28, 0x8E, 0x94, 0x82, 0xDF, 0xB8, 0x8E, 0x12, 0xE8, 0xA8, 0xB2, 0x46, - 0x42, 0x50, 0xE6, 0x07, 0x90, 0xF8, 0x94, 0x73, 0x94, 0x9E, 0x5F, 0x60, 0x51, 0x7A, 0xB2, 0x12, - 0x05, 0x1B, 0x65, 0xD9, 0x61, 0x76, 0xEC, 0xA3, 0x62, 0x67, 0x86, 0xC4, 0x8A, 0xE2, 0xE6, 0x4E, - 0xF2, 0xD3, 0xAC, 0x77, 0x76, 0x67, 0xD6, 0x77, 0xC6, 0xDC, 0xFA, 0xB2, 0xA3, 0x6C, 0x8E, 0xCC, - 0xF8, 0x54, 0x44, 0x15, 0xDC, 0x6C, 0x9F, 0x49, 0x68, 0xF3, 0x25, 0x76, 0x10, 0xA4, 0x48, 0x83, - 0x35, 0x0A, 0x05, 0x60, 0x7A, 0x88, 0x8B, 0x28, 0xA3, 0x53, 0x36, 0x69, 0x54, 0x9F, 0x8C, 0x55, - 0x2A, 0x69, 0x8E, 0xA6, 0xCB, 0xEA, 0xAB, 0xA8, 0x22, 0xAA, 0x8F, 0x2A, 0xF5, 0x41, 0xA5, 0xF6, - 0xC5, 0xA7, 0x47, 0x95, 0x44, 0x85, 0xF3, 0xB3, 0xB1, 0x96, 0xD4, 0x37, 0x54, 0x41, 0x54, 0xAF, - 0x51, 0xF9, 0x3D, 0x85, 0xEA, 0xFD, 0x8A, 0x13, 0x39, 0xE5, 0xAF, 0x04, 0x85, 0x9B, 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, 0x1A, 0x15, 0x17, 0x57, 0x46, 0x52, 0xD5, 0x82, - 0xCA, 0xE8, 0x94, 0x55, 0xA9, 0x4A, 0xDA, 0x85, 0x3B, 0xB5, 0x50, 0xAC, 0xA4, 0x8A, 0x95, 0xA8, - 0x44, 0x1E, 0xA8, 0x4A, 0x52, 0x0D, 0x29, 0x32, 0xD1, 0xCC, 0x4A, 0xEC, 0x13, 0x61, 0xFE, 0x51, - 0xCA, 0x77, 0x26, 0x9F, 0x9B, 0x98, 0xF4, 0x36, 0x94, 0x0F, 0x2A, 0x2B, 0xA9, 0x2E, 0xEF, 0x78, - 0x2B, 0x9D, 0x69, 0x26, 0x12, 0xD5, 0xFC, 0xCF, 0xD4, 0x06, 0x8D, 0xAA, 0x46, 0x73, 0x9B, 0xEB, - 0x0F, 0x3C, 0x7C, 0xE7, 0xD2, 0x30, 0x0B, 0xB1, 0x06, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, - 0x44, 0xAE, 0x42, 0x60, 0x82, -}; - -#ifdef ROMFS_DIRENTRY_HEAD - static const ROMFS_DIRENTRY badger1_dir = { 0, 0, ROMFS_DIRENTRY_HEAD, "badger1.png", 757, badger1 }; - #undef ROMFS_DIRENTRY_HEAD - #define ROMFS_DIRENTRY_HEAD &badger1_dir -#endif -/** - * This file was generated from "/Users/annejan/Downloads/badger2.png" using... - * - * file2c -dcs /Users/annejan/Downloads/badger2.png - * - */ -static const char badger2[] = { - 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, - 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x82, 0xF1, 0x66, - 0x6D, 0x00, 0x00, 0x00, 0x06, 0x50, 0x4C, 0x54, 0x45, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x55, - 0xC2, 0xD3, 0x7E, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0B, 0x13, 0x00, - 0x00, 0x0B, 0x13, 0x01, 0x00, 0x9A, 0x9C, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4D, 0x45, - 0x07, 0xE1, 0x05, 0x1A, 0x0F, 0x00, 0x1D, 0x8E, 0xD2, 0x71, 0xE8, 0x00, 0x00, 0x00, 0x1D, 0x69, - 0x54, 0x58, 0x74, 0x43, 0x6F, 0x6D, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4D, 0x50, - 0x64, 0x2E, 0x65, 0x07, 0x00, 0x00, 0x02, 0x72, 0x49, 0x44, 0x41, 0x54, 0x58, 0xC3, 0xD5, 0xD8, - 0xB1, 0x6E, 0x14, 0x31, 0x10, 0x06, 0x60, 0x2F, 0x8B, 0x58, 0x8A, 0x90, 0xA5, 0xA4, 0x40, 0xD9, - 0x3C, 0x02, 0x0F, 0x10, 0x69, 0xD3, 0x51, 0xF2, 0x0A, 0x48, 0xBC, 0x00, 0x12, 0x4D, 0xAA, 0xF8, - 0x50, 0x10, 0x6D, 0x1E, 0xE1, 0x5E, 0x83, 0x06, 0x61, 0x89, 0xE2, 0x3A, 0xF2, 0x08, 0x31, 0xA2, - 0x88, 0xA8, 0xB0, 0x44, 0x63, 0x94, 0xC5, 0x83, 0xC7, 0xDE, 0x95, 0xAE, 0xD8, 0xF5, 0x3F, 0x87, - 0x0E, 0xA4, 0x6C, 0x73, 0x27, 0xDD, 0xA7, 0xB1, 0x3D, 0x9E, 0x1D, 0x5B, 0xA7, 0xD4, 0x1D, 0x7A, - 0xB4, 0xC1, 0xE6, 0x5C, 0x99, 0x67, 0xC8, 0x1C, 0xB5, 0x44, 0xF4, 0x1A, 0x29, 0xBB,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ef ROMFS_DIRENTRY_HEAD - static const ROMFS_DIRENTRY badger2_dir = { 0, 0, ROMFS_DIRENTRY_HEAD, "badger2.png", 782, badger2 }; - #undef ROMFS_DIRENTRY_HEAD - #define ROMFS_DIRENTRY_HEAD &badger2_dir -#endif -/** - * This file was generated from "/Users/annejan/Downloads/badger3.png" using... - * - * file2c -dcs /Users/annejan/Downloads/badger3.png - * - */ -static const char badger3[] = { - 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, - 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x82, 0xF1, 0x66, - 0x6D, 0x00, 0x00, 0x00, 0x06, 0x50, 0x4C, 0x54, 0x45, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x55, - 0xC2, 0xD3, 0x7E, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0B, 0x13, 0x00, - 0x00, 0x0B, 0x13, 0x01, 0x00, 0x9A, 0x9C, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4D, 0x45, - 0x07, 0xE1, 0x05, 0x1A, 0x0F, 0x00, 0x26, 0x3F, 0xD9, 0x98, 0xCC, 0x00, 0x00, 0x00, 0x1D, 0x69, - 0x54, 0x58, 0x74, 0x43, 0x6F, 0x6D, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4D, 0x50, - 0x64, 0x2E, 0x65, 0x07, 0x00, 0x00, 0x02, 0xA6, 0x49, 0x44, 0x41, 0x54, 0x58, 0xC3, 0xED, 0xD8, - 0x31, 0x6F, 0xD5, 0x30, 0x10, 0x00, 0x60, 0x87,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1, 0x26, 0xE5, 0x0C, 0x0D, 0x6E, 0x41, - 0x0D, 0x06, 0xDE, 0xF0, 0x4A, 0x8F, 0xB1, 0x2A, 0x94, 0x37, 0xF4, 0x12, 0x20, 0xEC, 0x23, 0xAA, - 0xF7, 0x7C, 0x8E, 0x74, 0x4F, 0x18, 0xA9, 0x12, 0xCD, 0xA4, 0x92, 0xA0, 0xA2, 0xA8, 0xCA, 0x1D, - 0x9D, 0x7A, 0xE9, 0xCE, 0x29, 0x2F, 0x44, 0xA9, 0x13, 0x15, 0x5E, 0x2D, 0x77, 0x20, 0xDC, 0xD1, - 0xA4, 0xDA, 0x4B, 0xE1, 0xE9, 0x28, 0xD3, 0x3F, 0x53, 0x3D, 0xDC, 0xCD, 0x55, 0x57, 0x6A, 0xD0, - 0x48, 0xCF, 0xB6, 0x2E, 0xD9, 0x35, 0x52, 0x9F, 0x68, 0x4B, 0x76, 0x8D, 0x50, 0xD4, 0x02, 0x42, - 0xA9, 0x6D, 0x90, 0x3E, 0x29, 0x5C, 0x85, 0xEA, 0xCB, 0xBA, 0xAD, 0xD4, 0xA3, 0x9B, 0x44, 0xB5, - 0xAD, 0xF9, 0x7B, 0xA5, 0x4B, 0x15, 0x48, 0xB5, 0xFE, 0xAF, 0xFE, 0xE0, 0xB9, 0x06, 0x8A, 0x88, - 0x00, 0xD0, 0xC9, 0xA5, 0xE6, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, - 0x60, 0x82, -}; - -#ifdef ROMFS_DIRENTRY_HEAD - static const ROMFS_DIRENTRY badger3_dir = { 0, 0, ROMFS_DIRENTRY_HEAD, "badger3.png", 834, badger3 }; - #undef ROMFS_DIRENTRY_HEAD - #define ROMFS_DIRENTRY_HEAD &badger3_dir -#endif -/** - * This file was generated from "/Users/annejan/Downloads/badger4.png" using... - * - * file2c -dcs /Users/annejan/Downloads/badger4.png - * - */ -static const char badger4[] = { - 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, - 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x82, 0xF1, 0x66, - 0x6D, 0x00, 0x00, 0x00, 0x06, 0x50, 0x4C, 0x54, 0x45, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x55, - 0xC2, 0xD3, 0x7E, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0B, 0x13, 0x00, - 0x00, 0x0B, 0x13, 0x01, 0x00, 0x9A, 0x9C, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4D, 0x45, - 0x07, 0xE1, 0x05, 0x1A, 0x0F, 0x00, 0x3B, 0x5C, 0xDF, 0xF4, 0x15, 0x00, 0x00, 0x00, 0x1D, 0x69, - 0x54, 0x58, 0x74, 0x43, 0x6F, 0x6D, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4D, 0x50, - 0x64, 0x2E, 0x65, 0x07, 0x00, 0x00, 0x02, 0x72, 0x49, 0x44, 0x41, 0x54, 0x58, 0xC3, 0xD5, 0xD8, - 0xB1, 0x6E, 0x14, 0x31, 0x10, 0x06, 0x60, 0x2F, 0x8B, 0x58, 0x8A, 0x90, 0xA5, 0xA4, 0x40, 0xD9, - 0x3C, 0x02, 0x0F, 0x10, 0x69, 0xD3, 0x51, 0xF2, 0x0A, 0x48, 0xBC, 0x00, 0x12, 0x4D, 0xAA, 0xF8, - 0x50, 0x10, 0x6D, 0x1E, 0xE1, 0x5E, 0x83, 0x06, 0x61, 0x89, 0xE2, 0x3A, 0xF2, 0x08, 0x31, 0xA2, - 0x88, 0xA8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39, 0x9F, 0x1A, 0xA9, 0x8E, 0x33, 0xA5, 0xD1, 0xD9, 0xA1, 0xCE, 0x12, 0x95, 0xFC, - 0xEB, 0xD3, 0x7A, 0x89, 0xAA, 0x8C, 0xFA, 0x9B, 0xE7, 0x0F, 0xA5, 0x9F, 0x01, 0xD2, 0x83, 0xDF, - 0x0E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82, -}; - -#ifdef ROMFS_DIRENTRY_HEAD - static const ROMFS_DIRENTRY badger4_dir = { 0, 0, ROMFS_DIRENTRY_HEAD, "badger4.png", 782, badger4 }; - #undef ROMFS_DIRENTRY_HEAD - #define ROMFS_DIRENTRY_HEAD &badger4_dir -#endif diff --git a/esp32/imgv3_hacking.h b/esp32/imgv3_hacking.h deleted file mode 100644 index e9a939706..000000000 --- a/esp32/imgv3_hacking.h +++ /dev/null @@ -1,2306 +0,0 @@ -/** - * This file was generated from "../../pictures/hacking.png" using... - * - * file2c -dcs ../../pictures/hacking.png - * - */ -static const char hacking[] = { - 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, - 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x80, 0x08, 0x06, 0x00, 0x00, 0x00, 0xB8, 0x3F, 0xF4, - 0x2E, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4B, 0x47, 0x44, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xA0, - 0xBD, 0xA7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0B, 0x13, 0x00, - 0x00, 0x0B, 0x13, 0x01, 0x00, 0x9A, 0x9C, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4D, 0x45, - 0x07, 0xE1, 0x01, 0x15, 0x0C, 0x29, 0x12, 0xF5, 0x8E, 0xFB, 0x5D, 0x00, 0x00, 0x00, 0x19, 0x74, - 0x45, 0x58, 0x74, 0x43, 0x6F, 0x6D, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4D, 0x50, 0x57, 0x81, 0x0E, 0x17, - 0x00, 0x00, 0x20, 0x00, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA, 0xAC, 0xBD, 0x79, 0x90, 0xA5, 0x67, - 0x59, 0x36, 0x7E, 0x9F, 0x7D, 0x5F, 0xFA, 0x74, 0xF7, 0xF4, 0x32, 0xD3, 0x33, 0x93, 0x59, 0x08, - 0x4B, 0x08, 0x29, 0x0A, 0xE2, 0x12, 0x90, 0xAF, 0x4C, 0x59, 0x10, 0x10, 0x11, 0xFF, 0xA0, 0x4A, - 0xA2, 0x58, 0x85, 0x80, 0x08, 0x85, 0x41, 0x25, 0x54, 0x05, 0x09, 0x14, 0x62, 0x00, 0xD1, 0x44, - 0x28, 0x83, 0xB2, 0x14, 0xA0, 0xFF, 0x08, 0x48, 0x85, 0x58, 0x16, 0x82, 0xAC, 0x6E, 0xA5, 0x10, - 0x25, 0x06, 0x92, 0x49, 0x48, 0x66, 0x26, 0x33, 0x3D, 0x4B, 0x4F, 0xEF, 0x67, 0xE9, 0xB3, 0x6F, - 0xDD, 0xDF, 0x1F, 0xF1, 0x7A, 0xBC, 0xDE, 0xAB, 0x9F, 0xF7, 0xCC, 0xF0, 0xFB, 0x7E, 0x5D, 0xD5, - 0x35, 0x33, 0x3D, 0xA7, 0xCF, 0x79, 0xDF, 0xE7, 0x7D, 0x9E, 0x7B, 0xB9, 0xEE, 0xEB, 0xBE, 0xEE, - 0xC8, 0x6D, 0xB7, 0xDD, 0xB6, 0x17, 0x89, 0x44, 0x6C, 0x6F, 0x6F, 0xCF, 0x22, 0x91, 0x88, 0xC5, - 0x62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x63, - 0xB1, 0x77, 0xA4, 0x2A, 0x58, 0xF8, 0xD1, 0x68, 0xE4, 0xAC, 0x36, 0xAE, 0x91, 0xF3, 0x75, 0xBC, - 0x6F, 0x3E, 0x9F, 0xB7, 0xA5, 0xA5, 0x25, 0x1B, 0x0C, 0x06, 0xB6, 0xB2, 0xB2, 0x62, 0x8D, 0x46, - 0x23, 0x10, 0xC2, 0xA7, 0x52, 0x29, 0x57, 0xFD, 0x82, 0x24, 0x2B, 0x73, 0x50, 0x54, 0x31, 0x10, - 0x1B, 0x9F, 0xF1, 0x25, 0x56, 0x08, 0x2C, 0x16, 0x8B, 0x36, 0x33, 0x33, 0x13, 0x18, 0x2F, 0x0E, - 0x70, 0x1D, 0xD1, 0x04, 0xAB, 0x93, 0x6A, 0x87, 0x3D, 0x97, 0xF1, 0x79, 0x52, 0x2E, 0x2B, 0x99, - 0x72, 0x14, 0xCB, 0x40, 0x25, 0x93, 0x4D, 0x71, 0xD0, 0x30, 0x84, 0x81, 0x53, 0x17, 0xDF, 0x08, - 0x2B, 0xE5, 0x3E, 0x01, 0x5C, 0xCD, 0xE7, 0xF3, 0xFB, 0x22, 0x2E, 0xE6, 0x15, 0xA9, 0x93, 0x62, - 0x4A, 0x08, 0xD3, 0x28, 0xD8, 0xA8, 0xC2, 0x83, 0xA2, 0x9A, 0xCA, 0x43, 0x15, 0xF0, 0x5C, 0x38, - 0xED, 0xD0, 0xB6, 0x24, 0x8E, 0x72, 0x38, 0x4D, 0x65, 0x35, 0xD5, 0x42, 0xA1, 0xE0, 0x26, 0xB1, - 0x1C, 0x3D, 0x7A, 0x34, 0x40, 0x77, 0x40, 0x25, 0x8B, 0x65, 0x9F, 0x41, 0xB0, 0x65, 0x3C, 0x93, - 0xB1, 0x59, 0xE5, 0x06, 0xF9, 0x86, 0x31, 0x40, 0xA6, 0x08, 0x46, 0x1D, 0x03, 0x19, 0x78, 0x62, - 0x34, 0x47, 0xB3, 0x4C, 0x6F, 0x51, 0x1E, 0x14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16, 0x9A, 0xE9, 0x1D, 0x1D, 0x1D, 0x61, - 0x7E, 0x7E, 0xDE, 0x48, 0xA2, 0x13, 0x13, 0x13, 0xE8, 0xEB, 0xEB, 0x43, 0xB1, 0x58, 0xC4, 0xEA, - 0xEA, 0xAA, 0x81, 0xDB, 0x9E, 0xF4, 0xE7, 0xB3, 0x4C, 0xAE, 0x91, 0x9F, 0x20, 0xE4, 0xD9, 0xE6, - 0xF4, 0x26, 0xD2, 0xB2, 0x54, 0x3B, 0x47, 0x5A, 0x26, 0x79, 0x4B, 0x20, 0x9F, 0x35, 0x78, 0x56, - 0x7A, 0x77, 0x77, 0x37, 0x52, 0xA9, 0x14, 0x06, 0x07, 0x07, 0x51, 0x2A, 0x95, 0x6C, 0x74, 0x3A, - 0x07, 0x9E, 0x92, 0x9F, 0x34, 0x34, 0x34, 0x64, 0x8D, 0x87, 0xA1, 0xA1, 0x21, 0x3C, 0x79, 0xF2, - 0xA4, 0x4D, 0x48, 0x1E, 0x44, 0x88, 0xF6, 0x84, 0xC8, 0xA0, 0xAA, 0x45, 0x8D, 0xF7, 0x3C, 0x11, - 0x52, 0x4B, 0x27, 0x25, 0x06, 0x2B, 0xF7, 0x90, 0xDD, 0x41, 0x4F, 0x86, 0xD6, 0x8C, 0xDD, 0x9B, - 0x33, 0x72, 0xDF, 0x72, 0x6F, 0x93, 0xBE, 0xE0, 0x7F, 0x5E, 0x15, 0x1B, 0xC4, 0x63, 0x35, 0x01, - 0x51, 0x23, 0x3C, 0x4D, 0x2A, 0xF8, 0x5D, 0xF5, 0x72, 0x26, 0x9E, 0xFD, 0xF2, 0xE5, 0x4B, 0xFC, - 0x07, 0x56, 0x82, 0x21, 0xA3, 0x99, 0xCB, 0x17, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, - 0x44, 0xAE, 0x42, 0x60, 0x82, -}; - -#ifdef ROMFS_DIRENTRY_HEAD - static const ROMFS_DIRENTRY hacking_dir = { 0, 0, ROMFS_DIRENTRY_HEAD, "hacking.png", 36661, hacking }; - #undef ROMFS_DIRENTRY_HEAD - #define ROMFS_DIRENTRY_HEAD &hacking_dir -#endif diff --git a/esp32/imgv3_jpeg.h b/esp32/imgv3_jpeg.h deleted file mode 100644 index 2bb7c7dc8..000000000 --- a/esp32/imgv3_jpeg.h +++ /dev/null @@ -1,900 +0,0 @@ -/** - * This file was generated from "../../pictures/pic_3.jpg" using... - * - * file2c -dcs ../../pictures/pic_3.jpg - * - */ -static const char pic_3[] = { - 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, - 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x06, - 0x06, 0x05, 0x06, 0x09, 0x08, 0x0A, 0x0A, 0x09, 0x08, 0x09, 0x09, 0x0A, 0x0C, 0x0F, 0x0C, 0x0A, - 0x0B, 0x0E, 0x0B, 0x09, 0x09, 0x0D, 0x11, 0x0D, 0x0E, 0x0F, 0x10, 0x10, 0x11, 0x10, 0x0A, 0x0C, - 0x12, 0x13, 0x12, 0x10, 0x13, 0x0F, 0x10, 0x10, 0x10, 0xFF, 0xDB, 0x00, 0x43, 0x01, 0x03, 0x03, - 0x03, 0x04, 0x03, 0x04, 0x08, 0x04, 0x04, 0x08, 0x10, 0x0B, 0x09, 0x0B, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0xC0, - 0x00, 0x11, 0x08, 0x00, 0x80, 0x01, 0x28, 0x03, 0x01, 0x11, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, - 0x01, 0xFF, 0xC4, 0x00, 0x1B, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09, 0x04, 0x06, 0x07, 0x05, 0x0A, 0xFF, 0xC4, - 0x00, 0x3D, 0x10, 0x00, 0x01, 0x04, 0x01, 0x03, 0x03, 0x03, 0x01, 0x07, 0x02, 0x04, 0x07, 0x00, - 0x01, 0x05, 0x00, 0x02, 0x01, 0x03, 0x04, 0x05, 0x06, 0x00, 0x07, 0x12, 0x08, 0x11, 0x13, 0x09, - 0x14, 0x15, 0x16, 0x17, 0x21, 0x22, 0x23, 0x31, 0x38, 0xB5, 0x77, 0x85, 0x18, 0x32, 0x33, 0x41, - 0x24, 0x34, 0x47, 0x52, 0x56, 0x86, 0xC5, 0x19, 0x25, 0x37, 0x43, 0x72, 0x82, 0xFF, 0xC4, 0x00, - 0x16, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0xFF, 0xC4, 0x00, 0x1A, 0x11, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x41, 0x31, 0x21, - 0x61, 0xFF, 0xDA, 0x00, 0x0C, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, 0x9D, - 0x1B, 0x67, 0xD4, 0x2F, 0xD6, 0x9D, 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xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, - 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, - 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, - 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x0A, 0x36, 0xEB, 0x3B, 0xAF, 0x7E, 0xA5, 0xDD, 0xEA, 0x8F, 0x2B, - 0xAB, 0xC1, 0xF7, 0x3F, 0x20, 0xC4, 0x28, 0xB6, 0xF7, 0x28, 0x97, 0x57, 0x4F, 0x53, 0x5B, 0x2C, - 0x01, 0x85, 0x38, 0x6E, 0x83, 0x0E, 0x39, 0x25, 0x01, 0xB0, 0x49, 0x80, 0xEB, 0xB1, 0x55, 0xDF, - 0x14, 0x94, 0x74, 0x01, 0x1E, 0x36, 0xD3, 0xB8, 0xA9, 0x72, 0xD4, 0x82, 0xC2, 0x7D, 0x39, 0xBA, - 0xD7, 0xFF, 0x00, 0x15, 0x5B, 0x70, 0xFD, 0x06, 0x7F, 0x67, 0x54, 0xDE, 0xE6, 0xE2, 0xDF, 0x97, - 0x65, 0x19, 0x85, 0xF1, 0x39, 0x69, 0x05, 0x10, 0x11, 0xBB, 0x31, 0x67, 0x88, 0x80, 0xF2, 0x33, - 0x56, 0xDD, 0x16, 0x94, 0x84, 0x1C, 0x11, 0x2E, 0xCD, 0x0B, 0xCD, 0x36, 0x92, 0xC1, 0x30, 0x35, - 0x03, 0x41, 0x0F, 0xFD, 0x52, 0xB7, 0xD3, 0x71, 0xF6, 0x1B, 0xA6, 0x56, 0xED, 0xB6, 0xBE, 0xE7, - 0xE1, 0xAD, 0x72, 0x8C, 0x82, 0x3E, 0x36, 0xF5, 0x93, 0x48, 0xA9, 0x2A, 0x1C, 0x57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 0x38, 0xDA, 0xD9, 0xDE, 0xEC, - 0xD6, 0xD9, 0xC4, 0xA0, 0xB2, 0xB7, 0x8E, 0x11, 0x25, 0xCC, 0x29, 0xB2, 0xA6, 0xBE, 0xAC, 0x09, - 0x72, 0xF1, 0x03, 0x92, 0x5D, 0x70, 0x9B, 0x05, 0x2E, 0x24, 0x42, 0x0A, 0x28, 0x6A, 0x0D, 0xA9, - 0x72, 0xE0, 0x1D, 0xA8, 0xEC, 0x1A, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, - 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, - 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, - 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, - 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, - 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, - 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, - 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, - 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x68, 0x1A, 0x06, 0x81, 0xA0, 0x84, 0x1D, 0x69, 0xEE, 0x16, 0xFC, - 0xDC, 0x67, 0xD6, 0xB0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xD9, 0xC3, 0x01, 0x47, 0xD0, - 0x03, 0x40, 0xC2, 0x7A, 0x7F, 0x99, 0x5B, 0x95, 0x6F, 0x26, 0x63, 0xB3, 0x3D, 0x24, 0xEE, 0x06, - 0xD9, 0x60, 0x39, 0x66, 0xC0, 0x65, 0x54, 0x14, 0x50, 0x2F, 0x15, 0xF9, 0x36, 0x96, 0x97, 0x08, - 0xE3, 0x1C, 0xD1, 0xD8, 0xA6, 0xEB, 0xEF, 0x44, 0x79, 0xC5, 0x24, 0x6D, 0x96, 0x08, 0xBB, 0xBC, - 0x11, 0xFC, 0xAD, 0xA2, 0xF2, 0x34, 0x1A, 0x3B, 0xFE, 0xF6, 0xED, 0x56, 0xE3, 0xE6, 0x9E, 0x96, - 0x98, 0xF6, 0xD0, 0xE3, 0x78, 0x5D, 0xAC, 0xBC, 0xCE, 0x5E, 0x1F, 0x83, 0xD5, 0x8D, 0x21, 0x47, - 0x56, 0xA5, 0x37, 0x29, 0xB9, 0x15, 0xA8, 0xEB, 0x6E, 0x8B, 0x9C, 0x7C, 0x3E, 0x3E, 0x06, 0xAE, - 0x2B, 0x9C, 0x45, 0xB1, 0x03, 0x23, 0x51, 0x41, 0x25, 0x49, 0xD1, 0xFF, 0xD9, -}; - -#ifdef ROMFS_DIRENTRY_HEAD - static const ROMFS_DIRENTRY pic_3_dir = { 0, 0, ROMFS_DIRENTRY_HEAD, "pic_3.jpg", 14173, pic_3 }; - #undef ROMFS_DIRENTRY_HEAD - #define ROMFS_DIRENTRY_HEAD &pic_3_dir -#endif From a6c56e9437fd470da5795be7887d24b9e889a0ea Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 25 Jul 2017 16:15:49 +0200 Subject: [PATCH 083/403] Cleanup --- esp32/romfs_files.h | 3 --- unix/imgv3_hacking.h | 1 - unix/romfs_files.h | 1 - 3 files changed, 5 deletions(-) delete mode 120000 unix/imgv3_hacking.h delete mode 120000 unix/romfs_files.h diff --git a/esp32/romfs_files.h b/esp32/romfs_files.h index b941a3d78..776b09093 100644 --- a/esp32/romfs_files.h +++ b/esp32/romfs_files.h @@ -4,6 +4,3 @@ * The files have been converted using... * file2c -dcs infile outfile */ -#include "imgv3_hacking.h" -#include "imgv3_badgers.h" -#include "imgv3_jpeg.h" diff --git a/unix/imgv3_hacking.h b/unix/imgv3_hacking.h deleted file mode 120000 index 746123a7b..000000000 --- a/unix/imgv3_hacking.h +++ /dev/null @@ -1 +0,0 @@ -../esp32/imgv3_hacking.h \ No newline at end of file diff --git a/unix/romfs_files.h b/unix/romfs_files.h deleted file mode 120000 index 2606be1d8..000000000 --- a/unix/romfs_files.h +++ /dev/null @@ -1 +0,0 @@ -../esp32/romfs_files.h \ No newline at end of file From 9b1f0233cd03d262a04f8520fa1b8f9f76a5326c Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 25 Jul 2017 18:38:27 +0200 Subject: [PATCH 084/403] Build 2 --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 42e7c9e63..9459aff13 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 1 -name = "Snorrende Snor" +build = 2 +name = "Vlijtige Vlinder" From b617e5389a32f3d7534341609e7820b1321c2486 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 20:43:48 +0200 Subject: [PATCH 085/403] Flexible boot.py --- esp32/modules/_boot.py | 1 - esp32/modules/inisetup.py | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/esp32/modules/_boot.py b/esp32/modules/_boot.py index dfa3b7a8d..dfff125e7 100644 --- a/esp32/modules/_boot.py +++ b/esp32/modules/_boot.py @@ -3,7 +3,6 @@ try: uos.mount(uos.VfsNative(True), '/') open("/boot.py", "r") - except OSError: import inisetup vfs = inisetup.setup() diff --git a/esp32/modules/inisetup.py b/esp32/modules/inisetup.py index 5bc6de643..3cdd0bbb7 100644 --- a/esp32/modules/inisetup.py +++ b/esp32/modules/inisetup.py @@ -11,17 +11,16 @@ def setup(): ugfx.init() esp.rtcmem_write(0,0) esp.rtcmem_write(1,0) +splash = badge.nvs_get_str('badge','boot.splash','splash') if machine.reset_cause() != machine.DEEPSLEEP_RESET: - print("cold boot") - import splash + print('[BOOT.PY] Cold boot') else: - print("wake from sleep") + print("[BOOT.PY] Wake from sleep") load_me = esp.rtcmem_read_string() - if load_me != "": + if load_me: + splash = load_me print("starting %s" % load_me) esp.rtcmem_write_string("") - __import__(load_me) - else: - import splash +__import__(splash) """) return vfs From 7259b7e53284accadb74e998f70efd39f023f53d Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 20:48:14 +0200 Subject: [PATCH 086/403] Optional rebooting screen appglue --- esp32/modules/appglue.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/esp32/modules/appglue.py b/esp32/modules/appglue.py index e53df17a0..09a7a2007 100644 --- a/esp32/modules/appglue.py +++ b/esp32/modules/appglue.py @@ -1,14 +1,14 @@ import ugfx, esp, badge, deepsleep -def start_app(app): - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, "Rebooting..", "PermanentMarker22", ugfx.BLACK) - if (app==""): - ugfx.string(0, 25, "Returning to homescreen...","Roboto_Regular12",ugfx.BLACK) - else: - ugfx.string(0, 25, "Starting "+app+"...","Roboto_Regular12",ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTEST) - ugfx.flush() +def start_app(app, display = True): + if display: + ugfx.clear(ugfx.WHITE) + ugfx.string(0, 0, "Loading...", "PermanentMarker22", ugfx.BLACK) + if app: + ugfx.string(0, 25, "Starting "+app+"...","Roboto_Regular12",ugfx.BLACK) + else: + ugfx.string(0, 25, "Returning to homescreen...","Roboto_Regular12",ugfx.BLACK) + ugfx.flush(ugfx.LUT_FASTEST) esp.rtcmem_write_string(app) badge.eink_busy_wait() deepsleep.reboot() From 31858f81c2d063ed742b4ff9cbee9a0aeb1ae1d0 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 20:51:24 +0200 Subject: [PATCH 087/403] Use faster appglue --- esp32/modules/splash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index c7275eddf..24d7ce574 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -82,7 +82,7 @@ def draw_home(do_BPP): # START LAUNCHER def press_start(pushed): if pushed: - appglue.start_app("launcher") + appglue.start_app("launcher", False) def start_ota(pushed): if pushed: @@ -98,7 +98,7 @@ def press_a(pushed): loopCnt = badge.nvs_get_u8('splash', 'timer.amount', 25) magic += 1 if magic > 9: - appglue.start_app('magic') + appglue.start_app('magic', False) else: print("[SPLASH] Magic in "+str(10-magic)+"...") From edeac1fa2f941c77274e943bb813dae916976ab4 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 22:55:37 +0200 Subject: [PATCH 088/403] Bigfixes --- esp32/modules/splash.py | 54 +++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 24d7ce574..aef7767d4 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -40,7 +40,9 @@ def draw_home(do_BPP): vBatt = badge.battery_volt_sense() vBatt += vDrop - width = (vBatt-vMin) / (vMax-vMin) * 38 + ugfx.clear(ugfx.WHITE) + + width = round((vBatt-vMin) / (vMax-vMin) * 38) if width < 0: width = 0 elif width < 38: @@ -62,14 +64,13 @@ def draw_home(do_BPP): ugfx.string(47, 2, bat_status,'Roboto_Regular18',ugfx.BLACK) - if do_BPP: - info = "[ ANY: Wake up ]" + info = '[ ANY: Wake up ]' elif OTA_available: - info = "[ B: OTA ] [ START: LAUNCHER ]" - ugfx.string(0, 108, 'OTA ready!', "Roboto_Regular18",ugfx.BLACK) + info = '[ B: OTA ] [ START: LAUNCHER ]' + ugfx.string(0, 108, 'OTA ready!', 'Roboto_Regular18', ugfx.BLACK) else: - info = "[ START: LAUNCHER ]" + info = '[ START: LAUNCHER ]' l = ugfx.get_string_width(info,"Roboto_Regular12") ugfx.string(296-l, 115, info, "Roboto_Regular12",ugfx.BLACK) @@ -77,7 +78,12 @@ def draw_home(do_BPP): ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) services.draw() - ugfx.flush() + ugfx.flush(ugfx.LUT_FULL) + + if do_BPP: + badge.eink_busy_wait() + # appglue.start_bpp() ## SHOULD BE THIS!! + deepsleep.start_sleeping() # START LAUNCHER def press_start(pushed): @@ -91,11 +97,14 @@ def start_ota(pushed): # NOTHING def press_nothing(pushed): if pushed: - loopCnt = badge.nvs_get_u8('splash', 'timer.amount', 25) + global loopCount + loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) def press_a(pushed): if pushed: - loopCnt = badge.nvs_get_u8('splash', 'timer.amount', 25) + global loopCount + global magic + loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) magic += 1 if magic > 9: appglue.start_app('magic', False) @@ -115,17 +124,18 @@ def sleepIfEmpty(vbatt): # TIMER def splashTimer_callback(tmr): + global loopCount try: loopCount - except NameError: - loopCount = badge.nvs_get_u8('splash', 'timer.amount', 25) + except: + loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) draw_home(False) else: - if loopCnt<1: + if loopCount < 1: draw_home(True) else: - if not services.loop(loopCnt): - loopCnt -= 1 + if not services.loop(loopCount): + loopCount -= 1 # WIFI def disableWiFi(): @@ -182,7 +192,10 @@ def check_ota_available(): import version if (json["build"] > version.build): ugfx.input_attach(ugfx.BTN_B, start_ota) + badge.nvs_set_u8('badge','OTA.ready',1) return True + else: + badge.nvs_set_u8('badge','OTA.ready',0) return False def inputInit(): @@ -198,13 +211,16 @@ def inputInit(): def checkFirstBoot(): setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) - if (setupcompleted==0): # First boot (open setup) + if setupcompleted == 0: # First boot (open setup) print("[SPLASH] Setup not completed. Running setup!") appglue.start_app("setup") - elif (setupcompleted==1): # Second boot (after setup) + elif setupcompleted == 1: # Second boot (after setup) print("[SPLASH] Showing sponsors once...") badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once appglue.start_app("sponsors") + elif setupcompleted == 2: + badge.nvs_set_str('badge', 'setup.state', '3') + check_ota_available() else: # Setup completed print("[SPLASH] Normal boot.") @@ -212,7 +228,7 @@ def checkFirstBoot(): nick = badge.nvs_get_str("owner", "name", 'John Doe') vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV -vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 100) # mV +vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 80) # mV inputInit() magic = 0 @@ -225,9 +241,11 @@ def checkFirstBoot(): if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and doOTA: OTA_available = check_ota_available() else: - OTA_available = False + OTA_available = badge.nvs_get_u8('badge','OTA.ready',0) disableWiFi() +ugfx.clear(ugfx.WHITE) +ugfx.flush(ugfx.LUT_FASTER) foundService = services.setup() From c3073e601feb815460ff3f0f1482fa479e01f26b Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Tue, 25 Jul 2017 22:58:21 +0200 Subject: [PATCH 089/403] Installer rewrite w/ category support --- esp32/modules/installer.py | 194 ++++++++++++++++++++++++++----------- 1 file changed, 135 insertions(+), 59 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 1fb80d7e9..bb39c411d 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -16,87 +16,163 @@ timeout = 250 while not wifi.sta_if.isconnected(): - time.sleep(0.1) - timeout = timeout - 1 - if (timeout<1): - ugfx.clear(ugfx.BLACK) - ugfx.string(5,5,"Failure.","Roboto_BlackItalic24",ugfx.WHITE) - ugfx.flush() - time.sleep(2) - appglue.start_app("") - pass + time.sleep(0.1) + timeout = timeout - 1 + if (timeout<1): + ugfx.clear(ugfx.BLACK) + ugfx.string(5,5,"Failure.","Roboto_BlackItalic24",ugfx.WHITE) + ugfx.flush() + time.sleep(2) + appglue.start_app("") + pass ugfx.clear(ugfx.WHITE) -ugfx.string(180,25,"STILL","Roboto_BlackItalic24",ugfx.BLACK) -ugfx.string(160,50,"Hacking","PermanentMarker22",ugfx.BLACK) -str_len = ugfx.get_string_width("Hacking","PermanentMarker22") -ugfx.line(160, 72, 174 + str_len, 72, ugfx.BLACK) -ugfx.line(170 + str_len, 52, 170 + str_len, 70, ugfx.BLACK) -ugfx.string(170,75,"Anyway","Roboto_BlackItalic24",ugfx.BLACK) def show_description(active): - if active: - text.text(packages[options.selected_index()]["description"]) - ugfx.flush() + if active: + text.text(packages[options.selected_index()]["description"]) + ugfx.flush() -def woezel_it(active): - if active: - ugfx.clear(ugfx.BLACK) - ugfx.string(40,25,"Installing:","Roboto_BlackItalic24",ugfx.WHITE) - ugfx.string(100,75, packages[options.selected_index()]["name"],"PermanentMarker22",ugfx.WHITE) - ugfx.flush() - import woezel - woezel.install(packages[options.selected_index()]["slug"]) - ugfx.clear(ugfx.BLACK) - ugfx.string(40,25,"Installed:","Roboto_BlackItalic24",ugfx.WHITE) - ugfx.string(100,75, packages[options.selected_index()]["name"],"PermanentMarker22",ugfx.WHITE) - ugfx.flush() - -def start_app(pushed): - if(pushed): - ugfx.clear(ugfx.BLACK) - ugfx.string(40,25,"Running:","Roboto_BlackItalic24",ugfx.WHITE) - ugfx.string(100,75, packages[options.selected_index()]["name"],"PermanentMarker22",ugfx.WHITE) - ugfx.flush() - selected = packages[options.selected_index()]["slug"] - appglue.start_app(selected) - -def start_launcher(pushed): - if(pushed): - appglue.start_app('launcher') +def empty_options(): + global options + options.destroy() + options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) ugfx.input_init() window = ugfx.Container(0, 0, ugfx.width(), ugfx.height()) -ugfx.input_attach(ugfx.JOY_UP, show_description) -ugfx.input_attach(ugfx.JOY_DOWN, show_description) - -ugfx.input_attach(ugfx.BTN_A, woezel_it) -ugfx.input_attach(ugfx.BTN_B, start_launcher) - -ugfx.input_attach(ugfx.BTN_START, start_app) +options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) +text.text("Downloading category list...") ugfx.set_lut(ugfx.LUT_FULL) ugfx.flush() badge.eink_busy_wait() ugfx.set_lut(ugfx.LUT_FASTER) +packages = {} # global variable + gc.collect() -f = requests.get("https://badge.sha2017.org/eggs/list/json") +f = requests.get("https://badge.sha2017.org/eggs/categories/json") try: - packages = f.json() + categories = f.json() finally: - f.close() + f.close() gc.collect() -options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) - -for package in packages: - options.add_item("%s rev. %s"% (package["name"], package["revision"])) - -show_description(True) +def show_category(active): + if active: + ugfx.string_box(148,0,148,26, "Hatchery", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + text.text("Install or update eggs from the hatchery here.\nSelect a category to start, or press B to return to the launcher.\n\nbadge.sha2017.org") + ugfx.flush() + +def list_categories(): + global options + global text + + empty_options() + text.destroy() + text = ugfx.Textbox(int(ugfx.width()/2),26,int(ugfx.width()/2),ugfx.height()-26) + + ugfx.input_attach(ugfx.JOY_UP, show_category) + ugfx.input_attach(ugfx.JOY_DOWN, show_category) + ugfx.input_attach(ugfx.BTN_A, select_category) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("launcher") if pushed else 0) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) + + for category in categories: + options.add_item("%s >" % category["name"]) + + show_category(True) + +def select_category(active): + if active: + global categories + index = options.selected_index() + category = categories[index]["slug"] + list_apps(category) + +def list_apps(slug): + global options + global text + global packages + + ugfx.input_attach(ugfx.JOY_UP, 0) + ugfx.input_attach(ugfx.JOY_DOWN, 0) + ugfx.input_attach(ugfx.BTN_A, 0) + ugfx.input_attach(ugfx.BTN_B, 0) + ugfx.input_attach(ugfx.BTN_START, 0) + + empty_options() + text.destroy() + text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) + text.text("Downloading list of eggs...") + ugfx.set_lut(ugfx.LUT_FULL) + ugfx.flush() + badge.eink_busy_wait() + + gc.collect() + f = requests.get("https://badge.sha2017.org/eggs/category/%s/json" % slug) + try: + packages = f.json() + finally: + f.close() + + gc.collect() + + for package in packages: + options.add_item("%s rev. %s" % (package["name"], package["revision"])) + + ugfx.input_attach(ugfx.JOY_UP, show_description) + ugfx.input_attach(ugfx.JOY_DOWN, show_description) + ugfx.input_attach(ugfx.BTN_A, install_app) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("installer") if pushed else 0) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("installer") if pushed else 0) + + show_description(True) + badge.eink_busy_wait() + ugfx.set_lut(ugfx.LUT_FASTER) + +def install_app(active): + if active: + global options + global text + global packages + + index = options.selected_index() + + options.destroy() + text.destroy() + + ugfx.input_attach(ugfx.JOY_UP, 0) + ugfx.input_attach(ugfx.JOY_DOWN, 0) + ugfx.input_attach(ugfx.BTN_A, 0) + ugfx.input_attach(ugfx.BTN_B, 0) + ugfx.input_attach(ugfx.BTN_START, 0) + + ugfx.clear(ugfx.BLACK) + ugfx.string(40,25,"Installing:","Roboto_BlackItalic24",ugfx.WHITE) + ugfx.string(75,75, packages[index]["name"],"PermanentMarker22",ugfx.WHITE) + ugfx.flush() + + import woezel + woezel.install(packages[index]["slug"]) + + ugfx.clear(ugfx.WHITE) + ugfx.string(40,25,"Installed:","Roboto_BlackItalic24",ugfx.BLACK) + ugfx.string(75,75, packages[index]["name"],"PermanentMarker22",ugfx.BLACK) + text = ugfx.Textbox(0,100, ugfx.width(), ugfx.height()-100) + text.text("Press A to start %s, or B to return to the installer" % packages[index]["name"]) + + ugfx.input_attach(ugfx.BTN_A, lambda pushed: appglue.start_app(packages[index]["slug"]) if pushed else 0) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("installer")) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("")) + + ugfx.flush() + + +list_categories() From 5147507f931fa110202f0d56acf8216c74276f4c Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 23:04:29 +0200 Subject: [PATCH 090/403] Small improvements --- esp32/modules/appglue.py | 2 +- esp32/modules/splash.py | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/esp32/modules/appglue.py b/esp32/modules/appglue.py index 09a7a2007..fdedbff13 100644 --- a/esp32/modules/appglue.py +++ b/esp32/modules/appglue.py @@ -8,7 +8,7 @@ def start_app(app, display = True): ugfx.string(0, 25, "Starting "+app+"...","Roboto_Regular12",ugfx.BLACK) else: ugfx.string(0, 25, "Returning to homescreen...","Roboto_Regular12",ugfx.BLACK) - ugfx.flush(ugfx.LUT_FASTEST) + ugfx.flush(ugfx.LUT_FASTER) esp.rtcmem_write_string(app) badge.eink_busy_wait() deepsleep.reboot() diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index aef7767d4..6df5e7a60 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -15,17 +15,6 @@ def set_time_ntp(): else: return False -# BATTERY -def battery_percent(vbatt): - global battery_volt_min - global battery_volt_max - percent = round(((vbatt-vempty)*100)/(vfull-vempty)) - if (percent<0): - percent = 0 - elif (percent>100): - percent = 100 - return percent - # GRAPHICS def draw_msg(title, desc): ugfx.clear(ugfx.WHITE) From c2ffdf40a0beef94492ee2b56f739daafb47f930 Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Tue, 25 Jul 2017 23:18:07 +0200 Subject: [PATCH 091/403] Small cartesian issue, confused X with Y --- esp32/modules/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index bb39c411d..61f987769 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -156,7 +156,7 @@ def install_app(active): ugfx.clear(ugfx.BLACK) ugfx.string(40,25,"Installing:","Roboto_BlackItalic24",ugfx.WHITE) - ugfx.string(75,75, packages[index]["name"],"PermanentMarker22",ugfx.WHITE) + ugfx.string(100,55, packages[index]["name"],"PermanentMarker22",ugfx.WHITE) ugfx.flush() import woezel @@ -164,7 +164,7 @@ def install_app(active): ugfx.clear(ugfx.WHITE) ugfx.string(40,25,"Installed:","Roboto_BlackItalic24",ugfx.BLACK) - ugfx.string(75,75, packages[index]["name"],"PermanentMarker22",ugfx.BLACK) + ugfx.string(100,55, packages[index]["name"],"PermanentMarker22",ugfx.BLACK) text = ugfx.Textbox(0,100, ugfx.width(), ugfx.height()-100) text.text("Press A to start %s, or B to return to the installer" % packages[index]["name"]) From 3dd40d1971cfea331630f105f818c1b9080b8afa Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Tue, 25 Jul 2017 23:20:00 +0200 Subject: [PATCH 092/403] Pass LUT to ugfx.flush() --- esp32/modules/installer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 61f987769..1b7946ff0 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -47,8 +47,7 @@ def empty_options(): text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) text.text("Downloading category list...") -ugfx.set_lut(ugfx.LUT_FULL) -ugfx.flush() +ugfx.flush(ugfx.LUT_FULL) badge.eink_busy_wait() ugfx.set_lut(ugfx.LUT_FASTER) @@ -111,8 +110,7 @@ def list_apps(slug): text.destroy() text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) text.text("Downloading list of eggs...") - ugfx.set_lut(ugfx.LUT_FULL) - ugfx.flush() + ugfx.flush(ugfx.LUT_FULL) badge.eink_busy_wait() gc.collect() From d3714c662714e9596f0173f4e6032a1de9843b46 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 23:28:34 +0200 Subject: [PATCH 093/403] sexy loading screen --- esp32/modules/splash.py | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 6df5e7a60..fa218e63f 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -6,22 +6,30 @@ # TIME def set_time_ntp(): - draw_msg("Configuring clock...", "Connecting to WiFi...") + draw_msg("Configuring clock...") if connectWiFi(): - draw_msg("Configuring clock...", "Setting time over NTP...") + draw_msg("Setting time over NTP...") ntp.set_NTP_time() - draw_msg("Configuring clock...", "Done!") + draw_msg("Time set!") return True else: return False # GRAPHICS -def draw_msg(title, desc): - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) - ugfx.string(0, 25, desc, "Roboto_Regular12", ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTEST) - ugfx.flush() +def draw_msg(msg): + global line_number + try: + line_number + except: + line_number = 0 + ugfx.clear(ugfx.WHITE) + ugfx.string(0, 0, 'Still Loading Anyway...', "PermanentMarker22", ugfx.BLACK) + ugfx.set_lut(ugfx.LUT_FASTER) + draw_msg(msg) + else: + ugfx.string(0, 30 + (line_number * 15), msg, "Roboto_Regular12", ugfx.BLACK) + ugfx.flush() + line_number += 1 def draw_home(do_BPP): @@ -139,14 +147,14 @@ def connectWiFi(): password = badge.nvs_get_str('badge', 'wifi.password') nw.connect(ssid, password) if password else nw.connect(ssid) - draw_msg("Wi-Fi actived", "Connecting to '"+ssid+"'...") + draw_msg("Connecting to '"+ssid+"'...") timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) while not nw.isconnected(): time.sleep(0.1) timeout = timeout - 1 if (timeout<1): - draw_msg("Error", "Timeout while connecting!") + draw_msg("Timeout while connecting!") disableWiFi() time.sleep(1) return False @@ -156,19 +164,19 @@ def connectWiFi(): def download_ota_info(): import urequests as requests - draw_msg("Loading...", "Downloading JSON...") + draw_msg("Downloading OTA status...") result = False try: data = requests.get("https://badge.sha2017.org/version") except: - draw_msg("Error", "Could not download JSON!") + draw_msg("Could not download JSON!") time.sleep(5) return False try: result = data.json() except: data.close() - draw_msg("Error", "Could not decode JSON!") + draw_msg("Could not decode JSON!") time.sleep(5) return False data.close() From b0b30065550128fdf43576b62884d1a2cff59ca1 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Tue, 25 Jul 2017 23:30:09 +0200 Subject: [PATCH 094/403] cleanup esp-rtcmem code. throw out-of-range exceptions. --- esp32/esprtcmem.c | 77 ++++++++++++++++++++++++++++++++++++++--------- esp32/esprtcmem.h | 51 ++++++++++++++++++++++++++----- esp32/modesp.c | 53 +++++++++++++++++++++----------- 3 files changed, 141 insertions(+), 40 deletions(-) diff --git a/esp32/esprtcmem.c b/esp32/esprtcmem.c index 7d6b92f84..e6cd6fd3a 100644 --- a/esp32/esprtcmem.c +++ b/esp32/esprtcmem.c @@ -26,28 +26,77 @@ * THE SOFTWARE. */ -#include "py/mphal.h" +#include +#include + +#include #include "esprtcmem.h" -static uint8_t RTC_DATA_ATTR rtcmemcontents[USER_RTC_MEM_SIZE] = {0}; +static uint8_t RTC_DATA_ATTR rtcmemcontents[USER_RTC_MEM_SIZE] = { 0 }; + +// @return 0..255 is ok; -1 is error +int +esp_rtcmem_read(uint32_t location) +{ + if (location >= USER_RTC_MEM_SIZE) + { + return -1; + } -const uint8_t esp_rtcmem_read(uint32_t location) { - if (location= USER_RTC_MEM_SIZE) + { + return -1; + } + + rtcmemcontents[location] = value; + + return 0; } -void esp_rtcmem_write_string(uint32_t location, const char *buffer) { - sprintf((char *)rtcmemcontents+location, "%s", buffer); +// @return 0 is ok; -1 is error +int +esp_rtcmem_read_string(uint32_t location, char *buffer, size_t *buf_len) +{ + if (location >= USER_RTC_MEM_SIZE) + { + return -1; + } + + size_t maxlen = USER_RTC_MEM_SIZE - location; + size_t len = strnlen((const char *) &rtcmemcontents[location], maxlen); + if (len == maxlen) + { + return -1; + } + + if (*buf_len <= len) + { + return -1; + } + *buf_len = len + 1; + memcpy(buffer, &rtcmemcontents[location], len + 1); + + return 0; } -void esp_rtcmem_write(uint32_t location, uint8_t value) { - if (location= USER_RTC_MEM_SIZE || location + strlen(buffer) >= USER_RTC_MEM_SIZE) + { + return -1; + } + + memcpy(&rtcmemcontents[location], buffer, strlen(buffer)); + + return 0; } diff --git a/esp32/esprtcmem.h b/esp32/esprtcmem.h index fd80d7ca6..ce986935d 100644 --- a/esp32/esprtcmem.h +++ b/esp32/esprtcmem.h @@ -1,14 +1,49 @@ #ifndef ESPRTCMEM_H #define ESPRTCMEM_H -#include "esp_attr.h" -#include "rom/rtc.h" +#include -#define USER_RTC_MEM_SIZE 256 +#include +#include -const uint8_t esp_rtcmem_read(uint32_t location); -void esp_rtcmem_write(uint32_t location, uint8_t value); -void esp_rtcmem_read_string(uint32_t location, char *buffer); -void esp_rtcmem_write_string(uint32_t location, const char *buffer); +#define USER_RTC_MEM_SIZE 1024 -#endif +/** + * Read byte from rtcmem on offset location. + * + * @param location The offset in the rtcmem. + * @return 0..255 is ok; -1 is error + */ +extern int esp_rtcmem_read(uint32_t location); + +/** + * Write byte to rtcmem on offset location. + * + * @param location The offset in the rtcmem + * @param value The value to write to this offset + * @return 0 is ok; -1 is error + */ +extern int esp_rtcmem_write(uint32_t location, uint8_t value); + +/** + * Read zero-terminated string from rtcmem on offset location + * + * @param location The offset in the rtcmem + * @param buffer The destination buffer + * @param buf_len The length of the destination buffer + * on input: the total buffer-length + * on output: the used buffer-length + * @return 0 is ok; -1 is error + */ +extern int esp_rtcmem_read_string(uint32_t location, char *buffer, size_t *buf_len); + +/** + * Write zero-terminated string to rtcmem on offfset location + * + * @param location The offset in the rtcmem + * @param buffer The string to write to this offset + * @return 0 is ok; -1 is error + */ +extern int esp_rtcmem_write_string(uint32_t location, const char *buffer); + +#endif // ESPRTCMEM_H diff --git a/esp32/modesp.c b/esp32/modesp.c index d8334e587..e2310f1b6 100644 --- a/esp32/modesp.c +++ b/esp32/modesp.c @@ -122,38 +122,55 @@ STATIC IRAM_ATTR mp_obj_t esp_flash_user_start(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_user_start_obj, esp_flash_user_start); -STATIC mp_obj_t esp_rtcmem_write_(mp_obj_t pos, mp_obj_t val) { - esp_rtcmem_write(mp_obj_get_int(pos), mp_obj_get_int(val)); - return mp_const_none; +STATIC mp_obj_t esp_rtcmem_write_(mp_obj_t _pos, mp_obj_t _val) { + int pos = mp_obj_get_int(_pos); + int val = mp_obj_get_int(_val); + + if (val < 0 || val > 255) { + mp_raise_msg(&mp_type_IndexError, "Value out of range"); + } + int res = esp_rtcmem_write(pos, val); + if (res < 0) { + mp_raise_msg(&mp_type_IndexError, "Offset out of range"); + } + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp_rtcmem_write_obj, esp_rtcmem_write_); -STATIC mp_obj_t esp_rtcmem_read_(mp_obj_t pos) { - uint8_t val = esp_rtcmem_read(mp_obj_get_int(pos)); - return mp_obj_new_int(val); +STATIC mp_obj_t esp_rtcmem_read_(mp_obj_t _pos) { + int pos = mp_obj_get_int(_pos); + + int val = esp_rtcmem_read(pos); + if (val < 0) { + mp_raise_msg(&mp_type_IndexError, "Offset out of range"); + } + return mp_obj_new_int(val); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_rtcmem_read_obj, esp_rtcmem_read_); STATIC mp_obj_t esp_rtcmem_read_string_(mp_uint_t n_args, const mp_obj_t *args) { - int pos = 2; - if (n_args > 0){ - pos = mp_obj_get_int(args[0]); + int pos = (n_args == 0) ? 2 : mp_obj_get_int(args[1]); + + char str[256]; + size_t str_len = sizeof(str); + int res = esp_rtcmem_read_string(pos, str, &str_len); + if (res < 0) { + mp_raise_msg(&mp_type_IndexError, "Offset out of range"); } - char words[USER_RTC_MEM_SIZE]; - esp_rtcmem_read_string(pos, words); - return mp_obj_new_str(words, strlen(words), true); + return mp_obj_new_str(str, str_len-1, true); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp_rtcmem_read_string_obj, 0, 1, esp_rtcmem_read_string_); STATIC mp_obj_t esp_rtcmem_write_string_(mp_uint_t n_args, const mp_obj_t *args) { - int pos = 2; - if (n_args > 1){ - pos = mp_obj_get_int(args[1]); + const char *str = mp_obj_str_get_str(args[0]); + int pos = (n_args == 1) ? 2 : mp_obj_get_int(args[1]); + + int res = esp_rtcmem_write_string(pos, str); + if (res < 0) { + mp_raise_msg(&mp_type_IndexError, "Offset out of range"); } - mp_uint_t len; - esp_rtcmem_write_string(pos, mp_obj_str_get_data(args[0], &len)); - return mp_const_none; + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp_rtcmem_write_string_obj, 1, 2, esp_rtcmem_write_string_); From 6ada0f3991959b650498cf13408bf1e062dc454d Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Tue, 25 Jul 2017 23:34:31 +0200 Subject: [PATCH 095/403] Egg count --- esp32/modules/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 1b7946ff0..9f42a019d 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -84,7 +84,7 @@ def list_categories(): ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) for category in categories: - options.add_item("%s >" % category["name"]) + options.add_item("%s (%d) >" % (category["name"], category["eggs"])) show_category(True) From ad64d235e36d761618f19ddab47955602d5adafa Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Tue, 25 Jul 2017 23:38:53 +0200 Subject: [PATCH 096/403] bugfixes --- esp32/esprtcmem.c | 2 +- esp32/modesp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/esprtcmem.c b/esp32/esprtcmem.c index e6cd6fd3a..42f5c3c22 100644 --- a/esp32/esprtcmem.c +++ b/esp32/esprtcmem.c @@ -96,7 +96,7 @@ esp_rtcmem_write_string(uint32_t location, const char *buffer) return -1; } - memcpy(&rtcmemcontents[location], buffer, strlen(buffer)); + memcpy(&rtcmemcontents[location], buffer, strlen(buffer)+1); return 0; } diff --git a/esp32/modesp.c b/esp32/modesp.c index e2310f1b6..133e3a10b 100644 --- a/esp32/modesp.c +++ b/esp32/modesp.c @@ -150,7 +150,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_rtcmem_read_obj, esp_rtcmem_read_); STATIC mp_obj_t esp_rtcmem_read_string_(mp_uint_t n_args, const mp_obj_t *args) { - int pos = (n_args == 0) ? 2 : mp_obj_get_int(args[1]); + int pos = (n_args == 0) ? 2 : mp_obj_get_int(args[0]); char str[256]; size_t str_len = sizeof(str); From f88381e88b36820bed5585ebc911ab05db4b2b07 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 23:43:35 +0200 Subject: [PATCH 097/403] Small fixes and cleanup --- esp32/modules/splash.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index fa218e63f..bc3be7884 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -3,7 +3,6 @@ # SHA2017 badge home screen # Renze Nicolai # Thomas Roos -# TIME def set_time_ntp(): draw_msg("Configuring clock...") @@ -15,7 +14,6 @@ def set_time_ntp(): else: return False -# GRAPHICS def draw_msg(msg): global line_number try: @@ -31,7 +29,6 @@ def draw_msg(msg): ugfx.flush() line_number += 1 - def draw_home(do_BPP): vBatt = badge.battery_volt_sense() @@ -45,7 +42,6 @@ def draw_home(do_BPP): elif width < 38: width = 38 - ugfx.box(2,2,40,18,ugfx.BLACK) ugfx.box(42,7,2,8,ugfx.BLACK) ugfx.area(3,3,width,16,ugfx.BLACK) @@ -108,7 +104,6 @@ def press_a(pushed): else: print("[SPLASH] Magic in "+str(10-magic)+"...") - def sleepIfEmpty(vbatt): global battery_volt_min if (vbatt > 100) and (vbatt < battery_volt_min): @@ -119,7 +114,6 @@ def sleepIfEmpty(vbatt): else: return True -# TIMER def splashTimer_callback(tmr): global loopCount try: @@ -134,7 +128,6 @@ def splashTimer_callback(tmr): if not services.loop(loopCount): loopCount -= 1 -# WIFI def disableWiFi(): nw = network.WLAN(network.STA_IF) nw.active(False) @@ -160,8 +153,6 @@ def connectWiFi(): return False return True -# CHECK OTA VERSION - def download_ota_info(): import urequests as requests draw_msg("Downloading OTA status...") @@ -197,7 +188,7 @@ def check_ota_available(): def inputInit(): ugfx.input_init() - ugfx.input_attach(ugfx.BTN_START, press_start) + ugfx.input_attach(ugfx.BTN_START, lambda p: appglue.start_app("launcher", False) if p else 0) ugfx.input_attach(ugfx.BTN_A, press_a) ugfx.input_attach(ugfx.BTN_B, press_nothing) ugfx.input_attach(ugfx.BTN_SELECT, press_nothing) From eacc222bcc7d433cbc1cf0880862d4ba145719a1 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 25 Jul 2017 23:45:14 +0200 Subject: [PATCH 098/403] More fixes --- esp32/modules/splash.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index bc3be7884..1f2603b21 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -78,16 +78,10 @@ def draw_home(do_BPP): # appglue.start_bpp() ## SHOULD BE THIS!! deepsleep.start_sleeping() -# START LAUNCHER -def press_start(pushed): - if pushed: - appglue.start_app("launcher", False) - def start_ota(pushed): if pushed: appglue.start_ota() - -# NOTHING + def press_nothing(pushed): if pushed: global loopCount From 4cafe0c485972d19aa1ba6c1e201e6ee5f0612c2 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 26 Jul 2017 00:20:38 +0200 Subject: [PATCH 099/403] support negative offsets in png image loading --- esp32/modbadge.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 90863b66e..ec0e7df21 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -224,16 +224,17 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(badge_display_picture_obj, /* PNG READER TEST */ -STATIC mp_obj_t badge_eink_png(mp_obj_t obj_x, mp_obj_t obj_y, mp_obj_t obj_filename) { - uint16_t x = mp_obj_get_int(obj_x); - uint16_t y = mp_obj_get_int(obj_y); +STATIC mp_obj_t badge_eink_png(mp_obj_t obj_x, mp_obj_t obj_y, mp_obj_t obj_filename) +{ + int x = mp_obj_get_int(obj_x); + int y = mp_obj_get_int(obj_y); + const char* filename = mp_obj_str_get_str(obj_filename); + if (x >= BADGE_EINK_WIDTH || y >= BADGE_EINK_HEIGHT) { return mp_const_none; } - mp_uint_t len; - const char* filename = mp_obj_str_get_data(obj_filename, &len); struct lib_file_reader *fr = lib_file_new(filename, 1024); if (fr == NULL) { @@ -249,7 +250,9 @@ STATIC mp_obj_t badge_eink_png(mp_obj_t obj_x, mp_obj_t obj_y, mp_obj_t obj_file return mp_const_none; } - int res = lib_png_load_image(pr, &badge_eink_fb[y * BADGE_EINK_WIDTH + x], BADGE_EINK_WIDTH - x, BADGE_EINK_HEIGHT - y, BADGE_EINK_WIDTH); + uint32_t dst_min_x = x < 0 ? -x : 0; + uint32_t dst_min_y = y < 0 ? -y : 0; + int res = lib_png_load_image(pr, &badge_eink_fb[y * BADGE_EINK_WIDTH + x], dst_min_x, dst_min_y, BADGE_EINK_WIDTH - x, BADGE_EINK_HEIGHT - y, BADGE_EINK_WIDTH); lib_png_destroy(pr); lib_file_destroy(fr); From d31c688f0f3294d7d4413f2af6419e2482225610 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 00:26:26 +0200 Subject: [PATCH 100/403] FIX ALL THA THINGS --- esp32/modules/splash.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 1f2603b21..77f51e897 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -39,7 +39,7 @@ def draw_home(do_BPP): width = round((vBatt-vMin) / (vMax-vMin) * 38) if width < 0: width = 0 - elif width < 38: + elif width > 38: width = 38 ugfx.box(2,2,40,18,ugfx.BLACK) @@ -60,7 +60,7 @@ def draw_home(do_BPP): if do_BPP: info = '[ ANY: Wake up ]' elif OTA_available: - info = '[ B: OTA ] [ START: LAUNCHER ]' + info = '[ B: UPDATE ] [ START: LAUNCHER ]' ugfx.string(0, 108, 'OTA ready!', 'Roboto_Regular18', ugfx.BLACK) else: info = '[ START: LAUNCHER ]' @@ -81,12 +81,16 @@ def draw_home(do_BPP): def start_ota(pushed): if pushed: appglue.start_ota() - + def press_nothing(pushed): if pushed: global loopCount loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) +def press_start(pushed): + if pushed: + appglue.start_app("launcher", False) + def press_a(pushed): if pushed: global loopCount @@ -116,7 +120,7 @@ def splashTimer_callback(tmr): loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) draw_home(False) else: - if loopCount < 1: + if loopCount < 1 and badge.usb_volt_sense() < 4500: draw_home(True) else: if not services.loop(loopCount): @@ -182,7 +186,7 @@ def check_ota_available(): def inputInit(): ugfx.input_init() - ugfx.input_attach(ugfx.BTN_START, lambda p: appglue.start_app("launcher", False) if p else 0) + ugfx.input_attach(ugfx.BTN_START, press_start) ugfx.input_attach(ugfx.BTN_A, press_a) ugfx.input_attach(ugfx.BTN_B, press_nothing) ugfx.input_attach(ugfx.BTN_SELECT, press_nothing) @@ -206,11 +210,13 @@ def checkFirstBoot(): else: # Setup completed print("[SPLASH] Normal boot.") -header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) nick = badge.nvs_get_str("owner", "name", 'John Doe') vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV -vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 80) # mV +if badge.battery_charge_status() == False and badge.usb_volt_sense() > 4500 and badge.battery_volt_sense() > 2500: + badge.nvs_set_u16('splash', 'bat.volt.drop', 4200 - badge.battery_volt_sense()) # mV + print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) +vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 0) # mV inputInit() magic = 0 From e6a654a1a1d88ce30a9d2b8311c4f3f5f02d9535 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 26 Jul 2017 00:36:09 +0200 Subject: [PATCH 101/403] HOTFIX --- esp32/modules/splash.py | 171 ++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 101 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 212fc98c9..53f3b2f1b 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,35 +1,9 @@ import ugfx, time, badge, machine, uos, appglue, deepsleep, network, esp # SHA2017 badge home screen +# HOTFIX VERSION 26-07-2017 # Renze Nicolai 2017 -# Reboot counter (Used for BPP) -def get_reboot_counter(): - return esp.rtcmem_read(1023) - -def set_reboot_counter(value): - esp.rtcmem_write(1023, value) - -def increment_reboot_counter(): - val = get_reboot_counter() - if (val<255): - val = val + 1 - set_reboot_counter(val) - -# BPP -def bpp_execute(): - print("[SPLASH] Executing BPP...") - set_reboot_counter(0) - esp.rtcmem_write(0,2) - esp.rtcmem_write(0,~2) - deepsleep.reboot() - -def bpp_check(): - global bpp_after_count - if (get_reboot_counter()>bpp_after_count): - return True - return False - # SERVICES def setup_services(): global services @@ -239,8 +213,6 @@ def draw_home(percent, cstate, status, full_clear, going_to_sleep): draw_helper_battery(percent, cstate) if (going_to_sleep): info = "[ ANY: Wake up ]" - elif (status=="BPP"): - info = "[ ANY: Exit BPP ]" else: info = "[ START: LAUNCHER ]" @@ -270,7 +242,6 @@ def start_launcher(pushed): print("[SPLASH] Starting launcher...") global splashTimer splashTimer.deinit() - increment_reboot_counter() appglue.start_app("launcher") def start_ota(pushed): @@ -302,14 +273,12 @@ def start_magic(pushed): # SLEEP def badge_sleep(): - increment_reboot_counter() global sleep_duration print("[SPLASH] Going to sleep now...") badge.eink_busy_wait() #Always wait for e-ink deepsleep.start_sleeping(sleep_duration*1000) def badge_sleep_forever(): - increment_reboot_counter() print("[SPLASH] Going to sleep WITHOUT TIME WAKEUP now...") badge.eink_busy_wait() #Always wait for e-ink deepsleep.start_sleeping(0) #Sleep until button interrupt occurs @@ -319,8 +288,6 @@ def splashTimer_callback(tmr): global loopCnt global timer_loop_amount #print("[TIMER] "+str(loopCnt)) - #print("[BATTERY] "+str(badge.battery_volt_sense())+" ["+str(badge.battery_charge_status())+"]") - if loopCnt<1: loopCnt = timer_loop_amount cstate = badge.battery_charge_status() @@ -336,12 +303,8 @@ def splashTimer_callback(tmr): ugfx.flush() badge_sleep_forever() else: - if (bpp_check()): - draw_home(percent, cstate, "BPP", False, True) - bpp_execute() - else: - draw_home(percent, cstate, "Zzz...", False, True) - badge_sleep() + draw_home(percent, cstate, "Zzz...", False, True) + badge_sleep() else: if (loop_services(loopCnt)): loopCnt = timer_loop_amount @@ -386,6 +349,7 @@ def wifi_connect(): return True # CHECK OTA VERSION + def download_ota_info(): import gc import urequests as requests @@ -409,38 +373,42 @@ def download_ota_info(): return result def check_ota_available(): - import wifi - import network - global update_available - global update_name - global update_build - if not wifi.sta_if.isconnected(): - if not wifi_connect(): + try: + import wifi + import network + global update_available + global update_name + global update_build + if not wifi.sta_if.isconnected(): + if not wifi_connect(): + disableWifi() + return False + json = download_ota_info() + if (json): + import version + if (json["build"]>version.build): + update_available = True + update_name = json["name"] + update_build = json["build"] + ugfx.input_attach(ugfx.BTN_B, start_ota) + else: disableWifi() return False - json = download_ota_info() - if (json): - import version - if (json["build"]>version.build): - update_available = True - update_name = json["name"] - update_build = json["build"] - ugfx.input_attach(ugfx.BTN_B, start_ota) - else: disableWifi() + return True + except: + print("OTA CHECK EXCEPTION") return False - disableWifi() - return True # WELCOME (SETUP, SPONSORS OR CLOCK) def welcome(): - setupcompleted = badge.nvs_get_u8('badge', 'setup.state', 0) + setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) if (setupcompleted==0): # First boot (open setup) print("[SPLASH] Setup not completed. Running setup!") appglue.start_app("setup") elif (setupcompleted==1): # Second boot (after setup) print("[SPLASH] Showing sponsors once...") - badge.nvs_set_u8('badge', 'setup.state', 2) # Only force show sponsors once + badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once appglue.start_app("sponsors") else: # Setup completed print("[SPLASH] Normal boot.") @@ -453,43 +421,44 @@ def welcome(): # SETTINGS FROM NVS def load_settings(): - header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) - if (header_inv>0): - global header_fg - global header_bg - header_fg = ugfx.WHITE - header_bg = ugfx.BLACK - header_hws = badge.nvs_get_u8('splash', 'header.hws', 0) #Hide While Sleeping - if (header_hws>0): - global header_hide_while_sleeping - header_hide_while_sleeping = True - header_hbws = badge.nvs_get_u8('splash', 'header.hbws', 0) #Hide Battery While Sleeping - if (header_hbws>0): - global header_hide_battery_while_sleeping - header_hide_battery_while_sleeping = True - global sleep_duration - sleep_duration = badge.nvs_get_u8('splash', 'sleep.duration', 60) - if (sleep_duration<30): - print("[SPLASH] Sleep duration set to less than 30 seconds. Forcing 30 seconds.") - sleep_duration = 30 - #if (sleep_duration>120): - # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") - global battery_volt_min - battery_volt_min = badge.nvs_get_u16('splash', 'batt.vmin', 3700) # mV - global battery_volt_max - battery_volt_max = badge.nvs_get_u16('splash', 'batt.vmax', 4200) # mV - global battery_percent_empty - battery_percent_empty = badge.nvs_get_u8('splash', 'batt.pempty', 1) # % - global ntp_timeout - ntp_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries - global bpp_after_count - bpp_after_count = badge.nvs_get_u8('splash', 'bpp.count', 5) - global splash_timer_interval - splash_timer_interval = badge.nvs_get_u16('splash', 'tmr.interval', 200) - global timer_loop_amount - timer_loop_amount = badge.nvs_get_u8('splash', 'tmr.amount', 25) - global loopCnt - loopCnt = timer_loop_amount + try: + header_inv = badge.nvs_get_u8('splash', 'header.invert', 0) + if (header_inv>0): + global header_fg + global header_bg + header_fg = ugfx.WHITE + header_bg = ugfx.BLACK + header_hws = badge.nvs_get_u8('splash', 'header.hws', 0) #Hide While Sleeping + if (header_hws>0): + global header_hide_while_sleeping + header_hide_while_sleeping = True + header_hbws = badge.nvs_get_u8('splash', 'header.hbws', 0) #Hide Battery While Sleeping + if (header_hbws>0): + global header_hide_battery_while_sleeping + header_hide_battery_while_sleeping = True + global sleep_duration + sleep_duration = badge.nvs_get_u8('splash', 'sleep.duration', 60) + if (sleep_duration<30): + print("[SPLASH] Sleep duration set to less than 30 seconds. Forcing 30 seconds.") + sleep_duration = 30 + #if (sleep_duration>120): + # print("[SPLASH] Sleep duration set to more than 120 seconds. Forcing 120 seconds.") + global battery_volt_min + battery_volt_min = badge.nvs_get_u16('splash', 'bat.volt.min', 3500) # mV + global battery_volt_max + battery_volt_max = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV + global battery_percent_empty + battery_percent_empty = badge.nvs_get_u8('splash', 'bat.perc.empty', 1) # % + global ntp_timeout + ntp_timeout = badge.nvs_get_u8('splash', 'ntp.timeout', 40) #amount of tries + global splash_timer_interval + splash_timer_interval = badge.nvs_get_u16('splash', 'timer.interval', 200) + global timer_loop_amount + timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25) + global loopCnt + loopCnt = timer_loop_amount + except: + print("SETTINGS LOAD ERROR") # MAIN def splash_main(): @@ -506,7 +475,6 @@ def splash_main(): global battery_percent_empty if (cstate) or (percent>battery_percent_empty) or (vbatt<100): ugfx.input_init() - welcome() ugfx.input_attach(ugfx.BTN_START, start_launcher) ugfx.input_attach(ugfx.BTN_A, start_magic) ugfx.input_attach(ugfx.BTN_B, nothing) @@ -515,12 +483,14 @@ def splash_main(): ugfx.input_attach(ugfx.JOY_DOWN, nothing) ugfx.input_attach(ugfx.JOY_LEFT, nothing) ugfx.input_attach(ugfx.JOY_RIGHT, nothing) + try: + welcome() + except: + print("Well fuck.") global splashTimer setup_services() start_sleep_counter() full_clear = False - if (get_reboot_counter()==0): - full_clear = True draw_home(percent, cstate, header_status_string, full_clear, False) else: draw_batterylow(percent) @@ -540,7 +510,6 @@ def splash_main(): battery_volt_max = 4300 battery_percent_empty = 1 ntp_timeout = 40 -bpp_after_count = 5 header_status_string = "" splash_timer_interval = 500 From 4f96d70505cfe849d2e21d33a201e58834103d68 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 00:40:56 +0200 Subject: [PATCH 102/403] Bye bugs --- esp32/modules/splash.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 77f51e897..e04c1aa07 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,8 +1,8 @@ import ugfx, time, ntp, badge, machine, appglue, deepsleep, network, esp, gc, services # SHA2017 badge home screen -# Renze Nicolai -# Thomas Roos +# v2 Thomas Roos +# v1 Renze Nicolai def set_time_ntp(): draw_msg("Configuring clock...") @@ -77,6 +77,8 @@ def draw_home(do_BPP): badge.eink_busy_wait() # appglue.start_bpp() ## SHOULD BE THIS!! deepsleep.start_sleeping() + else: + ugfx.input_attach(ugfx.BTN_B, start_ota) def start_ota(pushed): if pushed: @@ -177,7 +179,6 @@ def check_ota_available(): if (json): import version if (json["build"] > version.build): - ugfx.input_attach(ugfx.BTN_B, start_ota) badge.nvs_set_u8('badge','OTA.ready',1) return True else: From 170630bfd6e50eda879f886a7d50f2a78093a429 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 00:53:36 +0200 Subject: [PATCH 103/403] Fuking bugs --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index e04c1aa07..092a8dd8c 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -12,6 +12,7 @@ def set_time_ntp(): draw_msg("Time set!") return True else: + draw_msg('RTC not set! :(') return False def draw_msg(msg): @@ -149,7 +150,6 @@ def connectWiFi(): if (timeout<1): draw_msg("Timeout while connecting!") disableWiFi() - time.sleep(1) return False return True From 66f1151d63419292baf04b702c98235e0729d4db Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 01:00:19 +0200 Subject: [PATCH 104/403] safe boot.py --- esp32/modules/inisetup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/esp32/modules/inisetup.py b/esp32/modules/inisetup.py index 3cdd0bbb7..042b7cc6d 100644 --- a/esp32/modules/inisetup.py +++ b/esp32/modules/inisetup.py @@ -6,7 +6,7 @@ def setup(): with open("/boot.py", "w") as f: f.write("""\ # This file is executed on every boot (including wake-boot from deepsleep) -import badge, machine, esp, ugfx +import badge, machine, esp, ugfx, deepsleep badge.init() ugfx.init() esp.rtcmem_write(0,0) @@ -21,6 +21,10 @@ def setup(): splash = load_me print("starting %s" % load_me) esp.rtcmem_write_string("") -__import__(splash) +try: + __import__(splash) +exception: + badge.nvs_set_str('badge','boot.splash','splash') + deepsleep.reboot() """) return vfs From 6dc824e214e1b9cd0dcf05e6542f02993cbac7a5 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 01:07:09 +0200 Subject: [PATCH 105/403] Reverting boot.py --- esp32/modules/inisetup.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/esp32/modules/inisetup.py b/esp32/modules/inisetup.py index 042b7cc6d..3cdd0bbb7 100644 --- a/esp32/modules/inisetup.py +++ b/esp32/modules/inisetup.py @@ -6,7 +6,7 @@ def setup(): with open("/boot.py", "w") as f: f.write("""\ # This file is executed on every boot (including wake-boot from deepsleep) -import badge, machine, esp, ugfx, deepsleep +import badge, machine, esp, ugfx badge.init() ugfx.init() esp.rtcmem_write(0,0) @@ -21,10 +21,6 @@ def setup(): splash = load_me print("starting %s" % load_me) esp.rtcmem_write_string("") -try: - __import__(splash) -exception: - badge.nvs_set_str('badge','boot.splash','splash') - deepsleep.reboot() +__import__(splash) """) return vfs From a4023bd65124e6c105b29d556f0485e85d3fa3ad Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Wed, 26 Jul 2017 01:21:38 +0200 Subject: [PATCH 106/403] appglue rtcmem bodge --- esp32/modules/appglue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/appglue.py b/esp32/modules/appglue.py index fdedbff13..69306bf3b 100644 --- a/esp32/modules/appglue.py +++ b/esp32/modules/appglue.py @@ -18,10 +18,10 @@ def home(): def start_ota(): esp.rtcmem_write(0,1) - esp.rtcmem_write(1,~1) + esp.rtcmem_write(1,254) deepsleep.reboot() def start_bpp(): esp.rtcmem_write(0,2) - esp.rtcmem_write(1,~2) + esp.rtcmem_write(1,253) deepsleep.reboot() From a271324fe39a8cc1bebb486b0c36f85af9c63652 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 01:44:07 +0200 Subject: [PATCH 107/403] Update first boot setup --- esp32/modules/setup.py | 67 +++++++++++------------------------------ esp32/modules/splash.py | 6 ++-- 2 files changed, 21 insertions(+), 52 deletions(-) diff --git a/esp32/modules/setup.py b/esp32/modules/setup.py index afafdf771..ce1459787 100644 --- a/esp32/modules/setup.py +++ b/esp32/modules/setup.py @@ -1,59 +1,28 @@ # SETUP APPLICATION -# SHOWN ON FIRST BOOT +# v2 by Thomas Roos +# v1 by Renze Nicolai -import ugfx, badge, appglue, dialogs, utime +import ugfx, badge, appglue, dialogs -def load_settings(): - return badge.nvs_get_str("owner", "name", "") +def asked_nickname(value): + if value: + badge.nvs_set_str("owner", "name", value) -def store_settings(nickname): - badge.nvs_set_str("owner", "name", nickname) + # Do the firstboot magic + newState = 1 if badge.nvs_get_u8('badge', 'setup.state', 0) == 0 else 3 + badge.nvs_set_u8('badge', 'setup.state', newState) -def is_developer(nickname): - if (nickname==""): + # Show the user that we are done + ugfx.clear(ugfx.WHITE) + ugfx.string(0, 0, "Hi, " + value, "PermanentMarker22", ugfx.BLACK) + ugfx.string(0, 25, "Your nick is stored to flash!", "Roboto_Regular12", ugfx.BLACK) + ugfx.flush(ugfx.LUT_FASTER) + else: badge.nvs_set_u8('badge', 'setup.state', 2) # Skip the sponsors - return True - return False -def action_home(pressed): - if (pressed): - appglue.start_app("") - -def set_setup_state(): - s_old = badge.nvs_get_u8('badge', 'setup.state', 0) - s_new = 2 - if (s_old==0): - s_new = 1 - badge.nvs_set_u8('badge', 'setup.state', s_new) - -def draw_setup_completed(): - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, "Setup", "PermanentMarker22", ugfx.BLACK) - ugfx.string(0, 25, "Settings stored to flash!", "Roboto_Regular12", ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTER) - ugfx.flush() - -def return_to_home(): badge.eink_busy_wait() appglue.start_app("") -def program_main(): - ugfx.init() - nickname = load_settings() - - def asked_nickname(value): - nickname = value if value else nickname - if not is_developer(nickname): - store_settings(nickname) - # Do the firstboot magic - set_setup_state() - # Show the user that we are done - draw_setup_completed() - utime.sleep(2) - return_to_home() - - dialogs.prompt_text("Nickname", nickname, cb=asked_nickname) - -# Start main application -program_main() - +ugfx.init() +nickname = badge.nvs_get_str("owner", "name", "") +dialogs.prompt_text("Nickname", nickname, cb=asked_nickname) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 092a8dd8c..1b4767f7e 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -197,16 +197,16 @@ def inputInit(): ugfx.input_attach(ugfx.JOY_RIGHT, press_nothing) def checkFirstBoot(): - setupcompleted = int(badge.nvs_get_str('badge', 'setup.state', '0')) + setupcompleted = badge.nvs_get_u8('badge', 'setup.state', 0) if setupcompleted == 0: # First boot (open setup) print("[SPLASH] Setup not completed. Running setup!") appglue.start_app("setup") elif setupcompleted == 1: # Second boot (after setup) print("[SPLASH] Showing sponsors once...") - badge.nvs_set_str('badge', 'setup.state', '2') # Only force show sponsors once + badge.nvs_set_u8('badge', 'setup.state', 2) # Only force show sponsors once appglue.start_app("sponsors") elif setupcompleted == 2: - badge.nvs_set_str('badge', 'setup.state', '3') + badge.nvs_set_u8('badge', 'setup.state', 3) check_ota_available() else: # Setup completed print("[SPLASH] Normal boot.") From 8273ea10d58b4a722070794f72dbf25833abe695 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 01:46:03 +0200 Subject: [PATCH 108/403] Change default name --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 1b4767f7e..819193d0a 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -211,7 +211,7 @@ def checkFirstBoot(): else: # Setup completed print("[SPLASH] Normal boot.") -nick = badge.nvs_get_str("owner", "name", 'John Doe') +nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV if badge.battery_charge_status() == False and badge.usb_volt_sense() > 4500 and badge.battery_volt_sense() > 2500: From 9f8be8d2e2dcb83d3422db58cfc70d84d3f0015c Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 26 Jul 2017 01:46:12 +0200 Subject: [PATCH 109/403] use input framework to check for waiting input. --- esp32/main.c | 86 ++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index ec6f7dd6b..80731af4e 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -51,12 +51,13 @@ #include "uart.h" #include "modmachine.h" #include "mpthreadport.h" +#include "bpp_init.h" #include "badge_portexp.h" #include "badge_pins.h" -#include "bpp_init.h" -#include "driver/gpio.h" #include "badge_base.h" #include "badge_first_run.h" +#include +#include // MicroPython runs as a task under FreeRTOS #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1) @@ -128,60 +129,51 @@ void mp_task(void *pvParameter) { } void do_bpp_bgnd() { - //Kick off bpp - bpp_init(); - printf("Bpp inited.\n"); - //immediately abort and reboot when touchpad detects something - while(gpio_get_level(PIN_NUM_MPR121_INT)==1) { - vTaskDelay(10); - } - printf("Touch detected. Exiting bpp, rebooting.\n"); + // Kick off bpp + bpp_init(); + + printf("Bpp inited.\n"); + + // immediately abort and reboot when touchpad detects something + while (badge_input_get_event(1000) == 0) { } + + printf("Touch detected. Exiting bpp, rebooting.\n"); esp_restart(); } void app_main(void) { - badge_check_first_run(); - badge_base_init(); + badge_check_first_run(); + badge_base_init(); - uint8_t magic = esp_rtcmem_read(0); - uint8_t inv_magic = esp_rtcmem_read(1); + uint8_t magic = esp_rtcmem_read(0); + uint8_t inv_magic = esp_rtcmem_read(1); -#ifdef CONFIG_SHA_BPP_ENABLE - //Grab level of int pin of touchpad. If high, this was a - //scheduled wakeup because of a deep sleep timeout. If low, - //the user used the touchpad. - //yes, this is v1 specific. Please add v0.x support yourself. - gpio_config_t io_conf = { - .mode = GPIO_MODE_INPUT, - .pin_bit_mask = 1LL << PIN_NUM_MPR121_INT, - .pull_down_en = 0, - .pull_up_en = 1, - }; - gpio_config(&io_conf); -#endif + if (magic == (uint8_t)~inv_magic) { + printf("Magic checked out!\n"); + switch (magic) { + case 1: + printf("Starting OTA\n"); + sha2017_ota_update(); + break; - if (magic == (uint8_t)~inv_magic) { - printf("Magic checked out!\n"); - switch (magic) { - case 1: - printf("Starting OTA\n"); - sha2017_ota_update(); - break; #ifdef CONFIG_SHA_BPP_ENABLE - case 2: - if (gpio_get_level(PIN_NUM_MPR121_INT)==1) { - printf("Touch int is high. Starting bpp.\n"); - do_bpp_bgnd(); - } - break; + case 2: + badge_init(); + if (badge_input_button_state == 0) { + printf("Starting bpp.\n"); + do_bpp_bgnd(); + } + break; #endif - case 3: - badge_first_run(); - } - } else { - xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, - &mp_task_stack[0], &mp_task_tcb, 0); - } + + case 3: + badge_first_run(); + } + + } else { + xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, + &mp_task_stack[0], &mp_task_tcb, 0); + } } void nlr_jump_fail(void *val) { From 6b4d4a25ceb1b3f016f9e4954bc630e6a0b7167f Mon Sep 17 00:00:00 2001 From: Eric Poulsen Date: Fri, 21 Jul 2017 10:30:35 -0700 Subject: [PATCH 110/403] extmod/modussl_mbedtls: Implement non-blocking SSL sockets. --- extmod/modussl_mbedtls.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index 8c90c2cf4..597eaee73 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -29,6 +29,7 @@ #include #include +#include // needed because mp_is_nonblocking_error uses system error codes #include "py/nlr.h" #include "py/runtime.h" @@ -83,6 +84,9 @@ int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) { int out_sz = sock_stream->write(sock, buf, len, &err); if (out_sz == MP_STREAM_ERROR) { + if (mp_is_nonblocking_error(err)) { + return MBEDTLS_ERR_SSL_WANT_WRITE; + } return -err; } else { return out_sz; @@ -97,6 +101,9 @@ int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) { int out_sz = sock_stream->read(sock, buf, len, &err); if (out_sz == MP_STREAM_ERROR) { + if (mp_is_nonblocking_error(err)) { + return MBEDTLS_ERR_SSL_WANT_READ; + } return -err; } else { return out_sz; @@ -199,6 +206,9 @@ STATIC mp_uint_t socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errc if (ret >= 0) { return ret; } + if (ret == MBEDTLS_ERR_SSL_WANT_READ) { + ret = MP_EWOULDBLOCK; + } *errcode = ret; return MP_STREAM_ERROR; } @@ -210,17 +220,20 @@ STATIC mp_uint_t socket_write(mp_obj_t o_in, const void *buf, mp_uint_t size, in if (ret >= 0) { return ret; } + if (ret == MBEDTLS_ERR_SSL_WANT_WRITE) { + ret = MP_EWOULDBLOCK; + } *errcode = ret; return MP_STREAM_ERROR; } STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t flag_in) { - // Currently supports only blocking mode - (void)self_in; - if (!mp_obj_is_true(flag_in)) { - mp_not_implemented(""); - } - return mp_const_none; + mp_obj_ssl_socket_t *o = MP_OBJ_TO_PTR(self_in); + mp_obj_t sock = o->sock; + mp_obj_t dest[3]; + mp_load_method(sock, MP_QSTR_setblocking, dest); + dest[2] = flag_in; + return mp_call_method_n_kw(1, 0, dest); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking); From 653a0c2d71100998a9cce0b7e2eb29ce54014aab Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 26 Jul 2017 12:51:46 +1000 Subject: [PATCH 111/403] extmod/machine_signal: Fix parsing of invert arg when Pin is first arg. --- extmod/machine_signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/machine_signal.c b/extmod/machine_signal.c index d08931296..78d0c3fee 100644 --- a/extmod/machine_signal.c +++ b/extmod/machine_signal.c @@ -96,7 +96,7 @@ STATIC mp_obj_t signal_make_new(const mp_obj_type_t *type, size_t n_args, size_t if (n_args == 1) { if (n_kw == 0) { } else if (n_kw == 1 && args[1] == MP_OBJ_NEW_QSTR(MP_QSTR_invert)) { - invert = mp_obj_is_true(args[1]); + invert = mp_obj_is_true(args[2]); } else { goto error; } From 23906af55c02766498f9eb4b57b6147fe030bc51 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 09:28:24 +0200 Subject: [PATCH 112/403] Charging status bugfix --- esp32/modules/splash.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 819193d0a..1f6f904f8 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -47,11 +47,11 @@ def draw_home(do_BPP): ugfx.box(42,7,2,8,ugfx.BLACK) ugfx.area(3,3,width,16,ugfx.BLACK) - - if badge.battery_charge_status(): - bat_status = 'Charging...' - elif vBatt > 100: - bat_status = str(round(vBatt/1000, 2)) + 'v' + if vBatt > 500: + if badge.battery_charge_status(): + bat_status = 'Charging...' + else: + bat_status = str(round(vBatt/1000, 2)) + 'v' else: bat_status = 'No battery' From 6144e8041d8520488e1f6e6f9a9f45c95f45b6ae Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Wed, 26 Jul 2017 13:07:16 +0200 Subject: [PATCH 113/403] Start mp instead of bpp on touch event --- esp32/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esp32/main.c b/esp32/main.c index 80731af4e..1769ddf62 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -162,7 +162,11 @@ void app_main(void) { if (badge_input_button_state == 0) { printf("Starting bpp.\n"); do_bpp_bgnd(); - } + } else { + printf("Touch wake after bpp.\n"); + xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, + &mp_task_stack[0], &mp_task_tcb, 0); + } break; #endif From 60a3e8e4277c70e42bac965bb2e198cb4cf1a59f Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 14:53:35 +0200 Subject: [PATCH 114/403] New installer version :D --- esp32/modules/installer.py | 226 +++++++++++++++++++------------------ esp32/modules/launcher.py | 21 ++-- esp32/modules/splash.py | 7 +- 3 files changed, 129 insertions(+), 125 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 9f42a019d..99299a0b8 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -1,96 +1,54 @@ -import ugfx, badge, sys, gc -import uos as os -import uerrno as errno -import ujson as json -import network, wifi -import machine, esp, time -import urequests as requests -import appglue - -wifi.init() - -ugfx.clear(ugfx.BLACK) -ugfx.string(20,25,"Connecting to:","Roboto_BlackItalic24",ugfx.WHITE) -ugfx.string(140,75, "WiFi","PermanentMarker22",ugfx.WHITE) -ugfx.flush() - -timeout = 250 -while not wifi.sta_if.isconnected(): - time.sleep(0.1) - timeout = timeout - 1 - if (timeout<1): - ugfx.clear(ugfx.BLACK) - ugfx.string(5,5,"Failure.","Roboto_BlackItalic24",ugfx.WHITE) - ugfx.flush() - time.sleep(2) - appglue.start_app("") - pass - -ugfx.clear(ugfx.WHITE) +import ugfx, badge, network, gc, time, urequests, appglue + +# SHA2017 Badge installer +# V2 Thomas Roos +# V1 Niek Blankers + +def draw_msg(msg): + global line_number + try: + line_number + except: + line_number = 0 + ugfx.clear(ugfx.WHITE) + ugfx.string(0, 0, 'Still Loading Anyway...', "PermanentMarker22", ugfx.BLACK) + ugfx.set_lut(ugfx.LUT_FASTER) + draw_msg(msg) + else: + ugfx.string(0, 30 + (line_number * 15), msg, "Roboto_Regular12", ugfx.BLACK) + ugfx.flush() + line_number += 1 + +def connectWiFi(): + nw = network.WLAN(network.STA_IF) + if not nw.isconnected(): + nw.active(True) + ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') + password = badge.nvs_get_str('badge', 'wifi.password') + nw.connect(ssid, password) if password else nw.connect(ssid) + + draw_msg("Connecting to '"+ssid+"'...") + + timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) + while not nw.isconnected(): + time.sleep(0.1) + timeout = timeout - 1 + if (timeout<1): + draw_msg("Timeout while connecting!") + nw.active(True) + return False + return True def show_description(active): if active: + global text text.text(packages[options.selected_index()]["description"]) ugfx.flush() -def empty_options(): - global options - options.destroy() - options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) - -ugfx.input_init() - -window = ugfx.Container(0, 0, ugfx.width(), ugfx.height()) - -options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) - -text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) -text.text("Downloading category list...") - -ugfx.flush(ugfx.LUT_FULL) -badge.eink_busy_wait() -ugfx.set_lut(ugfx.LUT_FASTER) - -packages = {} # global variable - -gc.collect() - -f = requests.get("https://badge.sha2017.org/eggs/categories/json") -try: - categories = f.json() -finally: - f.close() - -gc.collect() - -def show_category(active): - if active: - ugfx.string_box(148,0,148,26, "Hatchery", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) - text.text("Install or update eggs from the hatchery here.\nSelect a category to start, or press B to return to the launcher.\n\nbadge.sha2017.org") - ugfx.flush() - -def list_categories(): - global options - global text - - empty_options() - text.destroy() - text = ugfx.Textbox(int(ugfx.width()/2),26,int(ugfx.width()/2),ugfx.height()-26) - - ugfx.input_attach(ugfx.JOY_UP, show_category) - ugfx.input_attach(ugfx.JOY_DOWN, show_category) - ugfx.input_attach(ugfx.BTN_A, select_category) - ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("launcher") if pushed else 0) - ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) - - for category in categories: - options.add_item("%s (%d) >" % (category["name"], category["eggs"])) - - show_category(True) - def select_category(active): if active: global categories + global options index = options.selected_index() category = categories[index]["slug"] list_apps(category) @@ -106,46 +64,48 @@ def list_apps(slug): ugfx.input_attach(ugfx.BTN_B, 0) ugfx.input_attach(ugfx.BTN_START, 0) - empty_options() - text.destroy() - text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) + while options.count() > 0: + options.remove_item(0) text.text("Downloading list of eggs...") - ugfx.flush(ugfx.LUT_FULL) - badge.eink_busy_wait() + ugfx.flush() - gc.collect() - f = requests.get("https://badge.sha2017.org/eggs/category/%s/json" % slug) try: + f = urequests.get("https://badge.sha2017.org/eggs/category/%s/json" % slug) packages = f.json() finally: f.close() - gc.collect() - for package in packages: options.add_item("%s rev. %s" % (package["name"], package["revision"])) ugfx.input_attach(ugfx.JOY_UP, show_description) ugfx.input_attach(ugfx.JOY_DOWN, show_description) ugfx.input_attach(ugfx.BTN_A, install_app) - ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("installer") if pushed else 0) - ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("installer") if pushed else 0) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: list_categories() if pushed else 0) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app('') if pushed else 0) show_description(True) - badge.eink_busy_wait() ugfx.set_lut(ugfx.LUT_FASTER) + gc.collect() + +def start_categories(pushed): + if pushed: + list_categories() + +def start_app(pushed): + if pushed: + global selected_app + appglue.start_app(selected_app) def install_app(active): if active: global options global text global packages + global selected_app index = options.selected_index() - options.destroy() - text.destroy() - ugfx.input_attach(ugfx.JOY_UP, 0) ugfx.input_attach(ugfx.JOY_DOWN, 0) ugfx.input_attach(ugfx.BTN_A, 0) @@ -158,19 +118,71 @@ def install_app(active): ugfx.flush() import woezel - woezel.install(packages[index]["slug"]) + selected_app = packages[index]["slug"] + woezel.install(selected_app) ugfx.clear(ugfx.WHITE) ugfx.string(40,25,"Installed:","Roboto_BlackItalic24",ugfx.BLACK) ugfx.string(100,55, packages[index]["name"],"PermanentMarker22",ugfx.BLACK) - text = ugfx.Textbox(0,100, ugfx.width(), ugfx.height()-100) - text.text("Press A to start %s, or B to return to the installer" % packages[index]["name"]) - - ugfx.input_attach(ugfx.BTN_A, lambda pushed: appglue.start_app(packages[index]["slug"]) if pushed else 0) - ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("installer")) - ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("")) + ugfx.string(0, 115, "[ A: START | B: BACK ]", "Roboto_Regular12", ugfx.BLACK) + + ugfx.input_attach(ugfx.BTN_A, start_app) + ugfx.input_attach(ugfx.BTN_B, start_categories) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) ugfx.flush() + gc.collect() + +def list_categories(): + global options + global text + global categories + + try: + categories + except: + ugfx.input_init() + draw_msg('Getting categories') + try: + f = urequests.get("https://badge.sha2017.org/eggs/categories/json") + categories = f.json() + except: + draw_msg('Failed!') + draw_msg('Returning to launcher :(') + appglue.start_app('launcher') + + f.close() + draw_msg('Done!') + + ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) + ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) + ugfx.input_attach(ugfx.BTN_A, select_category) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("launcher") if pushed else 0) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) + ugfx.clear(ugfx.WHITE) + ugfx.flush() -list_categories() + while options.count() > 0: + options.remove_item(0) + for category in categories: + options.add_item("%s (%d) >" % (category["name"], category["eggs"])) + + ugfx.string_box(148,0,148,26, "Hatchery", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + text.text("Install or update eggs from the hatchery here\n\n\n\n") + ugfx.line(148, 78, 296, 78, ugfx.BLACK) + ugfx.string_box(148,78,148,18, " A: Open catergory", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.string_box(148,92,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.line(148, 110, 296, 110, ugfx.BLACK) + ugfx.string_box(148,110,148,18, " badge.sha2017.org", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.flush(ugfx.LUT_FULL) + gc.collect() + + +if not connectWiFi(): + draw_msg('Returning to launcher :(') + appglue.start_app('launcher') +else: + options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) + text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) + list_categories() diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index a68ae4442..f044b2f58 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,14 +1,8 @@ -import ugfx, badge, sys, gc -import uos as os -import uerrno as errno -import ujson as json -import time -import esp -import appglue -import version +import ugfx, badge, sys, uos as os, appglue, version ugfx.init() ugfx.input_init() +ugfx.set_lut(ugfx.LUT_FASTER) ugfx.clear(ugfx.BLACK) ugfx.flush() ugfx.clear(ugfx.WHITE) @@ -31,8 +25,8 @@ # Instructions ugfx.line(148, 78, 296, 78, ugfx.BLACK) ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) -ugfx.string_box(148,78,148,18, " B: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) -ugfx.string_box(148,92,148,18, " START: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) +ugfx.string_box(148,78,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) +ugfx.string_box(148,92,148,18, " SELECT: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) ugfx.line(148, 110, 296, 110, ugfx.BLACK) ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) @@ -113,13 +107,12 @@ def perform_uninstall(ok): populate_it() ugfx.input_attach(ugfx.BTN_A, run_it) -ugfx.input_attach(ugfx.BTN_B, uninstall_it) +ugfx.input_attach(ugfx.BTN_SELECT, uninstall_it) ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) +ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("") if pushed else 0) ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) -ugfx.set_lut(ugfx.LUT_FULL) -ugfx.flush() -ugfx.set_lut(ugfx.LUT_FASTER) +ugfx.flush(ugfx.LUT_FULL) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 1f6f904f8..98d955e57 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -61,8 +61,8 @@ def draw_home(do_BPP): if do_BPP: info = '[ ANY: Wake up ]' elif OTA_available: - info = '[ B: UPDATE ] [ START: LAUNCHER ]' - ugfx.string(0, 108, 'OTA ready!', 'Roboto_Regular18', ugfx.BLACK) + info = '[ SELECT: UPDATE | START: LAUNCHER ]' + ugfx.string(0, 115, 'OTA ready!', 'Roboto_Regular12', ugfx.BLACK) else: info = '[ START: LAUNCHER ]' @@ -79,7 +79,7 @@ def draw_home(do_BPP): # appglue.start_bpp() ## SHOULD BE THIS!! deepsleep.start_sleeping() else: - ugfx.input_attach(ugfx.BTN_B, start_ota) + ugfx.input_attach(ugfx.BTN_SELECT, start_ota) def start_ota(pushed): if pushed: @@ -232,7 +232,6 @@ def checkFirstBoot(): else: OTA_available = badge.nvs_get_u8('badge','OTA.ready',0) -disableWiFi() ugfx.clear(ugfx.WHITE) ugfx.flush(ugfx.LUT_FASTER) From d5e83a6465fb6f49be98aeeb21db1b23c232653e Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 14:55:29 +0200 Subject: [PATCH 115/403] Small bugfix --- esp32/modules/installer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 99299a0b8..7e4a3fd32 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -152,7 +152,11 @@ def list_categories(): appglue.start_app('launcher') f.close() - draw_msg('Done!') + draw_msg('Done!') + options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) + text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) + + ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) @@ -183,6 +187,4 @@ def list_categories(): draw_msg('Returning to launcher :(') appglue.start_app('launcher') else: - options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) - text = ugfx.Textbox(int(ugfx.width()/2),0, int(ugfx.width()/2), ugfx.height()) list_categories() From 98772174de7d5c21f8150a6cce161556c6880256 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 15:18:30 +0200 Subject: [PATCH 116/403] Small help fixes --- esp32/help.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/esp32/help.c b/esp32/help.c index 397cc6923..2115f2f27 100644 --- a/esp32/help.c +++ b/esp32/help.c @@ -46,7 +46,6 @@ const char *esp32_help_text = "Using the e-ink display:\n" "\n" "import ugfx\n" -"ugfx.init() # Initialize display\n" "ugfx.clear(ugfx.BLACK) # Clear screen\n" "ugfx.string(120, 50, \"Test\", \"Roboto_BlackItalic24\", ugfx.WHITE) # Write a string to the center of the screen\n" "ugfx.flush() # Send the update to the screen\n" @@ -54,24 +53,21 @@ const char *esp32_help_text = "Interfacing with the buttons:\n" "\n" "import ugfx\n" -"ugfx.init() # Initialize ugfx subsystem\n" "ugfx.input_init() # Initialize button callbacks\n" "ugfx.input_attach(ugfx.JOY_UP, lambda pressed: print(pressed)) # Connect button callback function\n" -"while True: pass # Stay in python loop to get events\n" "\n" "Controlling the RGBW LEDs:\n" "TODO\n" "\n" "Starting an app called 'name' after sleepcycle:\n" "\n" -"import esp" -"esp.rtcmem_write_string('name')" -"esp.start_sleeping(1)" +"import appglue" +"appglue.start_app(name)" "\n" "Getting and setting configuration:\n" "\n" -"esp.nvs_set_str('namespace', 'key', 'value')\n" -"esp.nvs_get_str('namespace', 'key', 'default_value')\n" +"badge.nvs_set_str('namespace', 'key', 'value')\n" +"badge.nvs_get_str('namespace', 'key', 'default_value')\n" "\n" "For further help on a specific object, type help(obj)\n" "For a list of available modules, type help('modules')\n" From 158af3ff590f1911f70b19892c0728373d99f3c9 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 15:27:24 +0200 Subject: [PATCH 117/403] Bugfix battery cal --- esp32/modules/splash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 98d955e57..89ada52cd 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -215,9 +215,9 @@ def checkFirstBoot(): vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV if badge.battery_charge_status() == False and badge.usb_volt_sense() > 4500 and badge.battery_volt_sense() > 2500: - badge.nvs_set_u16('splash', 'bat.volt.drop', 4200 - badge.battery_volt_sense()) # mV + badge.nvs_set_u16('splash', 'bat.volt.drop', 5200 - badge.battery_volt_sense()) # mV print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) -vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 0) # mV +vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 0) - 1000 # mV inputInit() magic = 0 From 86e35a772d3ead24dc71cef8f181cb82c338aa95 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 15:31:10 +0200 Subject: [PATCH 118/403] Ugh fuking battery indicator --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 89ada52cd..6014f58cd 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -217,7 +217,7 @@ def checkFirstBoot(): if badge.battery_charge_status() == False and badge.usb_volt_sense() > 4500 and badge.battery_volt_sense() > 2500: badge.nvs_set_u16('splash', 'bat.volt.drop', 5200 - badge.battery_volt_sense()) # mV print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) -vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 0) - 1000 # mV +vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 1000) - 1000 # mV inputInit() magic = 0 From 542b6598a01f399a8db7fd32f4049785cf52f9fb Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 16:14:57 +0200 Subject: [PATCH 119/403] More fixes :D --- esp32/modules/installer.py | 8 ++++---- esp32/modules/splash.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 7e4a3fd32..86903ffd3 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -149,7 +149,7 @@ def list_categories(): except: draw_msg('Failed!') draw_msg('Returning to launcher :(') - appglue.start_app('launcher') + appglue.start_app('launcher', False) f.close() draw_msg('Done!') @@ -161,7 +161,7 @@ def list_categories(): ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) ugfx.input_attach(ugfx.BTN_A, select_category) - ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("launcher") if pushed else 0) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("launcher", False) if pushed else 0) ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) ugfx.clear(ugfx.WHITE) @@ -172,8 +172,8 @@ def list_categories(): for category in categories: options.add_item("%s (%d) >" % (category["name"], category["eggs"])) - ugfx.string_box(148,0,148,26, "Hatchery", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) text.text("Install or update eggs from the hatchery here\n\n\n\n") + ugfx.string_box(148,0,148,26, "Hatchery", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) ugfx.line(148, 78, 296, 78, ugfx.BLACK) ugfx.string_box(148,78,148,18, " A: Open catergory", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) ugfx.string_box(148,92,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) @@ -185,6 +185,6 @@ def list_categories(): if not connectWiFi(): draw_msg('Returning to launcher :(') - appglue.start_app('launcher') + appglue.start_app('launcher', False) else: list_categories() diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 6014f58cd..e0e93f37c 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -48,7 +48,7 @@ def draw_home(do_BPP): ugfx.area(3,3,width,16,ugfx.BLACK) if vBatt > 500: - if badge.battery_charge_status(): + if badge.battery_charge_status() and badge.usb_volt_sense() > 4000: bat_status = 'Charging...' else: bat_status = str(round(vBatt/1000, 2)) + 'v' From 12377fcf83c6f51c21707911bdf25995496efdd3 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 16:21:06 +0200 Subject: [PATCH 120/403] Remove double loading screen... --- esp32/modules/launcher.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index f044b2f58..28bfb9197 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -53,12 +53,6 @@ def run_it(pushed): if (pushed): selected = options.selected_text() options.destroy() - - ugfx.clear(ugfx.BLACK) - ugfx.string_box(0, 25, 296, 25,"Running:","Roboto_BlackItalic24",ugfx.WHITE, ugfx.justifyCenter) - ugfx.string_box(0, 51, 296, 23, selected, "PermanentMarker22", ugfx.WHITE, ugfx.justifyCenter) - ugfx.flush() - badge.eink_busy_wait() appglue.start_app(selected) def expandhome(s): From 955afdde9c322e4e1dd937bceea8f33e3d4b0fd3 Mon Sep 17 00:00:00 2001 From: Aram Date: Wed, 26 Jul 2017 18:43:27 +0200 Subject: [PATCH 121/403] Added a urandom port for Unix build --- unix/modos.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/unix/modos.c b/unix/modos.c index a090bc3f7..9497ed5c5 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -240,6 +240,17 @@ STATIC mp_obj_t mod_os_errno(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_os_errno_obj, 0, 1, mod_os_errno); +STATIC mp_obj_t os_urandom(mp_obj_t num) { + mp_int_t n = mp_obj_get_int(num); + vstr_t vstr; + vstr_init_len(&vstr, n); + FILE *fp = fopen("/dev/urandom", "r"); + fread(&vstr.buf, 1, n, fp); + fclose(fp); + return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(os_urandom_obj, os_urandom); + STATIC const mp_rom_map_elem_t mp_module_os_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uos) }, { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mod_os_errno_obj) }, @@ -253,6 +264,7 @@ STATIC const mp_rom_map_elem_t mp_module_os_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_mkdir), MP_ROM_PTR(&mod_os_mkdir_obj) }, { MP_ROM_QSTR(MP_QSTR_listdir), MP_ROM_PTR(&mod_os_listdir_obj) }, { MP_ROM_QSTR(MP_QSTR_ilistdir), MP_ROM_PTR(&mod_os_ilistdir_obj) }, + { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&os_urandom_obj) }, #if MICROPY_PY_OS_DUPTERM { MP_ROM_QSTR(MP_QSTR_dupterm), MP_ROM_PTR(&mp_uos_dupterm_obj) }, #endif From 154fa6ac4f897992d882d1c85f2b83987c28416b Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 19:54:38 +0200 Subject: [PATCH 122/403] Non critical splash ota bug --- esp32/modules/splash.py | 1 + 1 file changed, 1 insertion(+) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index e0e93f37c..8b4535a3f 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -83,6 +83,7 @@ def draw_home(do_BPP): def start_ota(pushed): if pushed: + badge.nvs_set_u8('badge','OTA.ready',0) appglue.start_ota() def press_nothing(pushed): From b9f17345998f8fea005899edcd92e7cd5f4ca246 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Wed, 26 Jul 2017 22:21:13 +0200 Subject: [PATCH 123/403] Add support for removal of NVS page --- esp32/modbadge.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index ec0e7df21..190add438 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -45,15 +45,34 @@ STATIC mp_obj_t badge_init_() { STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_init_obj, badge_init_); /*** nvs access ***/ -static void _nvs_check_namespace_key(const char *namespace, const char *key) { + +static void _nvs_check_namespace(const char *namespace) { if (strlen(namespace) == 0 || strlen(namespace) > 15) { mp_raise_msg(&mp_type_AttributeError, "Invalid namespace"); } +} + +static void _nvs_check_namespace_key(const char *namespace, const char *key) { + _nvs_check_namespace(namespace); + if (strlen(key) == 0 || strlen(key) > 15) { mp_raise_msg(&mp_type_AttributeError, "Invalid key"); } } +STATIC mp_obj_t badge_nvs_erase_all_(mp_obj_t _namespace) { + const char *namespace = mp_obj_str_get_str(_namespace); + _nvs_check_namespace(namespace); + + esp_err_t err = badge_nvs_erase_all(namespace); + if (err != ESP_OK) { + mp_raise_msg(&mp_type_ValueError, "Failed to store data in nvs"); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(badge_nvs_erase_all_obj, badge_nvs_erase_all_); + STATIC mp_obj_t badge_nvs_erase_key_(mp_obj_t _namespace, mp_obj_t _key) { const char *namespace = mp_obj_str_get_str(_namespace); const char *key = mp_obj_str_get_str(_key); @@ -347,6 +366,7 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_eink_init), MP_ROM_PTR(&badge_eink_init_obj)}, {MP_OBJ_NEW_QSTR(MP_QSTR_power_init), (mp_obj_t)&badge_power_init_obj}, + {MP_ROM_QSTR(MP_QSTR_nvs_erase_all), MP_ROM_PTR(&badge_nvs_erase_all_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_erase_key), MP_ROM_PTR(&badge_nvs_erase_key_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_get_str), MP_ROM_PTR(&badge_nvs_get_str_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_set_str), MP_ROM_PTR(&badge_nvs_set_str_obj)}, From a7ec24ebbb6679592f9d6fe64e26648cc748ab73 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Thu, 27 Jul 2017 12:15:48 +0200 Subject: [PATCH 124/403] Missing #include --- unix/modos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/unix/modos.c b/unix/modos.c index 9497ed5c5..9fd7d4564 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ +#include #include #include #include From a3cd349eafb2f612379f10c45ab1ad4175e322e2 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 27 Jul 2017 14:41:27 +0300 Subject: [PATCH 125/403] tools/mpy_bin2res: Tools to convert binary resources to Python module. Afterwards, they can be access using pkg_resource module from micropython-lib. --- tools/mpy_bin2res.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 tools/mpy_bin2res.py diff --git a/tools/mpy_bin2res.py b/tools/mpy_bin2res.py new file mode 100755 index 000000000..0c89e7e92 --- /dev/null +++ b/tools/mpy_bin2res.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# +# This tool converts binary resource files passed on the command line +# into a Python source file containing data from these files, which can +# be accessed using standard pkg_resources.resource_stream() function +# from micropython-lib: +# https://github.com/micropython/micropython-lib/tree/master/pkg_resources +# +import sys + +print("R = {") + +for fname in sys.argv[1:]: + with open(fname, "rb") as f: + b = f.read() + print("%r: %r," % (fname, b)) + +print("}") From cc48bff72600e5f996c84b452c797e56d6203321 Mon Sep 17 00:00:00 2001 From: Aram Date: Thu, 27 Jul 2017 18:03:58 +0200 Subject: [PATCH 126/403] Added gfx_userfs glue to micropython build --- esp32/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/esp32/Makefile b/esp32/Makefile index 8d01d5421..ea4dc315a 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -680,6 +680,7 @@ BADGE_COMPONENTS_O = $(addprefix $(BADGE)/components/,\ ugfx-glue/gdisp_lld_framebuffer.o \ ugfx-glue/ginput_lld_toggle.o \ ugfx-glue/gfx_mk.o \ + ugfx-glue/gfx_userfs.o \ sha2017/wildcard_sha2017_org.o \ sha2017/sha2017_ota_graphics.o \ sha2017/sha2017_ota.o \ From 5c7cea9806a8cc6f990a6659b6cb075afc20934a Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Thu, 27 Jul 2017 20:54:50 +0200 Subject: [PATCH 127/403] Update error messages nvs --- esp32/modbadge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 190add438..dd19b00c7 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -66,7 +66,7 @@ STATIC mp_obj_t badge_nvs_erase_all_(mp_obj_t _namespace) { esp_err_t err = badge_nvs_erase_all(namespace); if (err != ESP_OK) { - mp_raise_msg(&mp_type_ValueError, "Failed to store data in nvs"); + mp_raise_msg(&mp_type_ValueError, "Failed to erase all keys in nvs"); } return mp_const_none; @@ -80,7 +80,7 @@ STATIC mp_obj_t badge_nvs_erase_key_(mp_obj_t _namespace, mp_obj_t _key) { esp_err_t err = badge_nvs_erase_key(namespace, key); if (err != ESP_OK) { - mp_raise_msg(&mp_type_ValueError, "Failed to store data in nvs"); + mp_raise_msg(&mp_type_ValueError, "Failed to erase key in nvs"); } return mp_const_none; From f5cff25e084a268792d4189afeca54ce81e06d1a Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Thu, 27 Jul 2017 22:02:09 +0200 Subject: [PATCH 128/403] uos.urandom() bugfix. --- unix/modos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/modos.c b/unix/modos.c index 9fd7d4564..4b4431e91 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -246,7 +246,7 @@ STATIC mp_obj_t os_urandom(mp_obj_t num) { vstr_t vstr; vstr_init_len(&vstr, n); FILE *fp = fopen("/dev/urandom", "r"); - fread(&vstr.buf, 1, n, fp); + fread(vstr.buf, 1, n, fp); fclose(fp); return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); } From 6888e6b7569d0a013addf2774e7998271c34f611 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Thu, 27 Jul 2017 23:59:31 +0200 Subject: [PATCH 129/403] Fix installer bugs --- esp32/modules/installer.py | 26 ++++++++++++++------------ esp32/modules/launcher.py | 27 +++++++++++++-------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 86903ffd3..97e5effef 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -50,8 +50,9 @@ def select_category(active): global categories global options index = options.selected_index() - category = categories[index]["slug"] - list_apps(category) + if categories[index]["eggs"] > 0: + category = categories[index]["slug"] + list_apps(category) def list_apps(slug): global options @@ -67,7 +68,7 @@ def list_apps(slug): while options.count() > 0: options.remove_item(0) text.text("Downloading list of eggs...") - ugfx.flush() + ugfx.flush(ugfx.LUT_FULL) try: f = urequests.get("https://badge.sha2017.org/eggs/category/%s/json" % slug) @@ -77,15 +78,15 @@ def list_apps(slug): for package in packages: options.add_item("%s rev. %s" % (package["name"], package["revision"])) + options.selected_index(0) ugfx.input_attach(ugfx.JOY_UP, show_description) ugfx.input_attach(ugfx.JOY_DOWN, show_description) ugfx.input_attach(ugfx.BTN_A, install_app) - ugfx.input_attach(ugfx.BTN_B, lambda pushed: list_categories() if pushed else 0) - ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app('') if pushed else 0) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: list_categories() if pushed else False) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app('') if pushed else False) show_description(True) - ugfx.set_lut(ugfx.LUT_FASTER) gc.collect() def start_categories(pushed): @@ -128,7 +129,7 @@ def install_app(active): ugfx.input_attach(ugfx.BTN_A, start_app) ugfx.input_attach(ugfx.BTN_B, start_categories) - ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else False) ugfx.flush() gc.collect() @@ -158,11 +159,11 @@ def list_categories(): - ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) - ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) + ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else False) + ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else False) ugfx.input_attach(ugfx.BTN_A, select_category) - ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("launcher", False) if pushed else 0) - ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) + ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("launcher", False) if pushed else False) + ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else False) ugfx.clear(ugfx.WHITE) ugfx.flush() @@ -171,11 +172,12 @@ def list_categories(): options.remove_item(0) for category in categories: options.add_item("%s (%d) >" % (category["name"], category["eggs"])) + options.selected_index(0) text.text("Install or update eggs from the hatchery here\n\n\n\n") ugfx.string_box(148,0,148,26, "Hatchery", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) ugfx.line(148, 78, 296, 78, ugfx.BLACK) - ugfx.string_box(148,78,148,18, " A: Open catergory", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.string_box(148,78,148,18, " A: Open category", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) ugfx.string_box(148,92,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) ugfx.line(148, 110, 296, 110, ugfx.BLACK) ugfx.string_box(148,110,148,18, " badge.sha2017.org", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 28bfb9197..345428f8b 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,6 +1,5 @@ import ugfx, badge, sys, uos as os, appglue, version -ugfx.init() ugfx.input_init() ugfx.set_lut(ugfx.LUT_FASTER) ugfx.clear(ugfx.BLACK) @@ -34,6 +33,19 @@ options = None install_path = None +populate_it() + +ugfx.input_attach(ugfx.BTN_A, run_it) +ugfx.input_attach(ugfx.BTN_SELECT, uninstall_it) + +ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) +ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) + +ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("") if pushed else 0) +ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) + +ugfx.flush(ugfx.LUT_FULL) + def populate_it(): global options options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) @@ -97,16 +109,3 @@ def perform_uninstall(ok): import dialogs uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) - -populate_it() - -ugfx.input_attach(ugfx.BTN_A, run_it) -ugfx.input_attach(ugfx.BTN_SELECT, uninstall_it) - -ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) -ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) - -ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("") if pushed else 0) -ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) - -ugfx.flush(ugfx.LUT_FULL) From e785c2352f1cc41974b52c4d7030b6f11ae083cd Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Fri, 28 Jul 2017 01:16:52 +0200 Subject: [PATCH 130/403] badge_touch -> badge_cpt112s --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index ea4dc315a..d661d0639 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -664,7 +664,7 @@ BADGE_COMPONENTS_O = $(addprefix $(BADGE)/components/,\ badge/badge_mpr121.o \ badge/badge_portexp.o \ badge/badge_gpiobutton.o \ - badge/badge_touch.o \ + badge/badge_cpt112s.o \ badge/badge_input.o \ badge/badge_sdcard.o \ badge/badge_vibrator.o \ From ba413c38d1a7fed5243360e4b3a40a296210f01a Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Fri, 28 Jul 2017 01:17:20 +0200 Subject: [PATCH 131/403] Whoooops fixing launcher --- esp32/modules/launcher.py | 93 ++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 345428f8b..7078d5b1e 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,51 +1,5 @@ import ugfx, badge, sys, uos as os, appglue, version -ugfx.input_init() -ugfx.set_lut(ugfx.LUT_FASTER) -ugfx.clear(ugfx.BLACK) -ugfx.flush() -ugfx.clear(ugfx.WHITE) -ugfx.flush() - -ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) - -#the line under the text -str_len = ugfx.get_string_width("Hacking","PermanentMarker22") -line_begin = 148 + int((148-str_len)/2) -line_end = str_len+line_begin -ugfx.line(line_begin, 46, line_end, 46, ugfx.BLACK) - -#the cursor past the text -cursor_pos = line_end+5 -ugfx.line(cursor_pos, 22, cursor_pos, 44, ugfx.BLACK) - -# Instructions -ugfx.line(148, 78, 296, 78, ugfx.BLACK) -ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) -ugfx.string_box(148,78,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) -ugfx.string_box(148,92,148,18, " SELECT: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) -ugfx.line(148, 110, 296, 110, ugfx.BLACK) -ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) - -# ugfx.flush() -options = None -install_path = None - -populate_it() - -ugfx.input_attach(ugfx.BTN_A, run_it) -ugfx.input_attach(ugfx.BTN_SELECT, uninstall_it) - -ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) -ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) - -ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("") if pushed else 0) -ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) - -ugfx.flush(ugfx.LUT_FULL) - def populate_it(): global options options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) @@ -109,3 +63,50 @@ def perform_uninstall(ok): import dialogs uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) + + +ugfx.input_init() +ugfx.set_lut(ugfx.LUT_FASTER) +ugfx.clear(ugfx.BLACK) +ugfx.flush() +ugfx.clear(ugfx.WHITE) +ugfx.flush() + +ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) +ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) +ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + +#the line under the text +str_len = ugfx.get_string_width("Hacking","PermanentMarker22") +line_begin = 148 + int((148-str_len)/2) +line_end = str_len+line_begin +ugfx.line(line_begin, 46, line_end, 46, ugfx.BLACK) + +#the cursor past the text +cursor_pos = line_end+5 +ugfx.line(cursor_pos, 22, cursor_pos, 44, ugfx.BLACK) + +# Instructions +ugfx.line(148, 78, 296, 78, ugfx.BLACK) +ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) +ugfx.string_box(148,78,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) +ugfx.string_box(148,92,148,18, " SELECT: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) +ugfx.line(148, 110, 296, 110, ugfx.BLACK) +ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + +# ugfx.flush() +options = None +install_path = None + +populate_it() + +ugfx.input_attach(ugfx.BTN_A, run_it) +ugfx.input_attach(ugfx.BTN_SELECT, uninstall_it) + +ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) +ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) + +ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("") if pushed else 0) +ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) + +ugfx.flush(ugfx.LUT_FULL) From 46b73021095b427278842c01a1e5d5247297fa16 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Fri, 28 Jul 2017 01:33:17 +0200 Subject: [PATCH 132/403] renamed badge_portexp to badge_fxl6408 --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index d661d0639..7e89bf08b 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -662,7 +662,7 @@ BADGE_COMPONENTS_O = $(addprefix $(BADGE)/components/,\ badge/badge_i2c.o \ badge/badge_leds.o \ badge/badge_mpr121.o \ - badge/badge_portexp.o \ + badge/badge_fxl6408.o \ badge/badge_gpiobutton.o \ badge/badge_cpt112s.o \ badge/badge_input.o \ From b01ce99398054128ffee89c17dbcaa153b21875b Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Fri, 28 Jul 2017 02:55:29 +0200 Subject: [PATCH 133/403] remove useless include --- esp32/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/esp32/main.c b/esp32/main.c index 1769ddf62..4ed1f673b 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -52,7 +52,6 @@ #include "modmachine.h" #include "mpthreadport.h" #include "bpp_init.h" -#include "badge_portexp.h" #include "badge_pins.h" #include "badge_base.h" #include "badge_first_run.h" From 54d7439f7c9b0a06e622673febbe13d1de0d940d Mon Sep 17 00:00:00 2001 From: powermik Date: Fri, 28 Jul 2017 07:44:30 +0200 Subject: [PATCH 134/403] Update demo.py --- unix/demo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unix/demo.py b/unix/demo.py index 9a89d244e..eeff8be30 100644 --- a/unix/demo.py +++ b/unix/demo.py @@ -43,3 +43,6 @@ def start_app(pushed): ugfx.input_attach(ugfx.BTN_B, lambda pressed: render('B', pressed)) ugfx.input_attach(ugfx.BTN_START, start_app) ugfx.input_attach(ugfx.BTN_SELECT, lambda pressed: render('Select', pressed)) + +while True: + pass From 642e10a2fc665c525ec49a0093390892be4c242b Mon Sep 17 00:00:00 2001 From: Niek Blankers Date: Fri, 28 Jul 2017 13:53:17 +0200 Subject: [PATCH 135/403] Up installer WiFi timeout from 4s to 15s --- esp32/modules/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 97e5effef..37fe85179 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -29,7 +29,7 @@ def connectWiFi(): draw_msg("Connecting to '"+ssid+"'...") - timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) + timeout = 150 while not nw.isconnected(): time.sleep(0.1) timeout = timeout - 1 From f578947ae3fee5610c5bc1123baf878b92eaa248 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 28 Jul 2017 17:24:31 +0300 Subject: [PATCH 136/403] .travis.yml: Pin cpp-coveralls at 0.3.12. Next version, 0.4.0 appears to depend on newer version of urllib3 and conflicts with version installed in Travis. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9915cdd00..14d5df0a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,8 @@ before_script: # For teensy build - sudo apt-get install realpath # For coverage testing - - sudo pip install cpp-coveralls + # cpp-coveralls 0.4 conflicts with urllib3 preinstalled in Travis VM + - sudo pip install cpp-coveralls==0.3.12 - gcc --version - arm-none-eabi-gcc --version - python3 --version From 894897dc03ffd3efa09bdf8db1f774721193f8c1 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Fri, 28 Jul 2017 17:12:46 +0200 Subject: [PATCH 137/403] NEW SPLASH, WIP --- esp32/modules/services.py | 8 +- esp32/modules/splash.py | 423 +++++++++++++++++++++++--------------- 2 files changed, 267 insertions(+), 164 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 1ba7c367d..6f42dee1e 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -1,8 +1,10 @@ import uos -# SHA2017 badge services -# Renze Nicolai -# Thomas Roos +# File: services.py +# Description: Background services for SHA2017 badge +# License: MIT +# Authors: Renze Nicolai +# Thomas Roos def setup(): global services diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 8b4535a3f..cd35ec542 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,37 +1,18 @@ -import ugfx, time, ntp, badge, machine, appglue, deepsleep, network, esp, gc, services - -# SHA2017 badge home screen -# v2 Thomas Roos -# v1 Renze Nicolai - -def set_time_ntp(): - draw_msg("Configuring clock...") - if connectWiFi(): - draw_msg("Setting time over NTP...") - ntp.set_NTP_time() - draw_msg("Time set!") - return True - else: - draw_msg('RTC not set! :(') - return False +import ugfx, time, ntp, badge, machine, deepsleep, network, esp, gc +import appglue, services + +# File: splash.py +# Version: 3 +# Description: Homescreen for SHA2017 badge +# License: MIT +# Authors: Renze Nicolai +# Thomas Roos -def draw_msg(msg): - global line_number - try: - line_number - except: - line_number = 0 - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, 'Still Loading Anyway...', "PermanentMarker22", ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTER) - draw_msg(msg) - else: - ugfx.string(0, 30 + (line_number * 15), msg, "Roboto_Regular12", ugfx.BLACK) - ugfx.flush() - line_number += 1 -def draw_home(do_BPP): +### FUNCTIONS +# Graphics +def splash_draw_battery(): vBatt = badge.battery_volt_sense() vBatt += vDrop @@ -57,11 +38,15 @@ def draw_home(do_BPP): ugfx.string(47, 2, bat_status,'Roboto_Regular18',ugfx.BLACK) +def splash_draw_nickname(): + global nick + ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) - if do_BPP: +def splash_draw_actions(): + if splash_power_countdown_get()<1: info = '[ ANY: Wake up ]' elif OTA_available: - info = '[ SELECT: UPDATE | START: LAUNCHER ]' + info = '[ SELECT: UPDATE ] [ START: LAUNCHER ]' ugfx.string(0, 115, 'OTA ready!', 'Roboto_Regular12', ugfx.BLACK) else: info = '[ START: LAUNCHER ]' @@ -69,176 +54,292 @@ def draw_home(do_BPP): l = ugfx.get_string_width(info,"Roboto_Regular12") ugfx.string(296-l, 115, info, "Roboto_Regular12",ugfx.BLACK) - ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) +def splash_draw(): + global splashDrawMsgLineNumber + splashDrawMsgLineNumber = 0 + ugfx.clear(ugfx.WHITE) + splash_draw_battery() + splash_draw_nickname() + splash_draw_actions() services.draw() - ugfx.flush(ugfx.LUT_FULL) + - if do_BPP: - badge.eink_busy_wait() - # appglue.start_bpp() ## SHOULD BE THIS!! - deepsleep.start_sleeping() +def splash_draw_msg(message, clear=False): + global splashDrawMsgLineNumber + try: + splashDrawMsgLineNumber + except: + splashDrawMsgLineNumber = 0 + + if clear: + ugfx.clear(ugfx.WHITE) + ugfx.string(0, 0, 'Still Loading Anyway...', "PermanentMarker22", ugfx.BLACK) + ugfx.set_lut(ugfx.LUT_FASTER) + draw_msg(msg) + splashDrawMsgLineNumber = 0 else: - ugfx.input_attach(ugfx.BTN_SELECT, start_ota) - -def start_ota(pushed): - if pushed: - badge.nvs_set_u8('badge','OTA.ready',0) - appglue.start_ota() - -def press_nothing(pushed): - if pushed: - global loopCount - loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) - -def press_start(pushed): - if pushed: - appglue.start_app("launcher", False) + ugfx.string(0, 30 + (splashDrawMsgLineNumber * 15), msg, "Roboto_Regular12", ugfx.BLACK) + ugfx.flush() + splashDrawMsgLineNumber += 1 -def press_a(pushed): - if pushed: - global loopCount - global magic - loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) - magic += 1 - if magic > 9: - appglue.start_app('magic', False) - else: - print("[SPLASH] Magic in "+str(10-magic)+"...") - -def sleepIfEmpty(vbatt): - global battery_volt_min - if (vbatt > 100) and (vbatt < battery_volt_min): - increment_reboot_counter() - print("[SPLASH] Going to sleep WITHOUT TIME WAKEUP now...") - badge.eink_busy_wait() #Always wait for e-ink - deepsleep.start_sleeping(0) #Sleep until button interrupt occurs - else: +# WiFi +def splash_wifi_connect(): + global wifiStatus + try: + wifiStatus + except: + wifiStatus = False + + if not wifiStatus: + nw = network.WLAN(network.STA_IF) + if not nw.isconnected(): + nw.active(True) + ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') + password = badge.nvs_get_str('badge', 'wifi.password') + nw.connect(ssid, password) if password else nw.connect(ssid) + + draw_msg("Connecting to WiFi...", True) + draw_msg("("+ssid+")") + + timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) + while not nw.isconnected(): + time.sleep(0.1) + timeout = timeout - 1 + if (timeout<1): + draw_msg("Timeout while connecting!") + splash_wifi_disable() + return False + wifiStatus = True return True + return False -def splashTimer_callback(tmr): - global loopCount +def splash_wifi_active(): + global wifiStatus try: - loopCount + wifiStatus except: - loopCount = badge.nvs_get_u8('splash', 'timer.amount', 50) - draw_home(False) - else: - if loopCount < 1 and badge.usb_volt_sense() < 4500: - draw_home(True) - else: - if not services.loop(loopCount): - loopCount -= 1 - -def disableWiFi(): + wifiStatus = False + return wifiStatus + + +def splash_wifi_disable(): + global wifiStatus + wifiStatus = False nw = network.WLAN(network.STA_IF) nw.active(False) - -def connectWiFi(): - nw = network.WLAN(network.STA_IF) - if not nw.isconnected(): - nw.active(True) - ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') - password = badge.nvs_get_str('badge', 'wifi.password') - nw.connect(ssid, password) if password else nw.connect(ssid) - - draw_msg("Connecting to '"+ssid+"'...") - - timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) - while not nw.isconnected(): - time.sleep(0.1) - timeout = timeout - 1 - if (timeout<1): - draw_msg("Timeout while connecting!") - disableWiFi() - return False + +# NTP clock configuration +def splash_ntp(): + if not splash_wifi_active(): + if not splash_wifi_connect(): + return False + draw_msg("Configuring clock...", True) + ntp.set_NTP_time() + draw_msg("Done") return True + +# OTA update checking -def download_ota_info(): +def splash_ota_download_info(): import urequests as requests - draw_msg("Downloading OTA status...") + splash_draw_msg("Checking for updates...", True) result = False try: data = requests.get("https://badge.sha2017.org/version") except: - draw_msg("Could not download JSON!") + splash_draw_msg("Error:") + splash_draw_msg("Could not download JSON!") time.sleep(5) return False try: result = data.json() except: data.close() - draw_msg("Could not decode JSON!") + splash_draw_msg("Error:") + splash_draw_msg("Could not decode JSON!") time.sleep(5) return False data.close() return result -def check_ota_available(): - if connectWiFi(): - json = download_ota_info() - if (json): - import version - if (json["build"] > version.build): - badge.nvs_set_u8('badge','OTA.ready',1) - return True - else: - badge.nvs_set_u8('badge','OTA.ready',0) +def splash_ota_check(): + if not splash_wifi_active(): + if not splash_wifi_connect(): + return False + + info = splash_ota_download_info() + if info: + import version + if info["build"] > version.build: + badge.nvs_set_u8('badge','OTA.ready',1) + return True + + badge.nvs_set_u8('badge','OTA.ready',0) return False -def inputInit(): +def splash_ota_start(): + pass + +# About + +def splash_about_countdown_reset(): + global splashAboutCountdown + splashAboutCountdown = badge.nvs_get_u8('splash', 'about.amount', 10) + +def splash_about_countdown_trigger(): + global splashAboutCountdown + try: + splashAboutCountdown + except: + splash_about_countdown_reset() + + splashAboutCountdown -= 1 + if splashAboutCountdown<0: + appglue.start_app('magic', False) + else: + print("[SPLASH] Magic in "+str(splashAboutCountdown)+"...") + + +# Power management + +def splash_power_countdown_reset(): + global splashPowerCountdown + splashPowerCountdown = badge.nvs_get_u8('splash', 'timer.amount', 50) + +def splash_power_countdown_get(): + global splashPowerCountdown + try: + splashPowerCountdown + except: + splash_power_countdown_reset() + return splashPowerCountdown + +def splash_power_countdown_trigger(): + global splashPowerCountdown + try: + splashPowerCountdown + except: + splash_power_countdown_reset() + + splashPowerCountdown -= 1 + + if splashPowerCountdown<0: + print("[SPLASH] Going to sleep...") + badge.eink_busy_wait() + appglue.start_bpp() + else: + print("[SPLASH] Sleep in "+str(splashPowerCountdown)+"...") + + +# Button input + +def splash_input_start(pressed): + # Pressing start always starts the launcher + if pressed: + appglue.start_app("launcher", False) + +def splash_input_a(pressed): + if pressed: + splash_power_countdown_reset() + splash_about_countdown_trigger() + +def splash_input_select(pressed): + if pressed: + global otaAvailable + if otaAvailable: + splash_ota_start() + splash_power_countdown_reset() + +def splash_input_other(pressed): + if pressed: + splash_power_countdown_reset() + +def splash_input_init(): ugfx.input_init() - ugfx.input_attach(ugfx.BTN_START, press_start) - ugfx.input_attach(ugfx.BTN_A, press_a) - ugfx.input_attach(ugfx.BTN_B, press_nothing) - ugfx.input_attach(ugfx.BTN_SELECT, press_nothing) - ugfx.input_attach(ugfx.JOY_UP, press_nothing) - ugfx.input_attach(ugfx.JOY_DOWN, press_nothing) - ugfx.input_attach(ugfx.JOY_LEFT, press_nothing) - ugfx.input_attach(ugfx.JOY_RIGHT, press_nothing) - -def checkFirstBoot(): - setupcompleted = badge.nvs_get_u8('badge', 'setup.state', 0) - if setupcompleted == 0: # First boot (open setup) - print("[SPLASH] Setup not completed. Running setup!") - appglue.start_app("setup") - elif setupcompleted == 1: # Second boot (after setup) - print("[SPLASH] Showing sponsors once...") - badge.nvs_set_u8('badge', 'setup.state', 2) # Only force show sponsors once - appglue.start_app("sponsors") - elif setupcompleted == 2: - badge.nvs_set_u8('badge', 'setup.state', 3) - check_ota_available() - else: # Setup completed - print("[SPLASH] Normal boot.") + ugfx.input_attach(ugfx.BTN_START, splash_input_start) + ugfx.input_attach(ugfx.BTN_A, splash_input_a) + ugfx.input_attach(ugfx.BTN_B, splash_input_other) + ugfx.input_attach(ugfx.BTN_SELECT, splash_input_select) + ugfx.input_attach(ugfx.JOY_UP, splash_input_other) + ugfx.input_attach(ugfx.JOY_DOWN, splash_input_other) + ugfx.input_attach(ugfx.JOY_LEFT, splash_input_other) + ugfx.input_attach(ugfx.JOY_RIGHT, splash_input_other) + +# Event timer +def splash_timer_init(): + global splashTimer + try: + splashTimer + print("[SPLASH] Timer exists already") + except: + splashTimer = machine.Timer(-1) + splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.PERIODIC, callback=splash_timer_callback) + print("[SPLASH] Timer created") + +def splash_timer_callback(tmr): + try: + services.loop(splash_power_countdown_get()) + except: + pass + splash_draw() + splash_power_countdown_trigger() + +### PROGRAM +# Load settings from NVS nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV + +# Calibrate battery voltage drop if badge.battery_charge_status() == False and badge.usb_volt_sense() > 4500 and badge.battery_volt_sense() > 2500: badge.nvs_set_u16('splash', 'bat.volt.drop', 5200 - badge.battery_volt_sense()) # mV print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 1000) - 1000 # mV -inputInit() -magic = 0 - -checkFirstBoot() - -#If clock on time before 2017 -doOTA = set_time_ntp() if time.time() < 1482192000 else True - -if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and doOTA: - OTA_available = check_ota_available() -else: - OTA_available = badge.nvs_get_u8('badge','OTA.ready',0) - -ugfx.clear(ugfx.WHITE) -ugfx.flush(ugfx.LUT_FASTER) +# Initialize user input subsystem +splash_input_init() + +# Initialize power management subsystem +splash_power_countdown_reset() + +# Initialize about subsystem +splash_about_countdown_reset() + +# Setup / Sponsors / OTA check / NTP clock sync +setupState = badge.nvs_get_u8('badge', 'setup.state', 0) +if setupState == 0: #First boot + print("[SPLASH] First boot...") + appglue.start_app("setup") +elif setupState == 1: # Second boot: Show sponsors + print("[SPLASH] Second boot...") + badge.nvs_set_u8('badge', 'setup.state', 2) + appglue.start_app("sponsors") +elif setupcompleted == 2: # Third boot: force OTA check + print("[SPLASH] Third boot...") + badge.nvs_set_u8('badge', 'setup.state', 3) + otaCheck = splash_ntp() if time.time() < 1482192000 else True + otaAvailable = splash_ota_check() +else: # Normal boot + print("[SPLASH] Normal boot...") + otaCheck = splash_ntp() if time.time() < 1482192000 else True + if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and otaCheck: + otaAvailable = splash_ota_check() + else: + otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) + +# Disable WiFi if active +splash_wifi_disable() -foundService = services.setup() +# Initialize services +services.setup() -splashTimer = machine.Timer(-1) -splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.PERIODIC, callback=splashTimer_callback) +# Initialize timer +splash_timer_init() +# Clean memory gc.collect() + +# Draw homescreen +splash_draw() From 5f29511981badc5a266a48276f76ec3db8e89b9f Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Fri, 28 Jul 2017 20:42:02 +0200 Subject: [PATCH 138/403] Bugfixes --- esp32/modules/splash.py | 59 +++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index cd35ec542..f88e816eb 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -12,7 +12,7 @@ ### FUNCTIONS # Graphics -def splash_draw_battery(): +def splash_draw_battery(status=""): vBatt = badge.battery_volt_sense() vBatt += vDrop @@ -35,6 +35,9 @@ def splash_draw_battery(): bat_status = str(round(vBatt/1000, 2)) + 'v' else: bat_status = 'No battery' + + if status!="": + bat_status = status ugfx.string(47, 2, bat_status,'Roboto_Regular18',ugfx.BLACK) @@ -43,22 +46,27 @@ def splash_draw_nickname(): ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) def splash_draw_actions(): - if splash_power_countdown_get()<1: + global otaAvailable + if splash_power_countdown_get()<1: # Badge is going to sleep info = '[ ANY: Wake up ]' - elif OTA_available: + elif otaAvailable: # OTA update available info = '[ SELECT: UPDATE ] [ START: LAUNCHER ]' - ugfx.string(0, 115, 'OTA ready!', 'Roboto_Regular12', ugfx.BLACK) - else: + else: # Normal operation info = '[ START: LAUNCHER ]' l = ugfx.get_string_width(info,"Roboto_Regular12") - ugfx.string(296-l, 115, info, "Roboto_Regular12",ugfx.BLACK) + ugfx.string(296-l, 0, info, "Roboto_Regular12",ugfx.BLACK) def splash_draw(): global splashDrawMsgLineNumber splashDrawMsgLineNumber = 0 ugfx.clear(ugfx.WHITE) - splash_draw_battery() + + status = "" + if otaAvailable: + status = "Update available!" + + splash_draw_battery(status) splash_draw_nickname() splash_draw_actions() services.draw() @@ -74,12 +82,12 @@ def splash_draw_msg(message, clear=False): if clear: ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, 'Still Loading Anyway...', "PermanentMarker22", ugfx.BLACK) + ugfx.string(0, 0, message, "PermanentMarker22", ugfx.BLACK) ugfx.set_lut(ugfx.LUT_FASTER) - draw_msg(msg) + ugfx.flush() splashDrawMsgLineNumber = 0 else: - ugfx.string(0, 30 + (splashDrawMsgLineNumber * 15), msg, "Roboto_Regular12", ugfx.BLACK) + ugfx.string(0, 30 + (splashDrawMsgLineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) ugfx.flush() splashDrawMsgLineNumber += 1 @@ -99,15 +107,15 @@ def splash_wifi_connect(): password = badge.nvs_get_str('badge', 'wifi.password') nw.connect(ssid, password) if password else nw.connect(ssid) - draw_msg("Connecting to WiFi...", True) - draw_msg("("+ssid+")") + splash_draw_msg("Connecting to WiFi...", True) + splash_draw_msg("("+ssid+")") timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) while not nw.isconnected(): time.sleep(0.1) timeout = timeout - 1 if (timeout<1): - draw_msg("Timeout while connecting!") + splash_draw_msg("Timeout while connecting!") splash_wifi_disable() return False wifiStatus = True @@ -134,9 +142,9 @@ def splash_ntp(): if not splash_wifi_active(): if not splash_wifi_connect(): return False - draw_msg("Configuring clock...", True) + splash_draw_msg("Configuring clock...", True) ntp.set_NTP_time() - draw_msg("Done") + splash_draw_msg("Done") return True # OTA update checking @@ -221,10 +229,14 @@ def splash_power_countdown_trigger(): splashPowerCountdown except: splash_power_countdown_reset() - + splashPowerCountdown -= 1 - if splashPowerCountdown<0: + if splashPowerCountdown<1: + if badge.usb_volt_sense() > 4500: + print("[SPLASH] USB connected, not sleeping.") + splash_power_countdown_reset() + elif splashPowerCountdown<0: print("[SPLASH] Going to sleep...") badge.eink_busy_wait() appglue.start_bpp() @@ -237,15 +249,18 @@ def splash_power_countdown_trigger(): def splash_input_start(pressed): # Pressing start always starts the launcher if pressed: + print("[SPLASH] Start button pressed") appglue.start_app("launcher", False) def splash_input_a(pressed): if pressed: + print("[SPLASH] A button pressed") splash_power_countdown_reset() splash_about_countdown_trigger() def splash_input_select(pressed): if pressed: + print("[SPLASH] Select button pressed") global otaAvailable if otaAvailable: splash_ota_start() @@ -253,9 +268,11 @@ def splash_input_select(pressed): def splash_input_other(pressed): if pressed: + print("[SPLASH] Other button pressed") splash_power_countdown_reset() def splash_input_init(): + print("[SPLASH] Inputs attached") ugfx.input_init() ugfx.input_attach(ugfx.BTN_START, splash_input_start) ugfx.input_attach(ugfx.BTN_A, splash_input_a) @@ -274,7 +291,7 @@ def splash_timer_init(): print("[SPLASH] Timer exists already") except: splashTimer = machine.Timer(-1) - splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.PERIODIC, callback=splash_timer_callback) + splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 250), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) print("[SPLASH] Timer created") def splash_timer_callback(tmr): @@ -284,6 +301,8 @@ def splash_timer_callback(tmr): pass splash_draw() splash_power_countdown_trigger() + tmr.init(period=badge.nvs_get_u16('splash', 'timer.period', 250), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) + ### PROGRAM @@ -316,7 +335,7 @@ def splash_timer_callback(tmr): print("[SPLASH] Second boot...") badge.nvs_set_u8('badge', 'setup.state', 2) appglue.start_app("sponsors") -elif setupcompleted == 2: # Third boot: force OTA check +elif setupState == 2: # Third boot: force OTA check print("[SPLASH] Third boot...") badge.nvs_set_u8('badge', 'setup.state', 3) otaCheck = splash_ntp() if time.time() < 1482192000 else True @@ -336,7 +355,7 @@ def splash_timer_callback(tmr): services.setup() # Initialize timer -splash_timer_init() +#splash_timer_init() # Clean memory gc.collect() From 456450437fc572d0296d52be0035e135ab6814d8 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 28 Jul 2017 21:41:42 +0300 Subject: [PATCH 139/403] py/modio: BufferedWriter: Convert to mp_rom_map_elem_t. --- py/modio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py/modio.c b/py/modio.c index 2d317d022..a6a093278 100644 --- a/py/modio.c +++ b/py/modio.c @@ -112,9 +112,9 @@ STATIC mp_obj_t bufwriter_flush(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bufwriter_flush_obj, bufwriter_flush); -STATIC const mp_map_elem_t bufwriter_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flush), (mp_obj_t)&bufwriter_flush_obj }, +STATIC const mp_rom_map_elem_t bufwriter_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&bufwriter_flush_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bufwriter_locals_dict, bufwriter_locals_dict_table); @@ -127,7 +127,7 @@ STATIC const mp_obj_type_t bufwriter_type = { .name = MP_QSTR_BufferedWriter, .make_new = bufwriter_make_new, .protocol = &bufwriter_stream_p, - .locals_dict = (mp_obj_t)&bufwriter_locals_dict, + .locals_dict = (mp_obj_dict_t*)&bufwriter_locals_dict, }; #endif // MICROPY_PY_IO_BUFFEREDWRITER From 406270018835824b53bd585c3b84c3232c52d601 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Fri, 28 Jul 2017 23:09:37 +0200 Subject: [PATCH 140/403] Added bppro partition mount (not verified) --- esp32/modules/splash.py | 135 ++++++++++++++++++++++++++-------------- extmod/vfs_native.c | 4 ++ 2 files changed, 92 insertions(+), 47 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index f88e816eb..c2ebe734f 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -13,67 +13,101 @@ # Graphics def splash_draw_battery(status=""): + vUsb = badge.usb_volt_sense() vBatt = badge.battery_volt_sense() vBatt += vDrop - - ugfx.clear(ugfx.WHITE) - - width = round((vBatt-vMin) / (vMax-vMin) * 38) - if width < 0: - width = 0 - elif width > 38: - width = 38 - - ugfx.box(2,2,40,18,ugfx.BLACK) - ugfx.box(42,7,2,8,ugfx.BLACK) - ugfx.area(3,3,width,16,ugfx.BLACK) - - if vBatt > 500: - if badge.battery_charge_status() and badge.usb_volt_sense() > 4000: - bat_status = 'Charging...' - else: - bat_status = str(round(vBatt/1000, 2)) + 'v' + + if vBatt>500 and badge.battery_charge_status() and vUsb>4000: + try: + badge.eink_png(0,0,'/chrg.png') + except: + ugfx.string(0, 0, "CHRG",'Roboto_Regular12',ugfx.BLACK) + elif vUsb>4000: + try: + badge.eink_png(0,0,'/usb.png') + except: + ugfx.string(0, 0, "USB",'Roboto_Regular12',ugfx.BLACK) + elif vBatt<500: + try: + badge.eink_png(0,0,'/nobatt.png') + except: + ugfx.string(0, 0, "NO BATT",'Roboto_Regular12',ugfx.BLACK) else: - bat_status = 'No battery' - + width = round((vBatt-vMin) / (vMax-vMin) * 38) + if width < 0: + width = 0 + elif width > 38: + width = 38 + ugfx.box(2,2,40,18,ugfx.BLACK) + ugfx.box(42,7,2,8,ugfx.BLACK) + ugfx.area(3,3,width,16,ugfx.BLACK) + if status!="": bat_status = status + elif vUsb < 4000 and splash_power_countdown_get()<2: + bat_status = "Zzz..." + elif vBatt > 500: + bat_status = str(round(vBatt/1000, 2)) + 'v ('+str(splash_power_countdown_get())+')' + else: + bat_status = 'No battery' ugfx.string(47, 2, bat_status,'Roboto_Regular18',ugfx.BLACK) def splash_draw_nickname(): global nick - ugfx.string(0, 40, nick, "PermanentMarker36", ugfx.BLACK) + ugfx.string(0, 25, nick, "PermanentMarker36", ugfx.BLACK) def splash_draw_actions(): global otaAvailable if splash_power_countdown_get()<1: # Badge is going to sleep - info = '[ ANY: Wake up ]' - elif otaAvailable: # OTA update available - info = '[ SELECT: UPDATE ] [ START: LAUNCHER ]' - else: # Normal operation - info = '[ START: LAUNCHER ]' - - l = ugfx.get_string_width(info,"Roboto_Regular12") - ugfx.string(296-l, 0, info, "Roboto_Regular12",ugfx.BLACK) - -def splash_draw(): - global splashDrawMsgLineNumber - splashDrawMsgLineNumber = 0 - ugfx.clear(ugfx.WHITE) + info1 = '[ ANY: WAKE UP ]' + else: + info1 = '[ START: LAUNCHER ]' + if otaAvailable: + info2 = '[ SELECT: UPDATE ]' + else: + info2 = '' + + l = ugfx.get_string_width(info1,"Roboto_Regular12") + ugfx.string(296-l, 0, info1, "Roboto_Regular12",ugfx.BLACK) + l = ugfx.get_string_width(info2,"Roboto_Regular12") + ugfx.string(296-l, 12, info2, "Roboto_Regular12",ugfx.BLACK) + +def splash_draw(full=False): + global splashDrawMsg + if splashDrawMsg: + splashDrawMsg = False + full = True + global splashDrawMsgLineNumber + splashDrawMsgLineNumber = 0 + + if splash_power_countdown_get()<1: + full= True + + if full: + ugfx.clear(ugfx.WHITE) + splash_draw_nickname() + else: + ugfx.area(0,0,ugfx.width(),24,ugfx.WHITE) + ugfx.area(0,ugfx.height()-64,ugfx.width(),64,ugfx.WHITE) status = "" if otaAvailable: status = "Update available!" - splash_draw_battery(status) - splash_draw_nickname() splash_draw_actions() + services.draw() - ugfx.flush(ugfx.LUT_FULL) + + if full: + ugfx.flush(ugfx.LUT_FULL) + else: + ugfx.flush(ugfx.LUT_FASTEST) def splash_draw_msg(message, clear=False): + global splashDrawMsg + splashDrawMsg = True global splashDrawMsgLineNumber try: splashDrawMsgLineNumber @@ -231,17 +265,17 @@ def splash_power_countdown_trigger(): splash_power_countdown_reset() splashPowerCountdown -= 1 - + if splashPowerCountdown<1: if badge.usb_volt_sense() > 4500: - print("[SPLASH] USB connected, not sleeping.") + #print("[SPLASH] USB connected, not sleeping.") splash_power_countdown_reset() elif splashPowerCountdown<0: print("[SPLASH] Going to sleep...") badge.eink_busy_wait() appglue.start_bpp() - else: - print("[SPLASH] Sleep in "+str(splashPowerCountdown)+"...") + #else: + # print("[SPLASH] Sleep in "+str(splashPowerCountdown)+"...") # Button input @@ -265,6 +299,10 @@ def splash_input_select(pressed): if otaAvailable: splash_ota_start() splash_power_countdown_reset() + +def splash_input_left(pressed): + if pressed: + appglue.start_bpp() def splash_input_other(pressed): if pressed: @@ -280,7 +318,7 @@ def splash_input_init(): ugfx.input_attach(ugfx.BTN_SELECT, splash_input_select) ugfx.input_attach(ugfx.JOY_UP, splash_input_other) ugfx.input_attach(ugfx.JOY_DOWN, splash_input_other) - ugfx.input_attach(ugfx.JOY_LEFT, splash_input_other) + ugfx.input_attach(ugfx.JOY_LEFT, splash_input_left) ugfx.input_attach(ugfx.JOY_RIGHT, splash_input_other) # Event timer @@ -291,7 +329,7 @@ def splash_timer_init(): print("[SPLASH] Timer exists already") except: splashTimer = machine.Timer(-1) - splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 250), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) + splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) print("[SPLASH] Timer created") def splash_timer_callback(tmr): @@ -301,14 +339,14 @@ def splash_timer_callback(tmr): pass splash_draw() splash_power_countdown_trigger() - tmr.init(period=badge.nvs_get_u16('splash', 'timer.period', 250), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) + tmr.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) ### PROGRAM # Load settings from NVS nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') -vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3600) # mV +vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3700) # mV vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV # Calibrate battery voltage drop @@ -317,6 +355,9 @@ def splash_timer_callback(tmr): print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 1000) - 1000 # mV +# Set global variables +splashDrawMsg = False + # Initialize user input subsystem splash_input_init() @@ -355,10 +396,10 @@ def splash_timer_callback(tmr): services.setup() # Initialize timer -#splash_timer_init() +splash_timer_init() # Clean memory gc.collect() # Draw homescreen -splash_draw() +splash_draw(True) diff --git a/extmod/vfs_native.c b/extmod/vfs_native.c index 320096edf..187aa7e28 100644 --- a/extmod/vfs_native.c +++ b/extmod/vfs_native.c @@ -20,6 +20,8 @@ #include "extmod/vfs_native.h" #include "lib/timeutils/timeutils.h" +#include "bpp_init.h" + #define mp_obj_native_vfs_t fs_user_mount_t static const char *TAG = "vfs_native.c"; @@ -413,6 +415,8 @@ STATIC mp_obj_t native_vfs_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t m } native_vfs_mounted = true; + + bpp_mount_ropart(); return mp_const_none; } From 4436b0156ace4076851fd52902e8f91ff0901d84 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Fri, 28 Jul 2017 23:12:41 +0200 Subject: [PATCH 141/403] Change service draw direction (breaks existing services a little bit, can be fixed in eggs by checking firmware version) --- esp32/modules/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 6f42dee1e..a17088674 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -47,12 +47,12 @@ def loop(lcnt): def draw(): global services x = 0 - y = 114 + y = 64 for srv in services: try: space_used = srv.draw(x,y) if (space_used>0): - y = y - abs(space_used) + y = y + abs(space_used) except BaseException as msg: print("[SERVICES] Service draw exception: ", msg) From 74867f106af4bbc69a10a2c117759dc85d35db7b Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Fri, 28 Jul 2017 23:25:20 +0200 Subject: [PATCH 142/403] Disable a bit of debug code --- esp32/modules/splash.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index c2ebe734f..658a9793a 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -300,9 +300,9 @@ def splash_input_select(pressed): splash_ota_start() splash_power_countdown_reset() -def splash_input_left(pressed): - if pressed: - appglue.start_bpp() +#def splash_input_left(pressed): +# if pressed: +# appglue.start_bpp() def splash_input_other(pressed): if pressed: @@ -318,7 +318,7 @@ def splash_input_init(): ugfx.input_attach(ugfx.BTN_SELECT, splash_input_select) ugfx.input_attach(ugfx.JOY_UP, splash_input_other) ugfx.input_attach(ugfx.JOY_DOWN, splash_input_other) - ugfx.input_attach(ugfx.JOY_LEFT, splash_input_left) + ugfx.input_attach(ugfx.JOY_LEFT, splash_input_other) ugfx.input_attach(ugfx.JOY_RIGHT, splash_input_other) # Event timer From e82e0ab692463de7679a72f3871112f805367211 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Fri, 28 Jul 2017 23:45:52 +0200 Subject: [PATCH 143/403] Add clock --- esp32/modules/splash.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 658a9793a..082d429e1 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -11,6 +11,30 @@ ### FUNCTIONS +# RTC +def splash_rtc_string(date=False, time=True): + [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() + monthstr = str(month) + if (month<10): + monthstr = "0"+monthstr + daystr = str(mday) + if (mday<10): + daystr = "0"+daystr + hourstr = str(hour) + if (hour<10): + hourstr = "0"+hourstr + minstr = str(min) + if (min<10): + minstr = "0"+minstr + output = "" + if date: + output += daystr+"-"+monthstr+"-"+str(year) + if time: + output += " " + if time: + output += hourstr+":"+minstr + return output + # Graphics def splash_draw_battery(status=""): vUsb = badge.usb_volt_sense() @@ -47,7 +71,7 @@ def splash_draw_battery(status=""): elif vUsb < 4000 and splash_power_countdown_get()<2: bat_status = "Zzz..." elif vBatt > 500: - bat_status = str(round(vBatt/1000, 2)) + 'v ('+str(splash_power_countdown_get())+')' + bat_status = str(round(vBatt/1000, 2)) + 'v' else: bat_status = 'No battery' @@ -66,7 +90,7 @@ def splash_draw_actions(): if otaAvailable: info2 = '[ SELECT: UPDATE ]' else: - info2 = '' + info2 = splash_rtc_string(True, True) l = ugfx.get_string_width(info1,"Roboto_Regular12") ugfx.string(296-l, 0, info1, "Roboto_Regular12",ugfx.BLACK) From bb6d57ab533497f8f25d86f78a21f4e1993b8288 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 29 Jul 2017 00:57:29 +0200 Subject: [PATCH 144/403] Fix service loop preventing sleep, add bpp option to launcher --- esp32/modules/bpp.py | 2 ++ esp32/modules/launcher.py | 2 ++ esp32/modules/splash.py | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 esp32/modules/bpp.py diff --git a/esp32/modules/bpp.py b/esp32/modules/bpp.py new file mode 100644 index 000000000..d0d11d43b --- /dev/null +++ b/esp32/modules/bpp.py @@ -0,0 +1,2 @@ +import appglue +appglue.start_bpp() diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 7078d5b1e..8e1377b12 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -14,6 +14,8 @@ def populate_it(): for app in apps: options.add_item(app) + + options.add_item('bpp') def run_it(pushed): if (pushed): diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 082d429e1..4b1ac7dc0 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -358,7 +358,8 @@ def splash_timer_init(): def splash_timer_callback(tmr): try: - services.loop(splash_power_countdown_get()) + if services.loop(splash_power_countdown_get()): + splash_power_countdown_reset() # A service is keeping the badge awake except: pass splash_draw() From d53693fab72455af4a5e42aeef712f3808857954 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Sat, 29 Jul 2017 01:07:39 +0200 Subject: [PATCH 145/403] version designator --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 9459aff13..0e6076605 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 2 -name = "Vlijtige Vlinder" +build = 3 +name = "Charmante Chirurg" From 036b58228c36ea971ec80ee4df875d858eacdfb3 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 29 Jul 2017 10:26:41 +0300 Subject: [PATCH 146/403] extmod/modframebuf: Use correct initialization for .locals_dict. --- extmod/modframebuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index 779214bb7..d3318899a 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -549,7 +549,7 @@ STATIC const mp_obj_type_t mp_type_framebuf = { .name = MP_QSTR_FrameBuffer, .make_new = framebuf_make_new, .buffer_p = { .get_buffer = framebuf_get_buffer }, - .locals_dict = (mp_obj_t)&framebuf_locals_dict, + .locals_dict = (mp_obj_dict_t*)&framebuf_locals_dict, }; // this factory function is provided for backwards compatibility with old FrameBuffer1 class From ebfde3b060b1a84404171a27ebf37541bd96e4d2 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 29 Jul 2017 11:44:53 +0200 Subject: [PATCH 147/403] Lots of fixes --- esp32/modules/splash.py | 72 +++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 4b1ac7dc0..d6d83547e 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -36,10 +36,7 @@ def splash_rtc_string(date=False, time=True): return output # Graphics -def splash_draw_battery(status=""): - vUsb = badge.usb_volt_sense() - vBatt = badge.battery_volt_sense() - vBatt += vDrop +def splash_draw_battery(vUsb, vBatt): if vBatt>500 and badge.battery_charge_status() and vUsb>4000: try: @@ -66,29 +63,24 @@ def splash_draw_battery(status=""): ugfx.box(42,7,2,8,ugfx.BLACK) ugfx.area(3,3,width,16,ugfx.BLACK) - if status!="": - bat_status = status - elif vUsb < 4000 and splash_power_countdown_get()<2: - bat_status = "Zzz..." - elif vBatt > 500: - bat_status = str(round(vBatt/1000, 2)) + 'v' - else: - bat_status = 'No battery' - - ugfx.string(47, 2, bat_status,'Roboto_Regular18',ugfx.BLACK) + bat_status = str(round(vBatt/1000, 2)) + 'v' + global splashPowerCountdown + bat_status = bat_status + ' ' + str(splashPowerCountdown) + ugfx.string(47, 0, bat_status,'Roboto_Regular12',ugfx.BLACK) def splash_draw_nickname(): global nick ugfx.string(0, 25, nick, "PermanentMarker36", ugfx.BLACK) -def splash_draw_actions(): +def splash_draw_actions(sleeping): global otaAvailable - if splash_power_countdown_get()<1: # Badge is going to sleep - info1 = '[ ANY: WAKE UP ]' + if sleeping: + info1 = 'Sleeping... Press any key to wake' + info2 = splash_rtc_string(True, True) else: - info1 = '[ START: LAUNCHER ]' + info1 = 'Press start to open the launcher' if otaAvailable: - info2 = '[ SELECT: UPDATE ]' + info2 = 'Press select to start OTA update' else: info2 = splash_rtc_string(True, True) @@ -97,7 +89,7 @@ def splash_draw_actions(): l = ugfx.get_string_width(info2,"Roboto_Regular12") ugfx.string(296-l, 12, info2, "Roboto_Regular12",ugfx.BLACK) -def splash_draw(full=False): +def splash_draw(full=False,sleeping=False): global splashDrawMsg if splashDrawMsg: splashDrawMsg = False @@ -105,6 +97,10 @@ def splash_draw(full=False): global splashDrawMsgLineNumber splashDrawMsgLineNumber = 0 + vUsb = badge.usb_volt_sense() + vBatt = badge.battery_volt_sense() + vBatt += vDrop + if splash_power_countdown_get()<1: full= True @@ -115,18 +111,15 @@ def splash_draw(full=False): ugfx.area(0,0,ugfx.width(),24,ugfx.WHITE) ugfx.area(0,ugfx.height()-64,ugfx.width(),64,ugfx.WHITE) - status = "" - if otaAvailable: - status = "Update available!" - splash_draw_battery(status) - splash_draw_actions() + splash_draw_battery(vUsb, vBatt) + splash_draw_actions(sleeping) services.draw() if full: ugfx.flush(ugfx.LUT_FULL) else: - ugfx.flush(ugfx.LUT_FASTEST) + ugfx.flush(ugfx.LUT_NORMAL) def splash_draw_msg(message, clear=False): @@ -245,7 +238,7 @@ def splash_ota_check(): return False def splash_ota_start(): - pass + appglue.start_ota() # About @@ -271,7 +264,7 @@ def splash_about_countdown_trigger(): def splash_power_countdown_reset(): global splashPowerCountdown - splashPowerCountdown = badge.nvs_get_u8('splash', 'timer.amount', 50) + splashPowerCountdown = badge.nvs_get_u8('splash', 'timer.amount', 30) def splash_power_countdown_get(): global splashPowerCountdown @@ -289,17 +282,18 @@ def splash_power_countdown_trigger(): splash_power_countdown_reset() splashPowerCountdown -= 1 - - if splashPowerCountdown<1: - if badge.usb_volt_sense() > 4500: - #print("[SPLASH] USB connected, not sleeping.") - splash_power_countdown_reset() + if badge.usb_volt_sense() > 4000: + splash_power_countdown_reset() + return False elif splashPowerCountdown<0: print("[SPLASH] Going to sleep...") + splash_draw(True,True) badge.eink_busy_wait() appglue.start_bpp() - #else: - # print("[SPLASH] Sleep in "+str(splashPowerCountdown)+"...") + return True + else: + print("[SPLASH] Sleep in "+str(splashPowerCountdown)+"...") + return False # Button input @@ -359,11 +353,11 @@ def splash_timer_init(): def splash_timer_callback(tmr): try: if services.loop(splash_power_countdown_get()): - splash_power_countdown_reset() # A service is keeping the badge awake + splash_power_countdown_reset() except: pass - splash_draw() - splash_power_countdown_trigger() + if not splash_power_countdown_trigger(): + splash_draw(False, False) tmr.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) @@ -427,4 +421,4 @@ def splash_timer_callback(tmr): gc.collect() # Draw homescreen -splash_draw(True) +splash_draw(True, False) From a8ee0246af07a2c6268fad0cd585df7c8a00965f Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 29 Jul 2017 14:26:40 +0200 Subject: [PATCH 148/403] Disabled old method of entering bpp. Deepsleep will be used instead. --- esp32/modules/bpp.py | 2 -- esp32/modules/launcher.py | 2 -- esp32/modules/splash.py | 9 ++++++--- 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 esp32/modules/bpp.py diff --git a/esp32/modules/bpp.py b/esp32/modules/bpp.py deleted file mode 100644 index d0d11d43b..000000000 --- a/esp32/modules/bpp.py +++ /dev/null @@ -1,2 +0,0 @@ -import appglue -appglue.start_bpp() diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 8e1377b12..d1cddd2f1 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -15,8 +15,6 @@ def populate_it(): for app in apps: options.add_item(app) - options.add_item('bpp') - def run_it(pushed): if (pushed): selected = options.selected_text() diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index d6d83547e..7a0884c36 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -75,8 +75,8 @@ def splash_draw_nickname(): def splash_draw_actions(sleeping): global otaAvailable if sleeping: - info1 = 'Sleeping... Press any key to wake' - info2 = splash_rtc_string(True, True) + info1 = 'Sleeping...' + info2 = 'Press any key to wake up' else: info1 = 'Press start to open the launcher' if otaAvailable: @@ -289,7 +289,10 @@ def splash_power_countdown_trigger(): print("[SPLASH] Going to sleep...") splash_draw(True,True) badge.eink_busy_wait() - appglue.start_bpp() + #now = time.time() + #wake_at = round(now + badge.nvs_get_u16('splash', 'sleep.duration', 120)*1000) + #appglue.start_bpp() + deepsleep.start_sleeping(badge.nvs_get_u16('splash', 'sleep.duration', 120)*1000) return True else: print("[SPLASH] Sleep in "+str(splashPowerCountdown)+"...") From 3f661ce62aaf9cc3f2e67da7f2c8ca3f02e9e992 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 29 Jul 2017 14:35:30 +0200 Subject: [PATCH 149/403] Hide voltage when sleeping --- esp32/modules/splash.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 7a0884c36..c4a51501b 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -62,11 +62,13 @@ def splash_draw_battery(vUsb, vBatt): ugfx.box(2,2,40,18,ugfx.BLACK) ugfx.box(42,7,2,8,ugfx.BLACK) ugfx.area(3,3,width,16,ugfx.BLACK) - - bat_status = str(round(vBatt/1000, 2)) + 'v' + global splashPowerCountdown - bat_status = bat_status + ' ' + str(splashPowerCountdown) - ugfx.string(47, 0, bat_status,'Roboto_Regular12',ugfx.BLACK) + + if splashPowerCountdown>0: + bat_status = str(round(vBatt/1000, 1)) + 'v' + bat_status = bat_status + ' ' + str(splashPowerCountdown) + ugfx.string(47, 0, bat_status,'Roboto_Regular12',ugfx.BLACK) def splash_draw_nickname(): global nick From f2140f94466f043677d58352bbecbdbe98e82d20 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 29 Jul 2017 18:09:33 +0300 Subject: [PATCH 150/403] extmod/mod{lwip,onewire,webrepl}: Convert to mp_rom_map_elem_t. --- extmod/modlwip.c | 82 ++++++++++++++++++++++----------------------- extmod/modonewire.c | 14 ++++---- extmod/modwebrepl.c | 20 +++++------ 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 01190d200..48b4190e9 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -5,7 +5,7 @@ * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Galen Hazelwood - * Copyright (c) 2015-2016 Paul Sokolovsky + * Copyright (c) 2015-2017 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -148,8 +148,8 @@ STATIC mp_obj_t lwip_slip_status(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(lwip_slip_status_obj, lwip_slip_status); -STATIC const mp_map_elem_t lwip_slip_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_status), (mp_obj_t)&lwip_slip_status_obj }, +STATIC const mp_rom_map_elem_t lwip_slip_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_status), MP_ROM_PTR(&lwip_slip_status_obj) }, }; STATIC MP_DEFINE_CONST_DICT(lwip_slip_locals_dict, lwip_slip_locals_dict_table); @@ -158,7 +158,7 @@ STATIC const mp_obj_type_t lwip_slip_type = { { &mp_type_type }, .name = MP_QSTR_slip, .make_new = lwip_slip_make_new, - .locals_dict = (mp_obj_t)&lwip_slip_locals_dict, + .locals_dict = (mp_obj_dict_t*)&lwip_slip_locals_dict, }; #endif // MICROPY_PY_LWIP_SLIP @@ -1160,27 +1160,27 @@ STATIC mp_uint_t lwip_socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_ return ret; } -STATIC const mp_map_elem_t lwip_socket_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___del__), (mp_obj_t)&lwip_socket_close_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&lwip_socket_close_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_bind), (mp_obj_t)&lwip_socket_bind_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_listen), (mp_obj_t)&lwip_socket_listen_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_accept), (mp_obj_t)&lwip_socket_accept_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_connect), (mp_obj_t)&lwip_socket_connect_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_send), (mp_obj_t)&lwip_socket_send_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_recv), (mp_obj_t)&lwip_socket_recv_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_sendto), (mp_obj_t)&lwip_socket_sendto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_recvfrom), (mp_obj_t)&lwip_socket_recvfrom_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_sendall), (mp_obj_t)&lwip_socket_sendall_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_settimeout), (mp_obj_t)&lwip_socket_settimeout_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_setblocking), (mp_obj_t)&lwip_socket_setblocking_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_setsockopt), (mp_obj_t)&lwip_socket_setsockopt_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_makefile), (mp_obj_t)&lwip_socket_makefile_obj }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&mp_stream_read_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), (mp_obj_t)&mp_stream_readinto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_readline), (mp_obj_t)&mp_stream_unbuffered_readline_obj}, - { MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj }, +STATIC const mp_rom_map_elem_t lwip_socket_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&lwip_socket_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&lwip_socket_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&lwip_socket_bind_obj) }, + { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&lwip_socket_listen_obj) }, + { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&lwip_socket_accept_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&lwip_socket_connect_obj) }, + { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&lwip_socket_send_obj) }, + { MP_ROM_QSTR(MP_QSTR_recv), MP_ROM_PTR(&lwip_socket_recv_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&lwip_socket_sendto_obj) }, + { MP_ROM_QSTR(MP_QSTR_recvfrom), MP_ROM_PTR(&lwip_socket_recvfrom_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendall), MP_ROM_PTR(&lwip_socket_sendall_obj) }, + { MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&lwip_socket_settimeout_obj) }, + { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&lwip_socket_setblocking_obj) }, + { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&lwip_socket_setsockopt_obj) }, + { MP_ROM_QSTR(MP_QSTR_makefile), MP_ROM_PTR(&lwip_socket_makefile_obj) }, + + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, }; STATIC MP_DEFINE_CONST_DICT(lwip_socket_locals_dict, lwip_socket_locals_dict_table); @@ -1196,7 +1196,7 @@ STATIC const mp_obj_type_t lwip_socket_type = { .print = lwip_socket_print, .make_new = lwip_socket_make_new, .protocol = &lwip_socket_stream_p, - .locals_dict = (mp_obj_t)&lwip_socket_locals_dict, + .locals_dict = (mp_obj_dict_t*)&lwip_socket_locals_dict, }; /******************************************************************************/ @@ -1321,27 +1321,27 @@ MP_DEFINE_CONST_FUN_OBJ_0(lwip_print_pcbs_obj, lwip_print_pcbs); #ifdef MICROPY_PY_LWIP -STATIC const mp_map_elem_t mp_module_lwip_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_lwip) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_reset), (mp_obj_t)&mod_lwip_reset_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_callback), (mp_obj_t)&mod_lwip_callback_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_getaddrinfo), (mp_obj_t)&lwip_getaddrinfo_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_print_pcbs), (mp_obj_t)&lwip_print_pcbs_obj }, +STATIC const mp_rom_map_elem_t mp_module_lwip_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_lwip) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&mod_lwip_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_callback), MP_ROM_PTR(&mod_lwip_callback_obj) }, + { MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&lwip_getaddrinfo_obj) }, + { MP_ROM_QSTR(MP_QSTR_print_pcbs), MP_ROM_PTR(&lwip_print_pcbs_obj) }, // objects - { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&lwip_socket_type }, + { MP_ROM_QSTR(MP_QSTR_socket), MP_ROM_PTR(&lwip_socket_type) }, #ifdef MICROPY_PY_LWIP_SLIP - { MP_OBJ_NEW_QSTR(MP_QSTR_slip), (mp_obj_t)&lwip_slip_type }, + { MP_ROM_QSTR(MP_QSTR_slip), MP_ROM_PTR(&lwip_slip_type) }, #endif // class constants - { MP_OBJ_NEW_QSTR(MP_QSTR_AF_INET), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AF_INET6), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET6) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET6) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOCK_STREAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOCK_DGRAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_DGRAM) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOCK_RAW), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_RAW) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_DGRAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_RAW) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOL_SOCKET), MP_OBJ_NEW_SMALL_INT(1) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SO_REUSEADDR), MP_OBJ_NEW_SMALL_INT(SOF_REUSEADDR) }, + { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_OBJ_NEW_SMALL_INT(1) }, + { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_OBJ_NEW_SMALL_INT(SOF_REUSEADDR) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_lwip_globals, mp_module_lwip_globals_table); diff --git a/extmod/modonewire.c b/extmod/modonewire.c index 8583cc1c2..53c9456c2 100644 --- a/extmod/modonewire.c +++ b/extmod/modonewire.c @@ -143,15 +143,15 @@ STATIC mp_obj_t onewire_crc8(mp_obj_t data) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(onewire_crc8_obj, onewire_crc8); -STATIC const mp_map_elem_t onewire_module_globals_table[] = { +STATIC const mp_rom_map_elem_t onewire_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_onewire) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR((mp_obj_t)&onewire_reset_obj) }, - { MP_ROM_QSTR(MP_QSTR_readbit), MP_ROM_PTR((mp_obj_t)&onewire_readbit_obj) }, - { MP_ROM_QSTR(MP_QSTR_readbyte), MP_ROM_PTR((mp_obj_t)&onewire_readbyte_obj) }, - { MP_ROM_QSTR(MP_QSTR_writebit), MP_ROM_PTR((mp_obj_t)&onewire_writebit_obj) }, - { MP_ROM_QSTR(MP_QSTR_writebyte), MP_ROM_PTR((mp_obj_t)&onewire_writebyte_obj) }, - { MP_ROM_QSTR(MP_QSTR_crc8), MP_ROM_PTR((mp_obj_t)&onewire_crc8_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&onewire_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_readbit), MP_ROM_PTR(&onewire_readbit_obj) }, + { MP_ROM_QSTR(MP_QSTR_readbyte), MP_ROM_PTR(&onewire_readbyte_obj) }, + { MP_ROM_QSTR(MP_QSTR_writebit), MP_ROM_PTR(&onewire_writebit_obj) }, + { MP_ROM_QSTR(MP_QSTR_writebyte), MP_ROM_PTR(&onewire_writebyte_obj) }, + { MP_ROM_QSTR(MP_QSTR_crc8), MP_ROM_PTR(&onewire_crc8_obj) }, }; STATIC MP_DEFINE_CONST_DICT(onewire_module_globals, onewire_module_globals_table); diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c index 9e3f16fe7..d618f5370 100644 --- a/extmod/modwebrepl.c +++ b/extmod/modwebrepl.c @@ -317,11 +317,11 @@ STATIC mp_obj_t webrepl_set_password(mp_obj_t passwd_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(webrepl_set_password_obj, webrepl_set_password); -STATIC const mp_map_elem_t webrepl_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&mp_stream_read_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), (mp_obj_t)&mp_stream_readinto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&webrepl_close_obj }, +STATIC const mp_rom_map_elem_t webrepl_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_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_close), MP_ROM_PTR(&webrepl_close_obj) }, }; STATIC MP_DEFINE_CONST_DICT(webrepl_locals_dict, webrepl_locals_dict_table); @@ -335,13 +335,13 @@ STATIC const mp_obj_type_t webrepl_type = { .name = MP_QSTR__webrepl, .make_new = webrepl_make_new, .protocol = &webrepl_stream_p, - .locals_dict = (mp_obj_t)&webrepl_locals_dict, + .locals_dict = (mp_obj_dict_t*)&webrepl_locals_dict, }; -STATIC const mp_map_elem_t webrepl_module_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR__webrepl) }, - { MP_OBJ_NEW_QSTR(MP_QSTR__webrepl), (mp_obj_t)&webrepl_type }, - { MP_OBJ_NEW_QSTR(MP_QSTR_password), (mp_obj_t)&webrepl_set_password_obj }, +STATIC const mp_rom_map_elem_t webrepl_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__webrepl) }, + { MP_ROM_QSTR(MP_QSTR__webrepl), MP_ROM_PTR(&webrepl_type) }, + { MP_ROM_QSTR(MP_QSTR_password), MP_ROM_PTR(&webrepl_set_password_obj) }, }; STATIC MP_DEFINE_CONST_DICT(webrepl_module_globals, webrepl_module_globals_table); From 0f9d4c5fb76f7d84120837785a924157737b5f36 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 29 Jul 2017 21:08:26 +0200 Subject: [PATCH 151/403] Added resource installer, bugfixes. --- esp32/modules/splash.py | 53 ++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index c4a51501b..88d8de80d 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -38,37 +38,32 @@ def splash_rtc_string(date=False, time=True): # Graphics def splash_draw_battery(vUsb, vBatt): - if vBatt>500 and badge.battery_charge_status() and vUsb>4000: + if badge.battery_charge_status() and vUsb>4000: try: - badge.eink_png(0,0,'/chrg.png') + badge.eink_png(0,0,'/lib/resources/chrg.png') except: ugfx.string(0, 0, "CHRG",'Roboto_Regular12',ugfx.BLACK) elif vUsb>4000: try: - badge.eink_png(0,0,'/usb.png') + badge.eink_png(0,0,'/lib/resources/usb.png') except: ugfx.string(0, 0, "USB",'Roboto_Regular12',ugfx.BLACK) - elif vBatt<500: - try: - badge.eink_png(0,0,'/nobatt.png') - except: - ugfx.string(0, 0, "NO BATT",'Roboto_Regular12',ugfx.BLACK) else: - width = round((vBatt-vMin) / (vMax-vMin) * 38) + width = round((vBatt-vMin) / (vMax-vMin) * 44) if width < 0: width = 0 elif width > 38: width = 38 - ugfx.box(2,2,40,18,ugfx.BLACK) - ugfx.box(42,7,2,8,ugfx.BLACK) + ugfx.box(2,2,46,18,ugfx.BLACK) + ugfx.box(48,7,2,8,ugfx.BLACK) ugfx.area(3,3,width,16,ugfx.BLACK) global splashPowerCountdown if splashPowerCountdown>0: - bat_status = str(round(vBatt/1000, 1)) + 'v' - bat_status = bat_status + ' ' + str(splashPowerCountdown) - ugfx.string(47, 0, bat_status,'Roboto_Regular12',ugfx.BLACK) + ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) + if splashPowerCountdown>0 and splashPowerCountdown=2: + needToInstall = False + except: + pass + if needToInstall: + print("[SPLASH] Resources need to be updated!") + splash_resources_install() + return True + return False + # About @@ -413,6 +435,9 @@ def splash_timer_callback(tmr): else: otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) +# Download resources to fatfs +splash_resources_check() + # Disable WiFi if active splash_wifi_disable() From dbc8c9dc874704bf974a7383b7969521be0143c8 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 29 Jul 2017 21:29:25 +0200 Subject: [PATCH 152/403] Resource package is now hidden. Small bugfixes. --- esp32/modules/launcher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index d1cddd2f1..9f371e4aa 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -13,7 +13,8 @@ def populate_it(): options.add_item('ota_update') for app in apps: - options.add_item(app) + if not app=="resources": + options.add_item(app) def run_it(pushed): if (pushed): From b0133c203264595c98fccb82fd2eba6a2ba1dd82 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sat, 29 Jul 2017 21:31:45 +0200 Subject: [PATCH 153/403] Hide vbatt when no battery is present --- esp32/modules/splash.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 88d8de80d..b3f15da87 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -61,7 +61,8 @@ def splash_draw_battery(vUsb, vBatt): global splashPowerCountdown if splashPowerCountdown>0: - ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) + if vBatt>500: + ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) if splashPowerCountdown>0 and splashPowerCountdown Date: Sun, 30 Jul 2017 10:03:14 +0300 Subject: [PATCH 154/403] unix/modjni: Convert to mp_rom_map_elem_t. --- unix/modjni.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/unix/modjni.c b/unix/modjni.c index 0aeb0601f..896f2f919 100644 --- a/unix/modjni.c +++ b/unix/modjni.c @@ -168,9 +168,9 @@ STATIC mp_obj_t jclass_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const return call_method(self->cls, NULL, methods, true, n_args, args); } -STATIC const mp_map_elem_t jclass_locals_dict_table[] = { -// { MP_OBJ_NEW_QSTR(MP_QSTR_get), (mp_obj_t)&ffivar_get_obj }, -// { MP_OBJ_NEW_QSTR(MP_QSTR_set), (mp_obj_t)&ffivar_set_obj }, +STATIC const mp_rom_map_elem_t jclass_locals_dict_table[] = { +// { MP_ROM_QSTR(MP_QSTR_get), MP_ROM_PTR(&ffivar_get_obj) }, +// { MP_ROM_QSTR(MP_QSTR_set), MP_ROM_PTR(&ffivar_set_obj) }, }; STATIC MP_DEFINE_CONST_DICT(jclass_locals_dict, jclass_locals_dict_table); @@ -181,7 +181,7 @@ STATIC const mp_obj_type_t jclass_type = { .print = jclass_print, .attr = jclass_attr, .call = jclass_call, - .locals_dict = (mp_obj_t)&jclass_locals_dict, + .locals_dict = (mp_obj_dict_t*)&jclass_locals_dict, }; STATIC mp_obj_t new_jclass(jclass jc) { @@ -331,7 +331,7 @@ STATIC const mp_obj_type_t jobject_type = { .attr = jobject_attr, .subscr = jobject_subscr, .getiter = subscr_getiter, -// .locals_dict = (mp_obj_t)&jobject_locals_dict, +// .locals_dict = (mp_obj_dict_t*)&jobject_locals_dict, }; STATIC mp_obj_t new_jobject(jobject jo) { @@ -578,7 +578,7 @@ STATIC const mp_obj_type_t jmethod_type = { .print = jmethod_print, .call = jmethod_call, // .attr = jobject_attr, -// .locals_dict = (mp_obj_t)&jobject_locals_dict, +// .locals_dict = (mp_obj_dict_t*)&jobject_locals_dict, }; #ifdef __ANDROID__ @@ -707,11 +707,11 @@ STATIC mp_obj_t mod_jni_env() { } MP_DEFINE_CONST_FUN_OBJ_0(mod_jni_env_obj, mod_jni_env); -STATIC const mp_map_elem_t mp_module_jni_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_jni) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_cls), (mp_obj_t)&mod_jni_cls_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_array), (mp_obj_t)&mod_jni_array_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_env), (mp_obj_t)&mod_jni_env_obj }, +STATIC const mp_rom_map_elem_t mp_module_jni_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_jni) }, + { MP_ROM_QSTR(MP_QSTR_cls), MP_ROM_PTR(&mod_jni_cls_obj) }, + { MP_ROM_QSTR(MP_QSTR_array), MP_ROM_PTR(&mod_jni_array_obj) }, + { MP_ROM_QSTR(MP_QSTR_env), MP_ROM_PTR(&mod_jni_env_obj) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_jni_globals, mp_module_jni_globals_table); From e3864b59070c012d913d41c6ecbbd443ace3f0bc Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 30 Jul 2017 12:35:57 +0300 Subject: [PATCH 155/403] esp8266/modesp: Remove unused constants: STA_MODE, etc. WiFi mode selection happens on the level of individual interfaces. --- esp8266/modesp.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/esp8266/modesp.c b/esp8266/modesp.c index 5eaae27d6..b85a05ccb 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -384,13 +384,6 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = { MP_OBJ_NEW_SMALL_INT(LIGHT_SLEEP_T) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_MODEM), MP_OBJ_NEW_SMALL_INT(MODEM_SLEEP_T) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_STA_MODE), - MP_OBJ_NEW_SMALL_INT(STATION_MODE)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_AP_MODE), - MP_OBJ_NEW_SMALL_INT(SOFTAP_MODE)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STA_AP_MODE), - MP_OBJ_NEW_SMALL_INT(STATIONAP_MODE)}, #endif }; From 50a99b8f80f2c295d1cfe714714411a32c8fc720 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 30 Jul 2017 13:05:11 +0200 Subject: [PATCH 156/403] Makefile improvements Use a PROJECT_PATH which points to the Firmware path (it can be overridden) Use default IDF_PATH which points to $(PROJECT_PATH)/esp-idf. --- esp32/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index 7e89bf08b..19fbf86b0 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -1,3 +1,13 @@ +ifndef PROJECT_PATH +PROJECT_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))/../..) +export PROJECT_PATH +endif + +ifndef IDF_PATH +IDF_PATH := $(PROJECT_PATH)/esp-idf +export IDF_PATH +endif + include ../py/mkenv.mk # qstr definitions (must come before including py.mk) @@ -23,13 +33,9 @@ FLASH_SIZE ?= 16MB CROSS_COMPILE ?= xtensa-esp32-elf- # paths to ESP IDF and its components -ifeq ($(IDF_PATH),) -$(error Please configure the ESPIDF variable) -endif ESPIDF = $(IDF_PATH) ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py -BADGE = $(IDF_PATH)/.. # verify the ESP IDF version ESPIDF_SUPHASH := 8b274cd5a5d193a82b49aef384c303b105eda700 @@ -656,7 +662,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O)) # Badge magic $(BUILD)/components/%.o: -BADGE_COMPONENTS_O = $(addprefix $(BADGE)/components/,\ +BADGE_COMPONENTS_O = $(addprefix $(PROJECT_PATH)/components/,\ badge/badge_base.o \ badge/badge_eink.o \ badge/badge_i2c.o \ From 0554433cc5a7d983a828a8a80902d5eb9d3ae5d3 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 30 Jul 2017 14:43:35 +0200 Subject: [PATCH 157/403] Add easydraw and easywifi --- esp32/modules/easydraw.py | 24 +++++++++++++++++++ esp32/modules/easywifi.py | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 esp32/modules/easydraw.py create mode 100644 esp32/modules/easywifi.py diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py new file mode 100644 index 000000000..6d19d2617 --- /dev/null +++ b/esp32/modules/easydraw.py @@ -0,0 +1,24 @@ +# File: easydraw.py +# Version: 1 +# Description: Wrapper that makes drawing things simple +# License: MIT +# Authors: Renze Nicolai + +import ugfx + +# Globals +msgLineNumber = 0 + +# Functions +def msg(message, clear=False): + global msgLineNumber + if clear: + ugfx.clear(ugfx.WHITE) + ugfx.string(0, 0, message, "PermanentMarker22", ugfx.BLACK) + ugfx.set_lut(ugfx.LUT_FASTER) + ugfx.flush() + msgLineNumber = 0 + else: + ugfx.string(0, 30 + (msgLineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) + ugfx.flush() + msgLineNumber += 1 diff --git a/esp32/modules/easywifi.py b/esp32/modules/easywifi.py new file mode 100644 index 000000000..9c5452a58 --- /dev/null +++ b/esp32/modules/easywifi.py @@ -0,0 +1,49 @@ +# File: easywifi.py +# Version: 1 +# Description: Wrapper that makes using wifi simple +# License: MIT +# Authors: Renze Nicolai + +import time, network, badge, easydraw + +state = False + +def status(): + global state + return state + +def force_enable(): + global state + state = False + enable() + +def enable(): + global state + if not state: + nw = network.WLAN(network.STA_IF) + if not nw.isconnected(): + nw.active(True) + ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') + password = badge.nvs_get_str('badge', 'wifi.password') + nw.connect(ssid, password) if password else nw.connect(ssid) + + easydraw.msg("Connecting to WiFi...", True) + easydraw.msg("SSID: "+ssid) + + timeout = badge.nvs_get_u8('badge', 'wifi.timeout', 40) + while not nw.isconnected(): + time.sleep(0.1) + timeout = timeout - 1 + if (timeout<1): + easydraw.msg("Timeout while connecting!") + disable() + return False + easydraw.msg("Connected!") + state = True + return True + +def disable(): + global state + state = False + nw = network.WLAN(network.STA_IF) + nw.active(False) From 37d77040b9f926a43f93449d548488ec71e2b8e4 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 30 Jul 2017 14:56:26 +0200 Subject: [PATCH 158/403] Add easyrtc.py and update splash.py to use the new API --- esp32/modules/easyrtc.py | 43 ++++++++++++ esp32/modules/splash.py | 142 ++++++--------------------------------- 2 files changed, 64 insertions(+), 121 deletions(-) create mode 100644 esp32/modules/easyrtc.py diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py new file mode 100644 index 000000000..67bb387c9 --- /dev/null +++ b/esp32/modules/easyrtc.py @@ -0,0 +1,43 @@ +# File: easyrtc.py +# Version: 1 +# Description: Wrapper that makes using the clock simple +# License: MIT +# Authors: Renze Nicolai + +import machine, time + +# Functions +def string(date=False, time=True): + [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() + monthstr = str(month) + if (month<10): + monthstr = "0"+monthstr + daystr = str(mday) + if (mday<10): + daystr = "0"+daystr + hourstr = str(hour) + if (hour<10): + hourstr = "0"+hourstr + minstr = str(min) + if (min<10): + minstr = "0"+minstr + output = "" + if date: + output += daystr+"-"+monthstr+"-"+str(year) + if time: + output += " " + if time: + output += hourstr+":"+minstr + return output + +def configure(): + import easywifi + import easydraw + import ntp + if not easywifi.status(): + if not easywifi.enable(): + return False + easydraw.msg("Configuring clock...", True) + ntp.set_NTP_time() + easydraw.msg("Done") + return True diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index b3f15da87..345577a7d 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,39 +1,16 @@ -import ugfx, time, ntp, badge, machine, deepsleep, network, esp, gc -import appglue, services - # File: splash.py -# Version: 3 +# Version: 4 # Description: Homescreen for SHA2017 badge # License: MIT # Authors: Renze Nicolai # Thomas Roos +import ugfx, time, ntp, badge, machine, deepsleep, network, esp, gc +import appglue, services -### FUNCTIONS +import easydraw, easywifi, easyrtc -# RTC -def splash_rtc_string(date=False, time=True): - [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() - monthstr = str(month) - if (month<10): - monthstr = "0"+monthstr - daystr = str(mday) - if (mday<10): - daystr = "0"+daystr - hourstr = str(hour) - if (hour<10): - hourstr = "0"+hourstr - minstr = str(min) - if (min<10): - minstr = "0"+minstr - output = "" - if date: - output += daystr+"-"+monthstr+"-"+str(year) - if time: - output += " " - if time: - output += hourstr+":"+minstr - return output +### FUNCTIONS # Graphics def splash_draw_battery(vUsb, vBatt): @@ -80,7 +57,7 @@ def splash_draw_actions(sleeping): if otaAvailable: info2 = 'Press select to start OTA update' else: - info2 = splash_rtc_string(True, True) + info2 = easyrtc.string(True, True) l = ugfx.get_string_width(info1,"Roboto_Regular12") ugfx.string(296-l, 0, info1, "Roboto_Regular12",ugfx.BLACK) @@ -118,111 +95,34 @@ def splash_draw(full=False,sleeping=False): ugfx.flush(ugfx.LUT_FULL) else: ugfx.flush(ugfx.LUT_NORMAL) - - -def splash_draw_msg(message, clear=False): - global splashDrawMsg - splashDrawMsg = True - global splashDrawMsgLineNumber - try: - splashDrawMsgLineNumber - except: - splashDrawMsgLineNumber = 0 - - if clear: - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, message, "PermanentMarker22", ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTER) - ugfx.flush() - splashDrawMsgLineNumber = 0 - else: - ugfx.string(0, 30 + (splashDrawMsgLineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) - ugfx.flush() - splashDrawMsgLineNumber += 1 -# WiFi -def splash_wifi_connect(): - global wifiStatus - try: - wifiStatus - except: - wifiStatus = False - - if not wifiStatus: - nw = network.WLAN(network.STA_IF) - if not nw.isconnected(): - nw.active(True) - ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') - password = badge.nvs_get_str('badge', 'wifi.password') - nw.connect(ssid, password) if password else nw.connect(ssid) - - splash_draw_msg("Connecting to WiFi...", True) - splash_draw_msg("("+ssid+")") - - timeout = badge.nvs_get_u8('splash', 'wifi.timeout', 40) - while not nw.isconnected(): - time.sleep(0.1) - timeout = timeout - 1 - if (timeout<1): - splash_draw_msg("Timeout while connecting!") - splash_wifi_disable() - return False - wifiStatus = True - return True - return False - -def splash_wifi_active(): - global wifiStatus - try: - wifiStatus - except: - wifiStatus = False - return wifiStatus - - -def splash_wifi_disable(): - global wifiStatus - wifiStatus = False - nw = network.WLAN(network.STA_IF) - nw.active(False) - -# NTP clock configuration -def splash_ntp(): - if not splash_wifi_active(): - if not splash_wifi_connect(): - return False - splash_draw_msg("Configuring clock...", True) - ntp.set_NTP_time() - splash_draw_msg("Done") - return True - # OTA update checking def splash_ota_download_info(): import urequests as requests - splash_draw_msg("Checking for updates...", True) + easydraw.msg("Checking for updates...", True) result = False try: data = requests.get("https://badge.sha2017.org/version") except: - splash_draw_msg("Error:") - splash_draw_msg("Could not download JSON!") + easydraw.msg("Error:") + easydraw.msg("Could not download JSON!") time.sleep(5) return False try: result = data.json() except: data.close() - splash_draw_msg("Error:") - splash_draw_msg("Could not decode JSON!") + easydraw.msg("Error:") + easydraw.msg("Could not decode JSON!") time.sleep(5) return False data.close() return result def splash_ota_check(): - if not splash_wifi_active(): - if not splash_wifi_connect(): + if not easywifi.status(): + if not easywifi.enable(): return False info = splash_ota_download_info() @@ -240,9 +140,9 @@ def splash_ota_start(): # Resources def splash_resources_install(): - splash_draw_msg("Installing resources...",True) - if not splash_wifi_active(): - if not splash_wifi_connect(): + easydraw.msg("Installing resources...",True) + if not easywifi.status(): + if not easywifi.enable(): return False import woezel woezel.install("resources") @@ -426,11 +326,11 @@ def splash_timer_callback(tmr): elif setupState == 2: # Third boot: force OTA check print("[SPLASH] Third boot...") badge.nvs_set_u8('badge', 'setup.state', 3) - otaCheck = splash_ntp() if time.time() < 1482192000 else True + otaCheck = easyrtc.configure() if time.time() < 1482192000 else True otaAvailable = splash_ota_check() else: # Normal boot print("[SPLASH] Normal boot...") - otaCheck = splash_ntp() if time.time() < 1482192000 else True + otaCheck = easyrtc.configure() if time.time() < 1482192000 else True if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and otaCheck: otaAvailable = splash_ota_check() else: @@ -438,12 +338,12 @@ def splash_timer_callback(tmr): # Download resources to fatfs splash_resources_check() - -# Disable WiFi if active -splash_wifi_disable() # Initialize services services.setup() + +# Disable WiFi if active +easywifi.disable() # Initialize timer splash_timer_init() From cc4b33371e1933d255b566292e6ac414b28a4b8e Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 30 Jul 2017 15:26:58 +0200 Subject: [PATCH 159/403] Center nickname, fix a bug --- esp32/modules/easydraw.py | 30 ++++++++++++++++++- esp32/modules/splash.py | 61 ++++++++++----------------------------- 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index 6d19d2617..371cb34c5 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -4,13 +4,16 @@ # License: MIT # Authors: Renze Nicolai -import ugfx +import ugfx, badge # Globals msgLineNumber = 0 +msgShown = False # Functions def msg(message, clear=False): + global msgShown + msgShown = True global msgLineNumber if clear: ugfx.clear(ugfx.WHITE) @@ -22,3 +25,28 @@ def msg(message, clear=False): ugfx.string(0, 30 + (msgLineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) ugfx.flush() msgLineNumber += 1 + +def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): + nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') + ugfx.string_box(0,y,296,38, nick, font, color, ugfx.justifyCenter) + +def battery(vUsb, vBatt, charging): + if charging and vUsb>4000: + try: + badge.eink_png(0,0,'/lib/resources/chrg.png') + except: + ugfx.string(0, 0, "CHRG",'Roboto_Regular12',ugfx.BLACK) + elif vUsb>4000: + try: + badge.eink_png(0,0,'/lib/resources/usb.png') + except: + ugfx.string(0, 0, "USB",'Roboto_Regular12',ugfx.BLACK) + else: + width = round((vBatt-vMin) / (vMax-vMin) * 44) + if width < 0: + width = 0 + elif width > 38: + width = 38 + ugfx.box(2,2,46,18,ugfx.BLACK) + ugfx.box(48,7,2,8,ugfx.BLACK) + ugfx.area(3,3,width,16,ugfx.BLACK) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 345577a7d..ac9400d7c 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -13,40 +13,6 @@ ### FUNCTIONS # Graphics -def splash_draw_battery(vUsb, vBatt): - - if badge.battery_charge_status() and vUsb>4000: - try: - badge.eink_png(0,0,'/lib/resources/chrg.png') - except: - ugfx.string(0, 0, "CHRG",'Roboto_Regular12',ugfx.BLACK) - elif vUsb>4000: - try: - badge.eink_png(0,0,'/lib/resources/usb.png') - except: - ugfx.string(0, 0, "USB",'Roboto_Regular12',ugfx.BLACK) - else: - width = round((vBatt-vMin) / (vMax-vMin) * 44) - if width < 0: - width = 0 - elif width > 38: - width = 38 - ugfx.box(2,2,46,18,ugfx.BLACK) - ugfx.box(48,7,2,8,ugfx.BLACK) - ugfx.area(3,3,width,16,ugfx.BLACK) - - global splashPowerCountdown - - if splashPowerCountdown>0: - if vBatt>500: - ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) - if splashPowerCountdown>0 and splashPowerCountdown0: + if vBatt>500: + ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) + if splashPowerCountdown>0 and splashPowerCountdown 4500 and badge.battery_volt_sense() > 2500: @@ -302,9 +276,6 @@ def splash_timer_callback(tmr): print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 1000) - 1000 # mV -# Set global variables -splashDrawMsg = False - # Initialize user input subsystem splash_input_init() From 1735a9708bb81324bde75d6e17aaa793d2b83cad Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 30 Jul 2017 17:04:22 +0200 Subject: [PATCH 160/403] Force new sponsors app to be shown --- esp32/modules/splash.py | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index ac9400d7c..f76fa1dd8 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -138,6 +138,40 @@ def splash_resources_check(): return True return False +# Sponsors + +def splash_sponsors_install(): + if not easywifi.status(): + if not easywifi.enable(): + return False + print("[SPLASH] Installing sponsors...") + easydraw.msg("Installing sponsors...",True) + import woezel + woezel.install("sponsors") + easydraw.msg("Done.") + +def splash_sponsors_show(): + needToInstall = True + version = 0 + try: + fp = open("/lib/sponsors/version", "r") + version = int(fp.read(99)) + print("[SPLASH] Current sponsors version: "+str(version)) + except: + print("[SPLASH] Sponsors not installed.") + if version>=14: + needToInstall = False + if needToInstall: + splash_sponsors_install() + try: + fp = open("/lib/sponsors/version", "r") + version = int(fp.read(99)) + # Now we know for sure that a version of the sponsors app has been installed + badge.nvs_set_u8('sponsors', 'shown', 1) + appglue.start_app("sponsors") + except: + pass + # About @@ -293,7 +327,7 @@ def splash_timer_callback(tmr): elif setupState == 1: # Second boot: Show sponsors print("[SPLASH] Second boot...") badge.nvs_set_u8('badge', 'setup.state', 2) - appglue.start_app("sponsors") + splash_sponsors_show() elif setupState == 2: # Third boot: force OTA check print("[SPLASH] Third boot...") badge.nvs_set_u8('badge', 'setup.state', 3) @@ -310,6 +344,10 @@ def splash_timer_callback(tmr): # Download resources to fatfs splash_resources_check() +# Show updated sponsors if not yet shown +if badge.nvs_get_u8('sponsors', 'shown', 0)<1: + splash_sponsors_show() + # Initialize services services.setup() From e6bb25317b7768ae3423f520e69dbb1f7109605c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 30 Jul 2017 18:13:01 +0300 Subject: [PATCH 161/403] esp8266: Convert to mp_rom_map_elem_t. --- esp8266/machine_adc.c | 6 ++-- esp8266/machine_pin.c | 32 ++++++++--------- esp8266/machine_rtc.c | 16 ++++----- esp8266/machine_wdt.c | 8 ++--- esp8266/modesp.c | 55 ++++++++++++++-------------- esp8266/modmachine.c | 14 ++++---- esp8266/modnetwork.c | 84 ++++++++++++++++++------------------------- 7 files changed, 98 insertions(+), 117 deletions(-) diff --git a/esp8266/machine_adc.c b/esp8266/machine_adc.c index f1fb5be31..73ec05208 100644 --- a/esp8266/machine_adc.c +++ b/esp8266/machine_adc.c @@ -70,8 +70,8 @@ STATIC mp_obj_t pyb_adc_read(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_adc_read_obj, pyb_adc_read); -STATIC const mp_map_elem_t pyb_adc_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&pyb_adc_read_obj } +STATIC const mp_rom_map_elem_t pyb_adc_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&pyb_adc_read_obj) } }; STATIC MP_DEFINE_CONST_DICT(pyb_adc_locals_dict, pyb_adc_locals_dict_table); @@ -79,5 +79,5 @@ const mp_obj_type_t pyb_adc_type = { { &mp_type_type }, .name = MP_QSTR_ADC, .make_new = pyb_adc_make_new, - .locals_dict = (mp_obj_t)&pyb_adc_locals_dict, + .locals_dict = (mp_obj_dict_t*)&pyb_adc_locals_dict, }; diff --git a/esp8266/machine_pin.c b/esp8266/machine_pin.c index febbc1587..6f75a0a6a 100644 --- a/esp8266/machine_pin.c +++ b/esp8266/machine_pin.c @@ -426,24 +426,24 @@ STATIC mp_uint_t pin_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, i return -1; } -STATIC const mp_map_elem_t pyb_pin_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t pyb_pin_locals_dict_table[] = { // instance methods - { MP_OBJ_NEW_QSTR(MP_QSTR_init), (mp_obj_t)&pyb_pin_init_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_value), (mp_obj_t)&pyb_pin_value_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_off), (mp_obj_t)&pyb_pin_off_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_on), (mp_obj_t)&pyb_pin_on_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_irq), (mp_obj_t)&pyb_pin_irq_obj }, + { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&pyb_pin_init_obj) }, + { MP_ROM_QSTR(MP_QSTR_value), MP_ROM_PTR(&pyb_pin_value_obj) }, + { MP_ROM_QSTR(MP_QSTR_off), MP_ROM_PTR(&pyb_pin_off_obj) }, + { MP_ROM_QSTR(MP_QSTR_on), MP_ROM_PTR(&pyb_pin_on_obj) }, + { MP_ROM_QSTR(MP_QSTR_irq), MP_ROM_PTR(&pyb_pin_irq_obj) }, // class constants - { MP_OBJ_NEW_QSTR(MP_QSTR_IN), MP_OBJ_NEW_SMALL_INT(GPIO_MODE_INPUT) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_OUT), MP_OBJ_NEW_SMALL_INT(GPIO_MODE_OUTPUT) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_OPEN_DRAIN), MP_OBJ_NEW_SMALL_INT(GPIO_MODE_OPEN_DRAIN) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_PULL_UP), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_UP) }, - //{ MP_OBJ_NEW_QSTR(MP_QSTR_PULL_DOWN), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_DOWN) }, - - // IRG triggers, can be or'd together - { MP_OBJ_NEW_QSTR(MP_QSTR_IRQ_RISING), MP_OBJ_NEW_SMALL_INT(GPIO_PIN_INTR_POSEDGE) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_IRQ_FALLING), MP_OBJ_NEW_SMALL_INT(GPIO_PIN_INTR_NEGEDGE) }, + { MP_ROM_QSTR(MP_QSTR_IN), MP_ROM_INT(GPIO_MODE_INPUT) }, + { MP_ROM_QSTR(MP_QSTR_OUT), MP_ROM_INT(GPIO_MODE_OUTPUT) }, + { MP_ROM_QSTR(MP_QSTR_OPEN_DRAIN), MP_ROM_INT(GPIO_MODE_OPEN_DRAIN) }, + { MP_ROM_QSTR(MP_QSTR_PULL_UP), MP_ROM_INT(GPIO_PULL_UP) }, + //{ MP_ROM_QSTR(MP_QSTR_PULL_DOWN), MP_ROM_INT(GPIO_PULL_DOWN) }, + + // IRQ triggers, can be or'd together + { MP_ROM_QSTR(MP_QSTR_IRQ_RISING), MP_ROM_INT(GPIO_PIN_INTR_POSEDGE) }, + { MP_ROM_QSTR(MP_QSTR_IRQ_FALLING), MP_ROM_INT(GPIO_PIN_INTR_NEGEDGE) }, }; STATIC MP_DEFINE_CONST_DICT(pyb_pin_locals_dict, pyb_pin_locals_dict_table); @@ -459,7 +459,7 @@ const mp_obj_type_t pyb_pin_type = { .make_new = mp_pin_make_new, .call = pyb_pin_call, .protocol = &pin_pin_p, - .locals_dict = (mp_obj_t)&pyb_pin_locals_dict, + .locals_dict = (mp_obj_dict_t*)&pyb_pin_locals_dict, }; /******************************************************************************/ diff --git a/esp8266/machine_rtc.c b/esp8266/machine_rtc.c index b92ce1d5a..984e8b6e8 100644 --- a/esp8266/machine_rtc.c +++ b/esp8266/machine_rtc.c @@ -255,13 +255,13 @@ STATIC mp_obj_t pyb_rtc_irq(size_t n_args, const mp_obj_t *pos_args, mp_map_t *k } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_rtc_irq_obj, 1, pyb_rtc_irq); -STATIC const mp_map_elem_t pyb_rtc_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_datetime), (mp_obj_t)&pyb_rtc_datetime_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_memory), (mp_obj_t)&pyb_rtc_memory_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_alarm), (mp_obj_t)&pyb_rtc_alarm_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_alarm_left), (mp_obj_t)&pyb_rtc_alarm_left_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_irq), (mp_obj_t)&pyb_rtc_irq_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ALARM0), MP_OBJ_NEW_SMALL_INT(0) }, +STATIC const mp_rom_map_elem_t pyb_rtc_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_datetime), MP_ROM_PTR(&pyb_rtc_datetime_obj) }, + { MP_ROM_QSTR(MP_QSTR_memory), MP_ROM_PTR(&pyb_rtc_memory_obj) }, + { MP_ROM_QSTR(MP_QSTR_alarm), MP_ROM_PTR(&pyb_rtc_alarm_obj) }, + { MP_ROM_QSTR(MP_QSTR_alarm_left), MP_ROM_PTR(&pyb_rtc_alarm_left_obj) }, + { MP_ROM_QSTR(MP_QSTR_irq), MP_ROM_PTR(&pyb_rtc_irq_obj) }, + { MP_ROM_QSTR(MP_QSTR_ALARM0), MP_ROM_INT(0) }, }; STATIC MP_DEFINE_CONST_DICT(pyb_rtc_locals_dict, pyb_rtc_locals_dict_table); @@ -269,5 +269,5 @@ const mp_obj_type_t pyb_rtc_type = { { &mp_type_type }, .name = MP_QSTR_RTC, .make_new = pyb_rtc_make_new, - .locals_dict = (mp_obj_t)&pyb_rtc_locals_dict, + .locals_dict = (mp_obj_dict_t*)&pyb_rtc_locals_dict, }; diff --git a/esp8266/machine_wdt.c b/esp8266/machine_wdt.c index 83b5e8f32..5e23ff782 100644 --- a/esp8266/machine_wdt.c +++ b/esp8266/machine_wdt.c @@ -71,9 +71,9 @@ STATIC mp_obj_t machine_wdt_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_wdt_deinit_obj, machine_wdt_deinit); -STATIC const mp_map_elem_t machine_wdt_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_feed), (mp_obj_t)&machine_wdt_feed_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&machine_wdt_deinit_obj }, +STATIC const mp_rom_map_elem_t machine_wdt_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&machine_wdt_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&machine_wdt_deinit_obj) }, }; STATIC MP_DEFINE_CONST_DICT(machine_wdt_locals_dict, machine_wdt_locals_dict_table); @@ -81,5 +81,5 @@ const mp_obj_type_t esp_wdt_type = { { &mp_type_type }, .name = MP_QSTR_WDT, .make_new = machine_wdt_make_new, - .locals_dict = (mp_obj_t)&machine_wdt_locals_dict, + .locals_dict = (mp_obj_dict_t*)&machine_wdt_locals_dict, }; diff --git a/esp8266/modesp.c b/esp8266/modesp.c index b85a05ccb..1aec1f90e 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -347,43 +347,40 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp_set_native_code_location_obj, esp_set_nativ #endif -STATIC const mp_map_elem_t esp_module_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_esp) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_osdebug), (mp_obj_t)&esp_osdebug_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_sleep_type), (mp_obj_t)&esp_sleep_type_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_deepsleep), (mp_obj_t)&esp_deepsleep_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_id), (mp_obj_t)&esp_flash_id_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_read), (mp_obj_t)&esp_flash_read_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_write), (mp_obj_t)&esp_flash_write_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_erase), (mp_obj_t)&esp_flash_erase_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_size), (mp_obj_t)&esp_flash_size_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_user_start), (mp_obj_t)&esp_flash_user_start_obj }, +STATIC const mp_rom_map_elem_t esp_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_esp) }, + + { MP_ROM_QSTR(MP_QSTR_osdebug), MP_ROM_PTR(&esp_osdebug_obj) }, + { MP_ROM_QSTR(MP_QSTR_sleep_type), MP_ROM_PTR(&esp_sleep_type_obj) }, + { MP_ROM_QSTR(MP_QSTR_deepsleep), MP_ROM_PTR(&esp_deepsleep_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_id), MP_ROM_PTR(&esp_flash_id_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_read), MP_ROM_PTR(&esp_flash_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_write), MP_ROM_PTR(&esp_flash_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_erase), MP_ROM_PTR(&esp_flash_erase_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_size), MP_ROM_PTR(&esp_flash_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_user_start), MP_ROM_PTR(&esp_flash_user_start_obj) }, #if MICROPY_ESP8266_NEOPIXEL - { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write), (mp_obj_t)&esp_neopixel_write_obj }, + { MP_ROM_QSTR(MP_QSTR_neopixel_write), MP_ROM_PTR(&esp_neopixel_write_obj) }, #endif #if MICROPY_ESP8266_APA102 - { MP_OBJ_NEW_QSTR(MP_QSTR_apa102_write), (mp_obj_t)&esp_apa102_write_obj }, + { MP_ROM_QSTR(MP_QSTR_apa102_write), MP_ROM_PTR(&esp_apa102_write_obj) }, #endif - { MP_OBJ_NEW_QSTR(MP_QSTR_dht_readinto), (mp_obj_t)&dht_readinto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_freemem), (mp_obj_t)&esp_freemem_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_meminfo), (mp_obj_t)&esp_meminfo_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_check_fw), (mp_obj_t)&esp_check_fw_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, // TODO delete/rename/move elsewhere - { MP_OBJ_NEW_QSTR(MP_QSTR_malloc), (mp_obj_t)&esp_malloc_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_free), (mp_obj_t)&esp_free_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_esf_free_bufs), (mp_obj_t)&esp_esf_free_bufs_obj }, + { MP_ROM_QSTR(MP_QSTR_dht_readinto), MP_ROM_PTR(&dht_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_freemem), MP_ROM_PTR(&esp_freemem_obj) }, + { MP_ROM_QSTR(MP_QSTR_meminfo), MP_ROM_PTR(&esp_meminfo_obj) }, + { MP_ROM_QSTR(MP_QSTR_check_fw), MP_ROM_PTR(&esp_check_fw_obj) }, + { MP_ROM_QSTR(MP_QSTR_info), MP_ROM_PTR(&pyb_info_obj) }, // TODO delete/rename/move elsewhere + { MP_ROM_QSTR(MP_QSTR_malloc), MP_ROM_PTR(&esp_malloc_obj) }, + { MP_ROM_QSTR(MP_QSTR_free), MP_ROM_PTR(&esp_free_obj) }, + { MP_ROM_QSTR(MP_QSTR_esf_free_bufs), MP_ROM_PTR(&esp_esf_free_bufs_obj) }, #if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA - { MP_OBJ_NEW_QSTR(MP_QSTR_set_native_code_location), (mp_obj_t)&esp_set_native_code_location_obj }, + { MP_ROM_QSTR(MP_QSTR_set_native_code_location), MP_ROM_PTR(&esp_set_native_code_location_obj) }, #endif #if MODESP_INCLUDE_CONSTANTS - { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_NONE), - MP_OBJ_NEW_SMALL_INT(NONE_SLEEP_T) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_LIGHT), - MP_OBJ_NEW_SMALL_INT(LIGHT_SLEEP_T) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_MODEM), - MP_OBJ_NEW_SMALL_INT(MODEM_SLEEP_T) }, + { MP_ROM_QSTR(MP_QSTR_SLEEP_NONE), MP_ROM_INT(NONE_SLEEP_T) }, + { MP_ROM_QSTR(MP_QSTR_SLEEP_LIGHT), MP_ROM_INT(LIGHT_SLEEP_T) }, + { MP_ROM_QSTR(MP_QSTR_SLEEP_MODEM), MP_ROM_INT(MODEM_SLEEP_T) }, #endif }; diff --git a/esp8266/modmachine.c b/esp8266/modmachine.c index c26c63396..070e6fc54 100644 --- a/esp8266/modmachine.c +++ b/esp8266/modmachine.c @@ -193,12 +193,12 @@ STATIC mp_obj_t esp_timer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_timer_deinit_obj, esp_timer_deinit); -STATIC const mp_map_elem_t esp_timer_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&esp_timer_deinit_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_init), (mp_obj_t)&esp_timer_init_obj }, -// { MP_OBJ_NEW_QSTR(MP_QSTR_callback), (mp_obj_t)&esp_timer_callback_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ONE_SHOT), MP_OBJ_NEW_SMALL_INT(false) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_PERIODIC), MP_OBJ_NEW_SMALL_INT(true) }, +STATIC const mp_rom_map_elem_t esp_timer_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&esp_timer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&esp_timer_init_obj) }, +// { MP_ROM_QSTR(MP_QSTR_callback), MP_ROM_PTR(&esp_timer_callback_obj) }, + { MP_ROM_QSTR(MP_QSTR_ONE_SHOT), MP_ROM_INT(false) }, + { MP_ROM_QSTR(MP_QSTR_PERIODIC), MP_ROM_INT(true) }, }; STATIC MP_DEFINE_CONST_DICT(esp_timer_locals_dict, esp_timer_locals_dict_table); @@ -207,7 +207,7 @@ const mp_obj_type_t esp_timer_type = { .name = MP_QSTR_Timer, .print = esp_timer_print, .make_new = esp_timer_make_new, - .locals_dict = (mp_obj_t)&esp_timer_locals_dict, + .locals_dict = (mp_obj_dict_t*)&esp_timer_locals_dict, }; // this bit is unused in the Xtensa PS register diff --git a/esp8266/modnetwork.c b/esp8266/modnetwork.c index eb9d75e28..a621522d0 100644 --- a/esp8266/modnetwork.c +++ b/esp8266/modnetwork.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Paul Sokolovsky + * Copyright (c) 2015-2016 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -427,15 +427,15 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(esp_config_obj, 1, esp_config); -STATIC const mp_map_elem_t wlan_if_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_active), (mp_obj_t)&esp_active_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_connect), (mp_obj_t)&esp_connect_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_disconnect), (mp_obj_t)&esp_disconnect_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_status), (mp_obj_t)&esp_status_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_scan), (mp_obj_t)&esp_scan_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_isconnected), (mp_obj_t)&esp_isconnected_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_config), (mp_obj_t)&esp_config_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ifconfig), (mp_obj_t)&esp_ifconfig_obj }, +STATIC const mp_rom_map_elem_t wlan_if_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_active), MP_ROM_PTR(&esp_active_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&esp_connect_obj) }, + { MP_ROM_QSTR(MP_QSTR_disconnect), MP_ROM_PTR(&esp_disconnect_obj) }, + { MP_ROM_QSTR(MP_QSTR_status), MP_ROM_PTR(&esp_status_obj) }, + { MP_ROM_QSTR(MP_QSTR_scan), MP_ROM_PTR(&esp_scan_obj) }, + { MP_ROM_QSTR(MP_QSTR_isconnected), MP_ROM_PTR(&esp_isconnected_obj) }, + { MP_ROM_QSTR(MP_QSTR_config), MP_ROM_PTR(&esp_config_obj) }, + { MP_ROM_QSTR(MP_QSTR_ifconfig), MP_ROM_PTR(&esp_ifconfig_obj) }, }; STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table); @@ -443,7 +443,7 @@ STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table); const mp_obj_type_t wlan_if_type = { { &mp_type_type }, .name = MP_QSTR_WLAN, - .locals_dict = (mp_obj_t)&wlan_if_locals_dict, + .locals_dict = (mp_obj_dict_t*)&wlan_if_locals_dict, }; STATIC mp_obj_t esp_phy_mode(mp_uint_t n_args, const mp_obj_t *args) { @@ -456,47 +456,31 @@ STATIC mp_obj_t esp_phy_mode(mp_uint_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp_phy_mode_obj, 0, 1, esp_phy_mode); -STATIC const mp_map_elem_t mp_module_network_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_network) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_WLAN), (mp_obj_t)&get_wlan_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_phy_mode), (mp_obj_t)&esp_phy_mode_obj }, +STATIC const mp_rom_map_elem_t mp_module_network_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_network) }, + { MP_ROM_QSTR(MP_QSTR_WLAN), MP_ROM_PTR(&get_wlan_obj) }, + { MP_ROM_QSTR(MP_QSTR_phy_mode), MP_ROM_PTR(&esp_phy_mode_obj) }, #if MODNETWORK_INCLUDE_CONSTANTS - { MP_OBJ_NEW_QSTR(MP_QSTR_STA_IF), - MP_OBJ_NEW_SMALL_INT(STATION_IF)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_AP_IF), - MP_OBJ_NEW_SMALL_INT(SOFTAP_IF)}, - - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_IDLE), - MP_OBJ_NEW_SMALL_INT(STATION_IDLE)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_CONNECTING), - MP_OBJ_NEW_SMALL_INT(STATION_CONNECTING)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_WRONG_PASSWORD), - MP_OBJ_NEW_SMALL_INT(STATION_WRONG_PASSWORD)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_NO_AP_FOUND), - MP_OBJ_NEW_SMALL_INT(STATION_NO_AP_FOUND)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_CONNECT_FAIL), - MP_OBJ_NEW_SMALL_INT(STATION_CONNECT_FAIL)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_GOT_IP), - MP_OBJ_NEW_SMALL_INT(STATION_GOT_IP)}, - - { MP_OBJ_NEW_QSTR(MP_QSTR_MODE_11B), - MP_OBJ_NEW_SMALL_INT(PHY_MODE_11B) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MODE_11G), - MP_OBJ_NEW_SMALL_INT(PHY_MODE_11G) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MODE_11N), - MP_OBJ_NEW_SMALL_INT(PHY_MODE_11N) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_OPEN), - MP_OBJ_NEW_SMALL_INT(AUTH_OPEN) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WEP), - MP_OBJ_NEW_SMALL_INT(AUTH_WEP) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WPA_PSK), - MP_OBJ_NEW_SMALL_INT(AUTH_WPA_PSK) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WPA2_PSK), - MP_OBJ_NEW_SMALL_INT(AUTH_WPA2_PSK) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WPA_WPA2_PSK), - MP_OBJ_NEW_SMALL_INT(AUTH_WPA_WPA2_PSK) }, + { MP_ROM_QSTR(MP_QSTR_STA_IF), MP_ROM_INT(STATION_IF)}, + { MP_ROM_QSTR(MP_QSTR_AP_IF), MP_ROM_INT(SOFTAP_IF)}, + + { MP_ROM_QSTR(MP_QSTR_STAT_IDLE), MP_ROM_INT(STATION_IDLE)}, + { MP_ROM_QSTR(MP_QSTR_STAT_CONNECTING), MP_ROM_INT(STATION_CONNECTING)}, + { MP_ROM_QSTR(MP_QSTR_STAT_WRONG_PASSWORD), MP_ROM_INT(STATION_WRONG_PASSWORD)}, + { MP_ROM_QSTR(MP_QSTR_STAT_NO_AP_FOUND), MP_ROM_INT(STATION_NO_AP_FOUND)}, + { MP_ROM_QSTR(MP_QSTR_STAT_CONNECT_FAIL), MP_ROM_INT(STATION_CONNECT_FAIL)}, + { MP_ROM_QSTR(MP_QSTR_STAT_GOT_IP), MP_ROM_INT(STATION_GOT_IP)}, + + { MP_ROM_QSTR(MP_QSTR_MODE_11B), MP_ROM_INT(PHY_MODE_11B) }, + { MP_ROM_QSTR(MP_QSTR_MODE_11G), MP_ROM_INT(PHY_MODE_11G) }, + { MP_ROM_QSTR(MP_QSTR_MODE_11N), MP_ROM_INT(PHY_MODE_11N) }, + + { MP_ROM_QSTR(MP_QSTR_AUTH_OPEN), MP_ROM_INT(AUTH_OPEN) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WEP), MP_ROM_INT(AUTH_WEP) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WPA_PSK), MP_ROM_INT(AUTH_WPA_PSK) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WPA2_PSK), MP_ROM_INT(AUTH_WPA2_PSK) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WPA_WPA2_PSK), MP_ROM_INT(AUTH_WPA_WPA2_PSK) }, #endif }; From 652dc0a54c6fff078a33cbc2f10e9f779b6f1735 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 30 Jul 2017 17:31:20 +0200 Subject: [PATCH 162/403] Fix a big bug and a little bit of cleaning --- esp32/modules/easydraw.py | 2 ++ esp32/modules/launcher.py | 14 +++++++------- esp32/modules/setup.py | 27 ++++++++++++++++++--------- esp32/modules/splash.py | 2 -- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index 371cb34c5..f1572c67e 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -31,6 +31,8 @@ def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): ugfx.string_box(0,y,296,38, nick, font, color, ugfx.justifyCenter) def battery(vUsb, vBatt, charging): + vMin = badge.nvs_get_u16('batt', 'vmin', 3700) # mV + vMax = badge.nvs_get_u16('batt', 'vmax', 4200) # mV if charging and vUsb>4000: try: badge.eink_png(0,0,'/lib/resources/chrg.png') diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 9f371e4aa..a6955683f 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,4 +1,4 @@ -import ugfx, badge, sys, uos as os, appglue, version +import ugfx, badge, sys, uos as os, appglue, version, easydraw def populate_it(): global options @@ -15,6 +15,8 @@ def populate_it(): for app in apps: if not app=="resources": options.add_item(app) + + options.add_item('setup') def run_it(pushed): if (pushed): @@ -51,10 +53,8 @@ def uninstall_it(pushed): def perform_uninstall(ok): if ok: - ugfx.clear(ugfx.BLACK) - ugfx.string_box(0, 25, 296, 25,"Uninstalling:","Roboto_BlackItalic24",ugfx.WHITE, ugfx.justifyCenter) - ugfx.string_box(0, 51, 296, 23, selected, "PermanentMarker22", ugfx.WHITE, ugfx.justifyCenter) - ugfx.flush() + easydraw.msg("Uninstalling:",True) + easydraw.msg(selected) install_path = get_install_path() for rm_file in os.listdir("%s/%s" % (install_path, selected)): os.remove("%s/%s/%s" % (install_path, selected, rm_file)) @@ -107,7 +107,7 @@ def perform_uninstall(ok): ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) -ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.start_app("") if pushed else 0) -ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app("") if pushed else 0) +ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.home() if pushed else 0) +#ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.home() if pushed else 0) ugfx.flush(ugfx.LUT_FULL) diff --git a/esp32/modules/setup.py b/esp32/modules/setup.py index ce1459787..be66ca6df 100644 --- a/esp32/modules/setup.py +++ b/esp32/modules/setup.py @@ -1,8 +1,11 @@ -# SETUP APPLICATION -# v2 by Thomas Roos -# v1 by Renze Nicolai +# File: setup.py +# Version: 3 +# Description: Setup for SHA2017 badge +# License: MIT +# Authors: Renze Nicolai +# Thomas Roos -import ugfx, badge, appglue, dialogs +import ugfx, badge, appglue, dialogs, easydraw, time def asked_nickname(value): if value: @@ -13,16 +16,22 @@ def asked_nickname(value): badge.nvs_set_u8('badge', 'setup.state', newState) # Show the user that we are done - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, "Hi, " + value, "PermanentMarker22", ugfx.BLACK) - ugfx.string(0, 25, "Your nick is stored to flash!", "Roboto_Regular12", ugfx.BLACK) - ugfx.flush(ugfx.LUT_FASTER) + easydraw.msg("Hi "+value+"!",True) + easydraw.msg("Your nick has been stored to flash!") + time.sleep(0.5) else: badge.nvs_set_u8('badge', 'setup.state', 2) # Skip the sponsors + badge.nvs_set_u8('sponsors', 'shown', 1) + easydraw.msg("Hi developer!",True) + time.sleep(0.5) badge.eink_busy_wait() - appglue.start_app("") + appglue.home() ugfx.init() nickname = badge.nvs_get_str("owner", "name", "") + +easydraw.msg("Welcome to SHA2017!",True) +time.sleep(1) + dialogs.prompt_text("Nickname", nickname, cb=asked_nickname) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index f76fa1dd8..c2bb1970f 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -300,8 +300,6 @@ def splash_timer_callback(tmr): ### PROGRAM # Load settings from NVS -vMin = badge.nvs_get_u16('splash', 'bat.volt.min', 3700) # mV -vMax = badge.nvs_get_u16('splash', 'bat.volt.max', 4200) # mV otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) # Calibrate battery voltage drop From e79d50ba8822e0b2213163b1f6da805047b2621a Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Sun, 30 Jul 2017 19:45:55 +0200 Subject: [PATCH 163/403] Fix msg function as per roosteds request --- esp32/modules/easydraw.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index f1572c67e..cd97fddc6 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -18,12 +18,10 @@ def msg(message, clear=False): if clear: ugfx.clear(ugfx.WHITE) ugfx.string(0, 0, message, "PermanentMarker22", ugfx.BLACK) - ugfx.set_lut(ugfx.LUT_FASTER) - ugfx.flush() msgLineNumber = 0 else: ugfx.string(0, 30 + (msgLineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) - ugfx.flush() + ugfx.flush(ugfx.LUT_FASTER) msgLineNumber += 1 def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): From 01ca7d30373ebe0ded6f281c57e42e49953aead4 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 30 Jul 2017 20:05:06 +0200 Subject: [PATCH 164/403] initialize with default eink type. (as configured in make menuconfig) --- esp32/modbadge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index dd19b00c7..bfa9e519c 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -206,7 +206,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); // EINK STATIC mp_obj_t badge_eink_init_() { - badge_eink_init(); + badge_eink_init(BADGE_EINK_DEFAULT); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_init_obj, badge_eink_init_); From 2d9a070cc58c52ea70cc99fb80964c2cac868f11 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 30 Jul 2017 23:40:22 +0200 Subject: [PATCH 165/403] add badge.GREYSCALE const. It's not a LUT, so I didn't use the LUT_ prefix. I've used 0xff. My idea is to add greyscale with less layers. (0xf1 = one layer, 0xf2 = two layers, 0xf3 = three layers, ...) Btw.. Should we use american english or british english for these constants? Or both? --- esp32/modugfx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/esp32/modugfx.c b/esp32/modugfx.c index 171eb003f..cf8a417ff 100644 --- a/esp32/modugfx.c +++ b/esp32/modugfx.c @@ -1102,12 +1102,14 @@ STATIC const mp_rom_map_elem_t ugfx_module_globals_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_FULL), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_FULL)}, {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_NORMAL), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_NORMAL)}, {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_FASTER), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_FASTER)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_FASTEST), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_FASTEST)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_DEFAULT), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_DEFAULT)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_MAX), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_MAX)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_FASTEST), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_FASTEST)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_DEFAULT), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_DEFAULT)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LUT_MAX), MP_OBJ_NEW_SMALL_INT(BADGE_EINK_LUT_MAX)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_set_lut), (mp_obj_t)&ugfx_set_lut_obj}, - {MP_OBJ_NEW_QSTR(MP_QSTR_get_lut), (mp_obj_t)&ugfx_get_lut_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_GREYSCALE), MP_OBJ_NEW_SMALL_INT(0xff)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_set_lut), (mp_obj_t)&ugfx_set_lut_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_get_lut), (mp_obj_t)&ugfx_get_lut_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_clear), (mp_obj_t)&ugfx_clear_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_flush), (mp_obj_t)&ugfx_flush_obj}, From 7dd9d9af26c15eca871107ca91dc91dcd3f81ccb Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 30 Jul 2017 23:58:54 +0200 Subject: [PATCH 166/403] Add more badge_power hooks. Added: - badge.power_leds_enable() - badge.power_leds_disable() - badge.power_sdcard_enable() - badge.power_sdcard_disable() Also did some reordering to group all power actions. And did some whitespace cleanup. --- esp32/modbadge.c | 63 ++++++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index bfa9e519c..71bb9a53d 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -286,7 +286,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_eink_png_obj, badge_eink_png); /* END OF PNG READER TEST */ -// Power + +// Power (badge_power.h) STATIC mp_obj_t badge_power_init_() { badge_power_init(); @@ -294,27 +295,43 @@ STATIC mp_obj_t badge_power_init_() { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_power_init_obj, badge_power_init_); -#if defined(PORTEXP_PIN_NUM_CHRGSTAT) || defined(MPR121_PIN_NUM_CHRGSTAT) STATIC mp_obj_t battery_charge_status_() { return mp_obj_new_bool(badge_battery_charge_status()); } -STATIC MP_DEFINE_CONST_FUN_OBJ_0(battery_charge_status_obj, - battery_charge_status_); -#endif +STATIC MP_DEFINE_CONST_FUN_OBJ_0(battery_charge_status_obj, battery_charge_status_); -#ifdef ADC1_CHAN_VBAT_SENSE STATIC mp_obj_t battery_volt_sense_() { return mp_obj_new_int(badge_battery_volt_sense()); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(battery_volt_sense_obj, battery_volt_sense_); -#endif -#ifdef ADC1_CHAN_VUSB_SENSE STATIC mp_obj_t usb_volt_sense_() { return mp_obj_new_int(badge_usb_volt_sense()); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(usb_volt_sense_obj, usb_volt_sense_); -#endif + + +STATIC mp_obj_t badge_power_leds_enable_() { + return mp_obj_new_int(badge_power_leds_enable()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_power_leds_enable_obj, badge_power_leds_enable_); + +STATIC mp_obj_t badge_power_leds_disable_() { + return mp_obj_new_int(badge_power_leds_disable()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_power_leds_disable_obj, badge_power_leds_disable_); + + +STATIC mp_obj_t badge_power_sdcard_enable_() { + return mp_obj_new_int(badge_power_sdcard_enable()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_power_sdcard_enable_obj, badge_power_sdcard_enable_); + +STATIC mp_obj_t badge_power_sdcard_disable_() { + return mp_obj_new_int(badge_power_sdcard_disable()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_power_sdcard_disable_obj, badge_power_sdcard_disable_); + // LEDs @@ -325,6 +342,7 @@ STATIC mp_obj_t badge_leds_init_() { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_leds_init_obj, badge_leds_init_); + STATIC mp_obj_t badge_leds_enable_() { return mp_obj_new_int(badge_leds_enable()); } @@ -335,6 +353,7 @@ STATIC mp_obj_t badge_leds_disable_() { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_leds_disable_obj, badge_leds_disable_); + STATIC mp_obj_t badge_leds_send_data_(mp_uint_t n_args, const mp_obj_t *args) { mp_uint_t len = mp_obj_get_int(args[1]); uint8_t *leds = (uint8_t *)mp_obj_str_get_data(args[0], &len); @@ -364,8 +383,18 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&badge_init_obj)}, {MP_ROM_QSTR(MP_QSTR_eink_init), MP_ROM_PTR(&badge_eink_init_obj)}, + + // Power {MP_OBJ_NEW_QSTR(MP_QSTR_power_init), (mp_obj_t)&badge_power_init_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_battery_charge_status), (mp_obj_t)&battery_charge_status_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_battery_volt_sense), (mp_obj_t)&battery_volt_sense_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_usb_volt_sense), (mp_obj_t)&usb_volt_sense_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_power_leds_enable), (mp_obj_t)&badge_power_leds_enable_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_power_leds_disable), (mp_obj_t)&badge_power_leds_disable_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_power_sdcard_enable), (mp_obj_t)&badge_power_sdcard_enable_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_power_sdcard_disable), (mp_obj_t)&badge_power_sdcard_disable_obj}, + // NVS {MP_ROM_QSTR(MP_QSTR_nvs_erase_all), MP_ROM_PTR(&badge_nvs_erase_all_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_erase_key), MP_ROM_PTR(&badge_nvs_erase_key_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_get_str), MP_ROM_PTR(&badge_nvs_get_str_obj)}, @@ -375,8 +404,8 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_nvs_get_u16), MP_ROM_PTR(&badge_nvs_get_u16_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_set_u16), MP_ROM_PTR(&badge_nvs_set_u16_obj)}, - #if defined(PIN_NUM_LED) || defined(MPR121_PIN_NUM_LEDS) + // LEDs {MP_OBJ_NEW_QSTR(MP_QSTR_leds_init), (mp_obj_t)&badge_leds_init_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_leds_enable), (mp_obj_t)&badge_leds_enable_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_leds_disable), (mp_obj_t)&badge_leds_disable_obj}, @@ -394,21 +423,9 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_eink_png), MP_ROM_PTR(&badge_eink_png_obj)}, /* - {MP_ROM_QSTR(MP_QSTR_display_picture), - MP_ROM_PTR(&badge_display_picture_obj)}, + {MP_ROM_QSTR(MP_QSTR_display_picture), MP_ROM_PTR(&badge_display_picture_obj)}, */ -#if defined(PORTEXP_PIN_NUM_CHRGSTAT) || defined(MPR121_PIN_NUM_CHRGSTAT) - {MP_OBJ_NEW_QSTR(MP_QSTR_battery_charge_status), - (mp_obj_t)&battery_charge_status_obj}, -#endif -#ifdef ADC1_CHAN_VBAT_SENSE - {MP_OBJ_NEW_QSTR(MP_QSTR_battery_volt_sense), - (mp_obj_t)&battery_volt_sense_obj}, -#endif -#ifdef ADC1_CHAN_VUSB_SENSE - {MP_OBJ_NEW_QSTR(MP_QSTR_usb_volt_sense), (mp_obj_t)&usb_volt_sense_obj}, -#endif }; STATIC MP_DEFINE_CONST_DICT(badge_module_globals, badge_module_globals_table); From 135b9401cd48eb99e7dc677f007dbc8602a7b18c Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Mon, 31 Jul 2017 00:51:20 +0200 Subject: [PATCH 167/403] Untested nicer msg --- esp32/modules/easydraw.py | 30 +++++++++-------- esp32/modules/splash.py | 70 ++++++++++++++++++--------------------- 2 files changed, 48 insertions(+), 52 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index cd97fddc6..f3fa1d9bc 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -6,28 +6,30 @@ import ugfx, badge -# Globals -msgLineNumber = 0 -msgShown = False - # Functions -def msg(message, clear=False): - global msgShown - msgShown = True - global msgLineNumber - if clear: +def msg(message, title = 'Still Loading Anyway...', reset = False): + """Show a terminal style loading screen with title + + title can be optionaly set when resetting or first call + """ + global lineNumber + if reset: + del lineNumber + try: + lineNumber + except: ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, message, "PermanentMarker22", ugfx.BLACK) - msgLineNumber = 0 + ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) + lineNumber = 0 else: - ugfx.string(0, 30 + (msgLineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) + ugfx.string(0, 30 + (lineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) ugfx.flush(ugfx.LUT_FASTER) - msgLineNumber += 1 + lineNumber += 1 def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') ugfx.string_box(0,y,296,38, nick, font, color, ugfx.justifyCenter) - + def battery(vUsb, vBatt, charging): vMin = badge.nvs_get_u16('batt', 'vmin', 3700) # mV vMax = badge.nvs_get_u16('batt', 'vmax', 4200) # mV diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index c2bb1970f..eeab4d11a 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -30,41 +30,37 @@ def splash_draw_actions(sleeping): l = ugfx.get_string_width(info2,"Roboto_Regular12") ugfx.string(296-l, 12, info2, "Roboto_Regular12",ugfx.BLACK) -def splash_draw(full=False,sleeping=False): - if easydraw.msgShown: - easydraw.msgShown = False - easydraw.msgLineNumber = 0 - full = True - +def splash_draw(full=False,sleeping=False): + vUsb = badge.usb_volt_sense() vBatt = badge.battery_volt_sense() vBatt += vDrop charging = badge.battery_charge_status() - + if splash_power_countdown_get()<1: full= True - + if full: ugfx.clear(ugfx.WHITE) easydraw.nickname() else: ugfx.area(0,0,ugfx.width(),24,ugfx.WHITE) ugfx.area(0,ugfx.height()-64,ugfx.width(),64,ugfx.WHITE) - - easydraw.battery(vUsb, vBatt, charging) - + + easydraw.battery(vUsb, vBatt, charging) + global splashPowerCountdown - + if splashPowerCountdown>0: if vBatt>500: ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) if splashPowerCountdown>0 and splashPowerCountdown=14: - needToInstall = False + needToInstall = False if needToInstall: splash_sponsors_install() try: @@ -171,14 +165,14 @@ def splash_sponsors_show(): appglue.start_app("sponsors") except: pass - + # About def splash_about_countdown_reset(): global splashAboutCountdown splashAboutCountdown = badge.nvs_get_u8('splash', 'about.amount', 10) - + def splash_about_countdown_trigger(): global splashAboutCountdown try: @@ -191,7 +185,7 @@ def splash_about_countdown_trigger(): appglue.start_app('magic', False) else: print("[SPLASH] Magic in "+str(splashAboutCountdown)+"...") - + # Power management @@ -206,14 +200,14 @@ def splash_power_countdown_get(): except: splash_power_countdown_reset() return splashPowerCountdown - + def splash_power_countdown_trigger(): global splashPowerCountdown try: splashPowerCountdown except: splash_power_countdown_reset() - + splashPowerCountdown -= 1 if badge.usb_volt_sense() > 4000: splash_power_countdown_reset() @@ -253,7 +247,7 @@ def splash_input_select(pressed): if otaAvailable: splash_ota_start() splash_power_countdown_reset() - + #def splash_input_left(pressed): # if pressed: # appglue.start_bpp() @@ -285,7 +279,7 @@ def splash_timer_init(): splashTimer = machine.Timer(-1) splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) print("[SPLASH] Timer created") - + def splash_timer_callback(tmr): try: if services.loop(splash_power_countdown_get()): @@ -295,8 +289,8 @@ def splash_timer_callback(tmr): if not splash_power_countdown_trigger(): splash_draw(False, False) tmr.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) - - + + ### PROGRAM # Load settings from NVS @@ -316,7 +310,7 @@ def splash_timer_callback(tmr): # Initialize about subsystem splash_about_countdown_reset() - + # Setup / Sponsors / OTA check / NTP clock sync setupState = badge.nvs_get_u8('badge', 'setup.state', 0) if setupState == 0: #First boot @@ -338,7 +332,7 @@ def splash_timer_callback(tmr): otaAvailable = splash_ota_check() else: otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) - + # Download resources to fatfs splash_resources_check() @@ -348,7 +342,7 @@ def splash_timer_callback(tmr): # Initialize services services.setup() - + # Disable WiFi if active easywifi.disable() From 358513b7f3a8f136cab2a34e525febe4f8e10f01 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Mon, 31 Jul 2017 01:31:44 +0200 Subject: [PATCH 168/403] change other modules using msq --- esp32/modules/easywifi.py | 7 +------ esp32/modules/setup.py | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/esp32/modules/easywifi.py b/esp32/modules/easywifi.py index 9c5452a58..dcf99cc61 100644 --- a/esp32/modules/easywifi.py +++ b/esp32/modules/easywifi.py @@ -18,7 +18,7 @@ def force_enable(): enable() def enable(): - global state + global state if not state: nw = network.WLAN(network.STA_IF) if not nw.isconnected(): @@ -27,18 +27,13 @@ def enable(): password = badge.nvs_get_str('badge', 'wifi.password') nw.connect(ssid, password) if password else nw.connect(ssid) - easydraw.msg("Connecting to WiFi...", True) - easydraw.msg("SSID: "+ssid) - timeout = badge.nvs_get_u8('badge', 'wifi.timeout', 40) while not nw.isconnected(): time.sleep(0.1) timeout = timeout - 1 if (timeout<1): - easydraw.msg("Timeout while connecting!") disable() return False - easydraw.msg("Connected!") state = True return True diff --git a/esp32/modules/setup.py b/esp32/modules/setup.py index be66ca6df..f0e86c740 100644 --- a/esp32/modules/setup.py +++ b/esp32/modules/setup.py @@ -16,14 +16,11 @@ def asked_nickname(value): badge.nvs_set_u8('badge', 'setup.state', newState) # Show the user that we are done - easydraw.msg("Hi "+value+"!",True) - easydraw.msg("Your nick has been stored to flash!") + easydraw.msg("Hi "+value+"!", 'Your nick has been stored to flash!') time.sleep(0.5) else: badge.nvs_set_u8('badge', 'setup.state', 2) # Skip the sponsors badge.nvs_set_u8('sponsors', 'shown', 1) - easydraw.msg("Hi developer!",True) - time.sleep(0.5) badge.eink_busy_wait() appglue.home() @@ -31,7 +28,4 @@ def asked_nickname(value): ugfx.init() nickname = badge.nvs_get_str("owner", "name", "") -easydraw.msg("Welcome to SHA2017!",True) -time.sleep(1) - dialogs.prompt_text("Nickname", nickname, cb=asked_nickname) From b62bb53d0efd027f9b3f6b757870fd584b213d98 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 31 Jul 2017 12:59:39 +1000 Subject: [PATCH 169/403] py/modsys: Use MP_ROM_INT for int values in an mp_rom_map_elem_t. --- py/modsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/modsys.c b/py/modsys.c index b8c427ba8..0a8f3cd50 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -168,7 +168,7 @@ 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_OBJ_NEW_SMALL_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) }, #endif From bbced3b4bbc8fd7ed7843d39143b6c600adc2c60 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 31 Jul 2017 13:00:34 +1000 Subject: [PATCH 170/403] extmod: Use MP_ROM_INT for int values in an mp_rom_map_elem_t. --- extmod/modframebuf.c | 12 ++++++------ extmod/modlwip.c | 14 +++++++------- extmod/moduselect.c | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index d3318899a..f4e857129 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -578,12 +578,12 @@ STATIC const mp_rom_map_elem_t framebuf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_framebuf) }, { MP_ROM_QSTR(MP_QSTR_FrameBuffer), MP_ROM_PTR(&mp_type_framebuf) }, { MP_ROM_QSTR(MP_QSTR_FrameBuffer1), MP_ROM_PTR(&legacy_framebuffer1_obj) }, - { MP_ROM_QSTR(MP_QSTR_MVLSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MVLSB) }, - { MP_ROM_QSTR(MP_QSTR_MONO_VLSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MVLSB) }, - { MP_ROM_QSTR(MP_QSTR_RGB565), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_RGB565) }, - { MP_ROM_QSTR(MP_QSTR_GS4_HMSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_GS4_HMSB) }, - { MP_ROM_QSTR(MP_QSTR_MONO_HLSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MHLSB) }, - { MP_ROM_QSTR(MP_QSTR_MONO_HMSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MHMSB) }, + { MP_ROM_QSTR(MP_QSTR_MVLSB), MP_ROM_INT(FRAMEBUF_MVLSB) }, + { MP_ROM_QSTR(MP_QSTR_MONO_VLSB), MP_ROM_INT(FRAMEBUF_MVLSB) }, + { MP_ROM_QSTR(MP_QSTR_RGB565), MP_ROM_INT(FRAMEBUF_RGB565) }, + { MP_ROM_QSTR(MP_QSTR_GS4_HMSB), MP_ROM_INT(FRAMEBUF_GS4_HMSB) }, + { MP_ROM_QSTR(MP_QSTR_MONO_HLSB), MP_ROM_INT(FRAMEBUF_MHLSB) }, + { MP_ROM_QSTR(MP_QSTR_MONO_HMSB), MP_ROM_INT(FRAMEBUF_MHMSB) }, }; STATIC MP_DEFINE_CONST_DICT(framebuf_module_globals, framebuf_module_globals_table); diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 48b4190e9..9d1a8c4d0 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -1333,15 +1333,15 @@ STATIC const mp_rom_map_elem_t mp_module_lwip_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_slip), MP_ROM_PTR(&lwip_slip_type) }, #endif // class constants - { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET) }, - { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET6) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(MOD_NETWORK_AF_INET) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(MOD_NETWORK_AF_INET6) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_DGRAM) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_RAW) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(MOD_NETWORK_SOCK_STREAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(MOD_NETWORK_SOCK_DGRAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(MOD_NETWORK_SOCK_RAW) }, - { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_OBJ_NEW_SMALL_INT(1) }, - { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_OBJ_NEW_SMALL_INT(SOF_REUSEADDR) }, + { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_ROM_INT(1) }, + { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_ROM_INT(SOF_REUSEADDR) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_lwip_globals, mp_module_lwip_globals_table); diff --git a/extmod/moduselect.c b/extmod/moduselect.c index 88dd29a49..2b8b87b5a 100644 --- a/extmod/moduselect.c +++ b/extmod/moduselect.c @@ -362,10 +362,10 @@ STATIC const mp_rom_map_elem_t mp_module_select_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uselect) }, { MP_ROM_QSTR(MP_QSTR_select), MP_ROM_PTR(&mp_select_select_obj) }, { MP_ROM_QSTR(MP_QSTR_poll), MP_ROM_PTR(&mp_select_poll_obj) }, - { MP_ROM_QSTR(MP_QSTR_POLLIN), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_RD) }, - { MP_ROM_QSTR(MP_QSTR_POLLOUT), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_WR) }, - { MP_ROM_QSTR(MP_QSTR_POLLERR), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_ERR) }, - { MP_ROM_QSTR(MP_QSTR_POLLHUP), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_HUP) }, + { MP_ROM_QSTR(MP_QSTR_POLLIN), MP_ROM_INT(MP_STREAM_POLL_RD) }, + { MP_ROM_QSTR(MP_QSTR_POLLOUT), MP_ROM_INT(MP_STREAM_POLL_WR) }, + { MP_ROM_QSTR(MP_QSTR_POLLERR), MP_ROM_INT(MP_STREAM_POLL_ERR) }, + { MP_ROM_QSTR(MP_QSTR_POLLHUP), MP_ROM_INT(MP_STREAM_POLL_HUP) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_select_globals, mp_module_select_globals_table); From 55f33240f3d7051d4213629e92437a36f1fac50e Mon Sep 17 00:00:00 2001 From: Alexander Steffen Date: Fri, 30 Jun 2017 09:22:17 +0200 Subject: [PATCH 171/403] all: Use the name MicroPython consistently in comments There were several different spellings of MicroPython present in comments, when there should be only one. --- bare-arm/mpconfigport.h | 2 +- cc3200/application.lds | 8 ++++---- cc3200/boards/LAUNCHXL/mpconfigboard.h | 2 +- cc3200/boards/WIPY/mpconfigboard.h | 2 +- cc3200/boards/cc3200_prefix.c | 2 +- cc3200/bootmgr/bootmgr.h | 2 +- cc3200/bootmgr/bootmgr.lds | 2 +- cc3200/bootmgr/flc.h | 2 +- cc3200/bootmgr/main.c | 2 +- cc3200/ftp/ftp.c | 2 +- cc3200/ftp/ftp.h | 2 +- cc3200/ftp/updater.c | 2 +- cc3200/ftp/updater.h | 2 +- cc3200/hal/cc3200_asm.h | 2 +- cc3200/hal/cc3200_hal.c | 2 +- cc3200/hal/cc3200_hal.h | 2 +- cc3200/hal/fault_registers.h | 2 +- cc3200/main.c | 2 +- cc3200/misc/FreeRTOSHooks.c | 2 +- cc3200/misc/antenna.c | 2 +- cc3200/misc/antenna.h | 2 +- cc3200/misc/help.c | 2 +- cc3200/misc/mperror.c | 2 +- cc3200/misc/mperror.h | 2 +- cc3200/misc/mpexception.c | 2 +- cc3200/misc/mpexception.h | 2 +- cc3200/misc/mpirq.c | 4 ++-- cc3200/misc/mpirq.h | 2 +- cc3200/mods/modmachine.c | 4 ++-- cc3200/mods/modnetwork.c | 2 +- cc3200/mods/modnetwork.h | 2 +- cc3200/mods/modubinascii.c | 4 ++-- cc3200/mods/modubinascii.h | 2 +- cc3200/mods/moduhashlib.c | 4 ++-- cc3200/mods/moduos.c | 4 ++-- cc3200/mods/moduos.h | 2 +- cc3200/mods/modusocket.c | 2 +- cc3200/mods/modusocket.h | 2 +- cc3200/mods/modussl.c | 4 ++-- cc3200/mods/modutime.c | 4 ++-- cc3200/mods/modwipy.c | 2 +- cc3200/mods/modwlan.c | 4 ++-- cc3200/mods/modwlan.h | 2 +- cc3200/mods/pybadc.c | 4 ++-- cc3200/mods/pybadc.h | 2 +- cc3200/mods/pybi2c.c | 4 ++-- cc3200/mods/pybi2c.h | 2 +- cc3200/mods/pybpin.c | 4 ++-- cc3200/mods/pybpin.h | 2 +- cc3200/mods/pybrtc.c | 4 ++-- cc3200/mods/pybrtc.h | 2 +- cc3200/mods/pybsd.c | 4 ++-- cc3200/mods/pybsd.h | 2 +- cc3200/mods/pybsleep.c | 2 +- cc3200/mods/pybsleep.h | 2 +- cc3200/mods/pybspi.c | 4 ++-- cc3200/mods/pybspi.h | 2 +- cc3200/mods/pybtimer.c | 4 ++-- cc3200/mods/pybtimer.h | 2 +- cc3200/mods/pybuart.c | 4 ++-- cc3200/mods/pybuart.h | 2 +- cc3200/mods/pybwdt.c | 4 ++-- cc3200/mods/pybwdt.h | 2 +- cc3200/mpconfigport.h | 4 ++-- cc3200/mptask.c | 2 +- cc3200/mptask.h | 2 +- cc3200/qstrdefsport.h | 2 +- cc3200/serverstask.c | 2 +- cc3200/serverstask.h | 2 +- cc3200/telnet/telnet.c | 2 +- cc3200/telnet/telnet.h | 2 +- cc3200/util/cryptohash.c | 2 +- cc3200/util/cryptohash.h | 2 +- cc3200/util/fifo.c | 2 +- cc3200/util/fifo.h | 2 +- cc3200/util/gccollect.c | 2 +- cc3200/util/gccollect.h | 2 +- cc3200/util/gchelper.h | 2 +- cc3200/util/random.c | 4 ++-- cc3200/util/random.h | 2 +- cc3200/util/sleeprestore.h | 2 +- cc3200/util/socketfifo.c | 2 +- cc3200/util/socketfifo.h | 2 +- cc3200/version.h | 2 +- drivers/nrf24l01/nrf24l01.py | 2 +- drivers/sdcard/sdcard.py | 2 +- drivers/wiznet5k/README.md | 2 +- esp8266/esp_mphal.c | 2 +- esp8266/esp_mphal.h | 2 +- esp8266/fatfs_port.c | 2 +- esp8266/gccollect.c | 2 +- esp8266/gccollect.h | 2 +- esp8266/hspi.c | 6 +++--- esp8266/machine_adc.c | 2 +- esp8266/machine_pin.c | 2 +- esp8266/machine_pwm.c | 2 +- esp8266/machine_rtc.c | 2 +- esp8266/main.c | 2 +- esp8266/modesp.c | 2 +- esp8266/modnetwork.c | 2 +- esp8266/modpyb.c | 2 +- esp8266/moduos.c | 2 +- esp8266/modutime.c | 2 +- esp8266/mpconfigport.h | 2 +- esp8266/qstrdefsport.h | 2 +- examples/embedding/Makefile.upylib | 2 +- examples/embedding/hello-embed.c | 2 +- examples/embedding/mpconfigport_minimal.h | 4 ++-- extmod/machine_mem.c | 2 +- extmod/machine_mem.h | 2 +- extmod/modubinascii.c | 2 +- extmod/modubinascii.h | 2 +- extmod/moductypes.c | 2 +- extmod/moduhashlib.c | 2 +- extmod/moduheapq.c | 2 +- extmod/modure.c | 2 +- extmod/moduselect.c | 2 +- extmod/modussl_axtls.c | 2 +- extmod/moduzlib.c | 2 +- extmod/vfs_fat.h | 2 +- extmod/vfs_fat_diskio.c | 2 +- extmod/vfs_fat_file.c | 2 +- lib/libc/string0.c | 2 +- lib/libm/ef_rem_pio2.c | 2 +- lib/libm/erf_lgamma.c | 2 +- lib/libm/fdlibm.h | 2 +- lib/libm/kf_cos.c | 2 +- lib/libm/kf_rem_pio2.c | 2 +- lib/libm/kf_sin.c | 2 +- lib/libm/kf_tan.c | 2 +- lib/libm/math.c | 2 +- lib/libm/sf_cos.c | 2 +- lib/libm/sf_erf.c | 2 +- lib/libm/sf_frexp.c | 2 +- lib/libm/sf_ldexp.c | 2 +- lib/libm/sf_modf.c | 2 +- lib/libm/sf_sin.c | 2 +- lib/libm/sf_tan.c | 2 +- lib/libm/wf_lgamma.c | 2 +- lib/libm/wf_tgamma.c | 2 +- lib/mp-readline/readline.c | 2 +- lib/mp-readline/readline.h | 2 +- lib/netutils/netutils.c | 2 +- lib/netutils/netutils.h | 2 +- lib/timeutils/timeutils.c | 4 ++-- lib/timeutils/timeutils.h | 2 +- lib/utils/printf.c | 2 +- lib/utils/pyexec.c | 2 +- lib/utils/pyexec.h | 2 +- logo/FONT-LICENSE.txt | 2 +- minimal/mpconfigport.h | 2 +- mpy-cross/Makefile | 2 +- pic16bit/board.c | 2 +- pic16bit/board.h | 2 +- pic16bit/main.c | 2 +- pic16bit/modpyb.c | 2 +- pic16bit/modpyb.h | 2 +- pic16bit/modpybled.c | 2 +- pic16bit/modpybswitch.c | 2 +- pic16bit/mpconfigport.h | 2 +- pic16bit/pic16bit_mphal.c | 2 +- pic16bit/pic16bit_mphal.h | 2 +- py/argcheck.c | 2 +- py/asmarm.c | 2 +- py/asmarm.h | 2 +- py/asmthumb.c | 2 +- py/asmthumb.h | 2 +- py/asmx64.c | 2 +- py/asmx64.h | 2 +- py/asmx86.c | 2 +- py/asmx86.h | 2 +- py/bc.c | 2 +- py/bc.h | 2 +- py/bc0.h | 4 ++-- py/binary.c | 2 +- py/binary.h | 2 +- py/builtin.h | 2 +- py/builtinevex.c | 2 +- py/builtinimport.c | 2 +- py/compile.c | 18 +++++++++--------- py/compile.h | 2 +- py/emit.h | 2 +- py/emitbc.c | 2 +- py/emitcommon.c | 2 +- py/emitglue.c | 2 +- py/emitglue.h | 2 +- py/emitinlinethumb.c | 2 +- py/emitnative.c | 2 +- py/formatfloat.c | 2 +- py/formatfloat.h | 2 +- py/frozenmod.c | 2 +- py/frozenmod.h | 2 +- py/gc.c | 2 +- py/gc.h | 2 +- py/grammar.h | 4 ++-- py/lexer.c | 2 +- py/lexer.h | 4 ++-- py/malloc.c | 4 ++-- py/map.c | 2 +- py/misc.h | 2 +- py/mkrules.mk | 2 +- py/modarray.c | 2 +- py/modbuiltins.c | 2 +- py/modcmath.c | 2 +- py/modcollections.c | 2 +- py/modgc.c | 2 +- py/modio.c | 2 +- py/modmath.c | 2 +- py/modmicropython.c | 2 +- py/modstruct.c | 2 +- py/modsys.c | 4 ++-- py/mphal.h | 2 +- py/mpprint.c | 2 +- py/mpprint.h | 2 +- py/mpstate.c | 2 +- py/mpstate.h | 4 ++-- py/mpz.c | 2 +- py/mpz.h | 2 +- py/nativeglue.c | 6 +++--- py/nlr.h | 2 +- py/nlrsetjmp.c | 2 +- py/obj.c | 2 +- py/obj.h | 2 +- py/objarray.c | 2 +- py/objattrtuple.c | 2 +- py/objbool.c | 2 +- py/objboundmeth.c | 2 +- py/objcell.c | 2 +- py/objclosure.c | 2 +- py/objcomplex.c | 2 +- py/objdict.c | 2 +- py/objenumerate.c | 2 +- py/objexcept.c | 2 +- py/objexcept.h | 2 +- py/objfilter.c | 2 +- py/objfloat.c | 2 +- py/objfun.c | 4 ++-- py/objfun.h | 2 +- py/objgenerator.c | 2 +- py/objgenerator.h | 2 +- py/objgetitemiter.c | 2 +- py/objint.c | 2 +- py/objint.h | 2 +- py/objint_longlong.c | 2 +- py/objint_mpz.c | 2 +- py/objlist.c | 2 +- py/objlist.h | 2 +- py/objmap.c | 2 +- py/objmodule.c | 2 +- py/objmodule.h | 2 +- py/objnamedtuple.c | 2 +- py/objnone.c | 2 +- py/objobject.c | 2 +- py/objproperty.c | 2 +- py/objrange.c | 2 +- py/objreversed.c | 2 +- py/objset.c | 2 +- py/objsingleton.c | 2 +- py/objslice.c | 2 +- py/objstr.c | 2 +- py/objstr.h | 2 +- py/objstringio.c | 2 +- py/objstrunicode.c | 2 +- py/objtuple.c | 2 +- py/objtuple.h | 2 +- py/objtype.c | 6 +++--- py/objtype.h | 2 +- py/objzip.c | 2 +- py/opmethods.c | 2 +- py/parse.c | 2 +- py/parse.h | 2 +- py/parsenum.c | 2 +- py/parsenum.h | 2 +- py/parsenumbase.c | 2 +- py/parsenumbase.h | 2 +- py/qstr.c | 2 +- py/qstr.h | 2 +- py/qstrdefs.h | 2 +- py/repl.c | 2 +- py/repl.h | 2 +- py/runtime.c | 4 ++-- py/runtime.h | 2 +- py/runtime0.h | 2 +- py/runtime_utils.c | 2 +- py/scope.c | 2 +- py/scope.h | 2 +- py/sequence.c | 2 +- py/showbc.c | 2 +- py/smallint.c | 2 +- py/smallint.h | 2 +- py/stackctrl.c | 2 +- py/stackctrl.h | 2 +- py/stream.c | 2 +- py/stream.h | 2 +- py/unicode.c | 2 +- py/unicode.h | 2 +- py/vm.c | 2 +- py/vmentrytable.h | 2 +- py/vstr.c | 2 +- py/warning.c | 2 +- qemu-arm/mpconfigport.h | 2 +- stmhal/accel.c | 4 ++-- stmhal/accel.h | 2 +- stmhal/adc.c | 6 +++--- stmhal/adc.h | 2 +- stmhal/bufhelper.c | 2 +- stmhal/bufhelper.h | 2 +- stmhal/can.c | 4 ++-- stmhal/can.h | 2 +- stmhal/dac.c | 4 ++-- stmhal/dac.h | 2 +- stmhal/dma.c | 2 +- stmhal/dma.h | 2 +- stmhal/extint.c | 2 +- stmhal/extint.h | 2 +- stmhal/flash.c | 2 +- stmhal/flash.h | 2 +- stmhal/font_petme128_8x8.h | 2 +- stmhal/gccollect.c | 2 +- stmhal/gccollect.h | 2 +- stmhal/hal/l4/inc/stm32l4xx_hal_uart.h | 2 +- stmhal/hal/l4/src/stm32l4xx_hal_uart.c | 2 +- stmhal/help.c | 2 +- stmhal/i2c.c | 4 ++-- stmhal/i2c.h | 2 +- stmhal/irq.c | 2 +- stmhal/irq.h | 2 +- stmhal/lcd.c | 2 +- stmhal/lcd.h | 2 +- stmhal/led.c | 2 +- stmhal/led.h | 2 +- stmhal/main.c | 4 ++-- stmhal/modnetwork.c | 2 +- stmhal/modnetwork.h | 2 +- stmhal/modnwcc3k.c | 4 ++-- stmhal/modnwwiznet5k.c | 4 ++-- stmhal/modpyb.c | 2 +- stmhal/modstm.c | 2 +- stmhal/moduos.c | 2 +- stmhal/modusocket.c | 2 +- stmhal/modutime.c | 2 +- stmhal/pendsv.c | 2 +- stmhal/pendsv.h | 2 +- stmhal/pin.c | 2 +- stmhal/pin.h | 2 +- stmhal/pin_defs_stmhal.h | 2 +- stmhal/pin_named_pins.c | 2 +- stmhal/portmodules.h | 2 +- stmhal/qstrdefsport.h | 2 +- stmhal/rng.c | 2 +- stmhal/rng.h | 2 +- stmhal/rtc.c | 4 ++-- stmhal/rtc.h | 2 +- stmhal/sdcard.c | 4 ++-- stmhal/sdcard.h | 2 +- stmhal/servo.c | 4 ++-- stmhal/servo.h | 2 +- stmhal/spi.c | 2 +- stmhal/spi.h | 2 +- stmhal/stm32_it.c | 2 +- stmhal/stm32_it.h | 2 +- stmhal/storage.c | 2 +- stmhal/storage.h | 2 +- stmhal/system_stm32.c | 2 +- stmhal/systick.c | 2 +- stmhal/systick.h | 2 +- stmhal/timer.c | 4 ++-- stmhal/timer.h | 2 +- stmhal/uart.c | 4 ++-- stmhal/uart.h | 2 +- stmhal/usb.c | 8 ++++---- stmhal/usb.h | 2 +- stmhal/usbd_cdc_interface.h | 2 +- stmhal/usbd_conf.c | 2 +- stmhal/usbd_conf.h | 2 +- stmhal/usbd_desc.c | 2 +- stmhal/usbd_desc.h | 2 +- stmhal/usbd_msc_storage.h | 2 +- stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h | 2 +- stmhal/usbdev/class/src/usbd_cdc_msc_hid.c | 2 +- stmhal/usrsw.c | 4 ++-- stmhal/usrsw.h | 2 +- teensy/hal_ftm.c | 2 +- teensy/hal_ftm.h | 2 +- teensy/help.c | 2 +- teensy/led.c | 2 +- teensy/main.c | 2 +- teensy/modpyb.c | 6 +++--- teensy/mpconfigport.h | 2 +- teensy/timer.c | 4 ++-- teensy/timer.h | 2 +- teensy/uart.c | 4 ++-- tests/basics/bytearray_slice_assign.py | 2 +- tests/basics/list_slice_assign.py | 2 +- tests/io/stringio1.py | 2 +- tests/run-bench-tests | 2 +- tests/run-tests | 2 +- tools/gen-cpydiff.py | 2 +- unix/Makefile | 2 +- unix/alloc.c | 2 +- unix/fdfile.h | 2 +- unix/file.c | 2 +- unix/gccollect.c | 2 +- unix/input.c | 2 +- unix/main.c | 2 +- unix/modffi.c | 2 +- unix/modjni.c | 2 +- unix/modmachine.c | 2 +- unix/modos.c | 2 +- unix/modsocket.c | 2 +- unix/modtermios.c | 2 +- unix/modtime.c | 2 +- unix/moduselect.c | 2 +- unix/mpconfigport.h | 4 ++-- unix/mpconfigport_fast.h | 2 +- unix/mpconfigport_minimal.h | 4 ++-- unix/mphalport.h | 2 +- unix/qstrdefsport.h | 2 +- unix/unix_mphal.c | 2 +- windows/init.c | 2 +- windows/init.h | 2 +- windows/mpconfigport.h | 4 ++-- windows/msvc/gettimeofday.c | 2 +- windows/msvc/sys/time.h | 2 +- windows/msvc/unistd.h | 2 +- windows/realpath.c | 2 +- windows/realpath.h | 2 +- windows/sleep.c | 2 +- windows/sleep.h | 2 +- windows/windows_mphal.c | 2 +- windows/windows_mphal.h | 2 +- zephyr/machine_pin.c | 2 +- zephyr/modutime.c | 2 +- 433 files changed, 504 insertions(+), 504 deletions(-) diff --git a/bare-arm/mpconfigport.h b/bare-arm/mpconfigport.h index 97e866bdb..17f794521 100644 --- a/bare-arm/mpconfigport.h +++ b/bare-arm/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_QSTR_BYTES_IN_HASH (1) #define MICROPY_ALLOC_PATH_MAX (512) diff --git a/cc3200/application.lds b/cc3200/application.lds index 22ad1968d..3f5e72f8b 100644 --- a/cc3200/application.lds +++ b/cc3200/application.lds @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -37,7 +37,7 @@ ENTRY(ResetISR) SECTIONS { - /* place the FreeRTOS heap (the micropython stack will live here) */ + /* place the FreeRTOS heap (the MicroPython stack will live here) */ .rtos_heap (NOLOAD) : { . = ALIGN(8); @@ -83,7 +83,7 @@ SECTIONS } > SRAM /* place here functions that are only called during boot up, */ - /* that way, we can re-use this area for the micropython heap */ + /* that way, we can re-use this area for the MicroPython heap */ .boot : { . = ALIGN(8); @@ -93,7 +93,7 @@ SECTIONS _eboot = .; } > SRAM - /* allocate the micropython heap */ + /* allocate the MicroPython heap */ .heap : { . = ALIGN(8); diff --git a/cc3200/boards/LAUNCHXL/mpconfigboard.h b/cc3200/boards/LAUNCHXL/mpconfigboard.h index 32ef5290b..b3d766d1e 100644 --- a/cc3200/boards/LAUNCHXL/mpconfigboard.h +++ b/cc3200/boards/LAUNCHXL/mpconfigboard.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/boards/WIPY/mpconfigboard.h b/cc3200/boards/WIPY/mpconfigboard.h index 9f04dbf23..af15cca35 100644 --- a/cc3200/boards/WIPY/mpconfigboard.h +++ b/cc3200/boards/WIPY/mpconfigboard.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/boards/cc3200_prefix.c b/cc3200/boards/cc3200_prefix.c index 971285745..d03efe024 100644 --- a/cc3200/boards/cc3200_prefix.c +++ b/cc3200/boards/cc3200_prefix.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/bootmgr.h b/cc3200/bootmgr/bootmgr.h index e5285d4e4..5a370f8c9 100644 --- a/cc3200/bootmgr/bootmgr.h +++ b/cc3200/bootmgr/bootmgr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/bootmgr.lds b/cc3200/bootmgr/bootmgr.lds index e67fe23ae..9c911a0d0 100644 --- a/cc3200/bootmgr/bootmgr.lds +++ b/cc3200/bootmgr/bootmgr.lds @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/flc.h b/cc3200/bootmgr/flc.h index 7c04c7b05..8f05bb320 100644 --- a/cc3200/bootmgr/flc.h +++ b/cc3200/bootmgr/flc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/main.c b/cc3200/bootmgr/main.c index 0d9ab35f8..cfb8dec21 100644 --- a/cc3200/bootmgr/main.c +++ b/cc3200/bootmgr/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/ftp.c b/cc3200/ftp/ftp.c index b56e3f4ce..5461f9180 100644 --- a/cc3200/ftp/ftp.c +++ b/cc3200/ftp/ftp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/ftp.h b/cc3200/ftp/ftp.h index 7d16002e4..af4c14fa3 100644 --- a/cc3200/ftp/ftp.h +++ b/cc3200/ftp/ftp.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/updater.c b/cc3200/ftp/updater.c index fece70095..5be2c6063 100644 --- a/cc3200/ftp/updater.c +++ b/cc3200/ftp/updater.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/updater.h b/cc3200/ftp/updater.h index dcca70472..51248e4bf 100644 --- a/cc3200/ftp/updater.h +++ b/cc3200/ftp/updater.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/cc3200_asm.h b/cc3200/hal/cc3200_asm.h index dcaaf57e1..742c9a6f7 100644 --- a/cc3200/hal/cc3200_asm.h +++ b/cc3200/hal/cc3200_asm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/cc3200_hal.c b/cc3200/hal/cc3200_hal.c index 5c0e9c30f..b4848e99e 100644 --- a/cc3200/hal/cc3200_hal.c +++ b/cc3200/hal/cc3200_hal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/cc3200_hal.h b/cc3200/hal/cc3200_hal.h index 9953f0e5a..71e245eeb 100644 --- a/cc3200/hal/cc3200_hal.h +++ b/cc3200/hal/cc3200_hal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/fault_registers.h b/cc3200/hal/fault_registers.h index 739745e92..ade516b9e 100644 --- a/cc3200/hal/fault_registers.h +++ b/cc3200/hal/fault_registers.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/main.c b/cc3200/main.c index 1ffb98188..e2299e146 100644 --- a/cc3200/main.c +++ b/cc3200/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/FreeRTOSHooks.c b/cc3200/misc/FreeRTOSHooks.c index dac9a9282..c618279b7 100644 --- a/cc3200/misc/FreeRTOSHooks.c +++ b/cc3200/misc/FreeRTOSHooks.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/antenna.c b/cc3200/misc/antenna.c index 0fbf79f0f..afeed85e1 100644 --- a/cc3200/misc/antenna.c +++ b/cc3200/misc/antenna.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/antenna.h b/cc3200/misc/antenna.h index 3bb87e32b..c9d845453 100644 --- a/cc3200/misc/antenna.h +++ b/cc3200/misc/antenna.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/help.c b/cc3200/misc/help.c index cce515898..739303e19 100644 --- a/cc3200/misc/help.c +++ b/cc3200/misc/help.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mperror.c b/cc3200/misc/mperror.c index 81b853b48..082d940e2 100644 --- a/cc3200/misc/mperror.c +++ b/cc3200/misc/mperror.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mperror.h b/cc3200/misc/mperror.h index 46a9b8cb0..1c3eb6269 100644 --- a/cc3200/misc/mperror.h +++ b/cc3200/misc/mperror.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mpexception.c b/cc3200/misc/mpexception.c index 068adb70b..72b203fae 100644 --- a/cc3200/misc/mpexception.c +++ b/cc3200/misc/mpexception.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mpexception.h b/cc3200/misc/mpexception.h index d23381caf..88134857c 100644 --- a/cc3200/misc/mpexception.h +++ b/cc3200/misc/mpexception.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mpirq.c b/cc3200/misc/mpirq.c index 37149089f..321663088 100644 --- a/cc3200/misc/mpirq.c +++ b/cc3200/misc/mpirq.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -143,7 +143,7 @@ void mp_irq_handler (mp_obj_t self_in) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC mp_obj_t mp_irq_init (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_irq_obj_t *self = pos_args[0]; diff --git a/cc3200/misc/mpirq.h b/cc3200/misc/mpirq.h index 8b4ab2f1b..35ce66e2d 100644 --- a/cc3200/misc/mpirq.h +++ b/cc3200/misc/mpirq.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modmachine.c b/cc3200/mods/modmachine.c index fd1485607..5f63d0196 100644 --- a/cc3200/mods/modmachine.c +++ b/cc3200/mods/modmachine.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -72,7 +72,7 @@ extern OsiTaskHandle xSimpleLinkSpawnTaskHndl; /// /******************************************************************************/ -// Micro Python bindings; +// MicroPython bindings; STATIC mp_obj_t machine_reset(void) { // disable wlan diff --git a/cc3200/mods/modnetwork.c b/cc3200/mods/modnetwork.c index d44f75aca..249e1be37 100644 --- a/cc3200/mods/modnetwork.c +++ b/cc3200/mods/modnetwork.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modnetwork.h b/cc3200/mods/modnetwork.h index 8e1196e86..6ec90a2ba 100644 --- a/cc3200/mods/modnetwork.h +++ b/cc3200/mods/modnetwork.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modubinascii.c b/cc3200/mods/modubinascii.c index 09f4b1e10..8bc2feacc 100644 --- a/cc3200/mods/modubinascii.c +++ b/cc3200/mods/modubinascii.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -44,7 +44,7 @@ /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_map_elem_t mp_module_binascii_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_ubinascii) }, diff --git a/cc3200/mods/modubinascii.h b/cc3200/mods/modubinascii.h index 3e784e9ae..eb9fc4f21 100644 --- a/cc3200/mods/modubinascii.h +++ b/cc3200/mods/modubinascii.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/moduhashlib.c b/cc3200/mods/moduhashlib.c index e1145e4d8..c90c727c2 100644 --- a/cc3200/mods/moduhashlib.c +++ b/cc3200/mods/moduhashlib.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -117,7 +117,7 @@ STATIC mp_obj_t hash_read (mp_obj_t self_in) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings /// \classmethod \constructor([data[, block_size]]) /// initial data must be given if block_size wants to be passed diff --git a/cc3200/mods/moduos.c b/cc3200/mods/moduos.c index ed8879bf3..51dc5834d 100644 --- a/cc3200/mods/moduos.c +++ b/cc3200/mods/moduos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -78,7 +78,7 @@ void osmount_unmount_all (void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings // STATIC const qstr os_uname_info_fields[] = { diff --git a/cc3200/mods/moduos.h b/cc3200/mods/moduos.h index 148cddf2e..f183715c9 100644 --- a/cc3200/mods/moduos.h +++ b/cc3200/mods/moduos.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modusocket.c b/cc3200/mods/modusocket.c index 4e17bbae6..739355360 100644 --- a/cc3200/mods/modusocket.c +++ b/cc3200/mods/modusocket.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modusocket.h b/cc3200/mods/modusocket.h index 80c1f24cd..6e7758662 100644 --- a/cc3200/mods/modusocket.h +++ b/cc3200/mods/modusocket.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modussl.c b/cc3200/mods/modussl.c index 95ecdbce7..808267571 100644 --- a/cc3200/mods/modussl.c +++ b/cc3200/mods/modussl.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -57,7 +57,7 @@ typedef struct _mp_obj_ssl_socket_t { STATIC const mp_obj_type_t ssl_socket_type; /******************************************************************************/ -// Micro Python bindings; SSL class +// MicroPython bindings; SSL class // ssl sockets inherit from normal socket, so we take its // locals and stream methods diff --git a/cc3200/mods/modutime.c b/cc3200/mods/modutime.c index 48fde67e7..428b00f93 100644 --- a/cc3200/mods/modutime.c +++ b/cc3200/mods/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -51,7 +51,7 @@ /// and for sleeping. /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings /// \function localtime([secs]) /// Convert a time expressed in seconds since Jan 1, 2000 into an 8-tuple which diff --git a/cc3200/mods/modwipy.c b/cc3200/mods/modwipy.c index b4c18d153..21a9cc63b 100644 --- a/cc3200/mods/modwipy.c +++ b/cc3200/mods/modwipy.c @@ -5,7 +5,7 @@ /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC mp_obj_t mod_wipy_heartbeat (mp_uint_t n_args, const mp_obj_t *args) { if (n_args) { diff --git a/cc3200/mods/modwlan.c b/cc3200/mods/modwlan.c index 68d892364..77f5bd991 100644 --- a/cc3200/mods/modwlan.c +++ b/cc3200/mods/modwlan.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -763,7 +763,7 @@ STATIC bool wlan_scan_result_is_unique (const mp_obj_list_t *nets, _u8 *bssid) { } /******************************************************************************/ -// Micro Python bindings; WLAN class +// MicroPython bindings; WLAN class /// \class WLAN - WiFi driver diff --git a/cc3200/mods/modwlan.h b/cc3200/mods/modwlan.h index d37d276e8..b806644f5 100644 --- a/cc3200/mods/modwlan.h +++ b/cc3200/mods/modwlan.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybadc.c b/cc3200/mods/pybadc.c index 696e7650b..0b4f0ba68 100644 --- a/cc3200/mods/pybadc.c +++ b/cc3200/mods/pybadc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -126,7 +126,7 @@ STATIC void pyb_adc_deinit_all_channels (void) { } /******************************************************************************/ -/* Micro Python bindings : adc object */ +/* MicroPython bindings : adc object */ STATIC void adc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_adc_obj_t *self = self_in; diff --git a/cc3200/mods/pybadc.h b/cc3200/mods/pybadc.h index 50640ee60..db04b006b 100644 --- a/cc3200/mods/pybadc.h +++ b/cc3200/mods/pybadc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybi2c.c b/cc3200/mods/pybi2c.c index 9fc97d914..9c62ffdc4 100644 --- a/cc3200/mods/pybi2c.c +++ b/cc3200/mods/pybi2c.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -281,7 +281,7 @@ STATIC void pyb_i2c_readmem_into (mp_arg_val_t *args, vstr_t *vstr) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ /******************************************************************************/ STATIC void pyb_i2c_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_i2c_obj_t *self = self_in; diff --git a/cc3200/mods/pybi2c.h b/cc3200/mods/pybi2c.h index d547f6330..dcc3f0468 100644 --- a/cc3200/mods/pybi2c.h +++ b/cc3200/mods/pybi2c.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybpin.c b/cc3200/mods/pybpin.c index c2a469117..d59f113eb 100644 --- a/cc3200/mods/pybpin.c +++ b/cc3200/mods/pybpin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -519,7 +519,7 @@ STATIC void EXTI_Handler(uint port) { /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_arg_t pin_init_args[] = { { MP_QSTR_mode, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, diff --git a/cc3200/mods/pybpin.h b/cc3200/mods/pybpin.h index 6b4b7b1ed..74f0af2b3 100644 --- a/cc3200/mods/pybpin.h +++ b/cc3200/mods/pybpin.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybrtc.c b/cc3200/mods/pybrtc.c index 134bd440e..14c4cd419 100644 --- a/cc3200/mods/pybrtc.c +++ b/cc3200/mods/pybrtc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -278,7 +278,7 @@ STATIC void rtc_msec_add (uint16_t msecs_1, uint32_t *secs, uint16_t *msecs_2) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_arg_t pyb_rtc_init_args[] = { { MP_QSTR_id, MP_ARG_INT, {.u_int = 0} }, diff --git a/cc3200/mods/pybrtc.h b/cc3200/mods/pybrtc.h index 3fd11ecd6..f73de3f5a 100644 --- a/cc3200/mods/pybrtc.h +++ b/cc3200/mods/pybrtc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybsd.c b/cc3200/mods/pybsd.c index 306baea8b..5ba6119b2 100644 --- a/cc3200/mods/pybsd.c +++ b/cc3200/mods/pybsd.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -118,7 +118,7 @@ STATIC mp_obj_t pyb_sd_init_helper (pybsd_obj_t *self, const mp_arg_val_t *args) } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings // STATIC const mp_arg_t pyb_sd_init_args[] = { diff --git a/cc3200/mods/pybsd.h b/cc3200/mods/pybsd.h index 084d7caaf..af942084d 100644 --- a/cc3200/mods/pybsd.h +++ b/cc3200/mods/pybsd.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybsleep.c b/cc3200/mods/pybsleep.c index ced7fef85..a7488c5f1 100644 --- a/cc3200/mods/pybsleep.c +++ b/cc3200/mods/pybsleep.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybsleep.h b/cc3200/mods/pybsleep.h index 513e6fa95..e98636178 100644 --- a/cc3200/mods/pybsleep.h +++ b/cc3200/mods/pybsleep.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybspi.c b/cc3200/mods/pybspi.c index 3cd384266..9edad579a 100644 --- a/cc3200/mods/pybspi.c +++ b/cc3200/mods/pybspi.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -144,7 +144,7 @@ STATIC void pybspi_transfer (pyb_spi_obj_t *self, const char *txdata, char *rxda } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ /******************************************************************************/ STATIC void pyb_spi_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_spi_obj_t *self = self_in; diff --git a/cc3200/mods/pybspi.h b/cc3200/mods/pybspi.h index b533b6056..b0fce8870 100644 --- a/cc3200/mods/pybspi.h +++ b/cc3200/mods/pybspi.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybtimer.c b/cc3200/mods/pybtimer.c index d25ac6c2b..1ef9a4a44 100644 --- a/cc3200/mods/pybtimer.c +++ b/cc3200/mods/pybtimer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -264,7 +264,7 @@ STATIC void timer_channel_init (pyb_timer_channel_obj_t *ch) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_timer_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_timer_obj_t *tim = self_in; diff --git a/cc3200/mods/pybtimer.h b/cc3200/mods/pybtimer.h index a1b30cd2b..0af0864ca 100644 --- a/cc3200/mods/pybtimer.h +++ b/cc3200/mods/pybtimer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybuart.c b/cc3200/mods/pybuart.c index 06938bdd4..626357179 100644 --- a/cc3200/mods/pybuart.c +++ b/cc3200/mods/pybuart.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -311,7 +311,7 @@ STATIC int uart_irq_flags (mp_obj_t self_in) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_uart_obj_t *self = self_in; diff --git a/cc3200/mods/pybuart.h b/cc3200/mods/pybuart.h index 56440987f..d481242f1 100644 --- a/cc3200/mods/pybuart.h +++ b/cc3200/mods/pybuart.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybwdt.c b/cc3200/mods/pybwdt.c index 76c701ca0..114e7ac96 100644 --- a/cc3200/mods/pybwdt.c +++ b/cc3200/mods/pybwdt.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -87,7 +87,7 @@ void pybwdt_sl_alive (void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_arg_t pyb_wdt_init_args[] = { { MP_QSTR_id, MP_ARG_OBJ, {.u_obj = mp_const_none} }, diff --git a/cc3200/mods/pybwdt.h b/cc3200/mods/pybwdt.h index 2844587cb..275c49435 100644 --- a/cc3200/mods/pybwdt.h +++ b/cc3200/mods/pybwdt.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mpconfigport.h b/cc3200/mpconfigport.h index 78f8c0948..dcde9aae0 100644 --- a/cc3200/mpconfigport.h +++ b/cc3200/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -32,7 +32,7 @@ #include "semphr.h" #endif -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (128) #define MICROPY_PERSISTENT_CODE_LOAD (1) diff --git a/cc3200/mptask.c b/cc3200/mptask.c index 50c3c769d..09be8c441 100644 --- a/cc3200/mptask.c +++ b/cc3200/mptask.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mptask.h b/cc3200/mptask.h index 5345ecfda..a1c3eb2cb 100644 --- a/cc3200/mptask.h +++ b/cc3200/mptask.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/qstrdefsport.h b/cc3200/qstrdefsport.h index 2fc56668c..d5f22d70a 100644 --- a/cc3200/qstrdefsport.h +++ b/cc3200/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/serverstask.c b/cc3200/serverstask.c index 6b5899e18..100b8d33b 100644 --- a/cc3200/serverstask.c +++ b/cc3200/serverstask.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/serverstask.h b/cc3200/serverstask.h index 77a3af2f3..c4533d717 100644 --- a/cc3200/serverstask.h +++ b/cc3200/serverstask.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/telnet/telnet.c b/cc3200/telnet/telnet.c index 26e45a75f..2f0818f6b 100644 --- a/cc3200/telnet/telnet.c +++ b/cc3200/telnet/telnet.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/telnet/telnet.h b/cc3200/telnet/telnet.h index 1e3173b11..51c569104 100644 --- a/cc3200/telnet/telnet.h +++ b/cc3200/telnet/telnet.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/cryptohash.c b/cc3200/util/cryptohash.c index d2d6222ff..909dadc8c 100644 --- a/cc3200/util/cryptohash.c +++ b/cc3200/util/cryptohash.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/cryptohash.h b/cc3200/util/cryptohash.h index df3a8475c..15d46b705 100644 --- a/cc3200/util/cryptohash.h +++ b/cc3200/util/cryptohash.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/fifo.c b/cc3200/util/fifo.c index 166f99d98..421f83710 100644 --- a/cc3200/util/fifo.c +++ b/cc3200/util/fifo.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/fifo.h b/cc3200/util/fifo.h index ee7571c26..6ede57e1e 100644 --- a/cc3200/util/fifo.h +++ b/cc3200/util/fifo.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/gccollect.c b/cc3200/util/gccollect.c index 8963852f7..baee2eeef 100644 --- a/cc3200/util/gccollect.c +++ b/cc3200/util/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/gccollect.h b/cc3200/util/gccollect.h index 3c4232b84..08d43d283 100644 --- a/cc3200/util/gccollect.h +++ b/cc3200/util/gccollect.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/gchelper.h b/cc3200/util/gchelper.h index 0277a754b..48e81bc61 100644 --- a/cc3200/util/gchelper.h +++ b/cc3200/util/gchelper.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/random.c b/cc3200/util/random.c index 54aaa829c..f8e9cdf0c 100644 --- a/cc3200/util/random.c +++ b/cc3200/util/random.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -67,7 +67,7 @@ STATIC uint32_t lfsr (uint32_t input) { } /******************************************************************************/ -// Micro Python bindings; +// MicroPython bindings; STATIC mp_obj_t machine_rng_get(void) { return mp_obj_new_int(rng_get()); diff --git a/cc3200/util/random.h b/cc3200/util/random.h index 60b0b8663..02cde6b52 100644 --- a/cc3200/util/random.h +++ b/cc3200/util/random.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/sleeprestore.h b/cc3200/util/sleeprestore.h index 1c5509db0..e178f4c2d 100644 --- a/cc3200/util/sleeprestore.h +++ b/cc3200/util/sleeprestore.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/socketfifo.c b/cc3200/util/socketfifo.c index eb25f3be3..d0a715048 100644 --- a/cc3200/util/socketfifo.c +++ b/cc3200/util/socketfifo.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/socketfifo.h b/cc3200/util/socketfifo.h index 1309201ee..e6cf851b1 100644 --- a/cc3200/util/socketfifo.h +++ b/cc3200/util/socketfifo.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/version.h b/cc3200/version.h index 83e3f8c07..fccb95c52 100644 --- a/cc3200/version.h +++ b/cc3200/version.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/drivers/nrf24l01/nrf24l01.py b/drivers/nrf24l01/nrf24l01.py index b45c137c6..7274a7927 100644 --- a/drivers/nrf24l01/nrf24l01.py +++ b/drivers/nrf24l01/nrf24l01.py @@ -1,4 +1,4 @@ -"""NRF24L01 driver for Micro Python +"""NRF24L01 driver for MicroPython """ from micropython import const diff --git a/drivers/sdcard/sdcard.py b/drivers/sdcard/sdcard.py index e749d5376..75a0c501e 100644 --- a/drivers/sdcard/sdcard.py +++ b/drivers/sdcard/sdcard.py @@ -1,5 +1,5 @@ """ -Micro Python driver for SD cards using SPI bus. +MicroPython driver for SD cards using SPI bus. Requires an SPI bus and a CS pin. Provides readblocks and writeblocks methods so the device can be mounted as a filesystem. diff --git a/drivers/wiznet5k/README.md b/drivers/wiznet5k/README.md index 4f907e0b1..88f25a2b8 100644 --- a/drivers/wiznet5k/README.md +++ b/drivers/wiznet5k/README.md @@ -1,6 +1,6 @@ This is the driver for the WIZnet5x00 series of Ethernet controllers. -Adapted for Micro Python. +Adapted for MicroPython. Original source: https://github.com/Wiznet/W5500_EVB/tree/master/ioLibrary Taken on: 30 August 2014 diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c index 55f9a5894..61848fd34 100644 --- a/esp8266/esp_mphal.c +++ b/esp8266/esp_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/esp_mphal.h b/esp8266/esp_mphal.h index 1d1d6de3f..913bd70dc 100644 --- a/esp8266/esp_mphal.h +++ b/esp8266/esp_mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/fatfs_port.c b/esp8266/fatfs_port.c index 02384f605..a8865c817 100644 --- a/esp8266/fatfs_port.c +++ b/esp8266/fatfs_port.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/gccollect.c b/esp8266/gccollect.c index 1b9349f57..cd5d4932c 100644 --- a/esp8266/gccollect.c +++ b/esp8266/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/gccollect.h b/esp8266/gccollect.h index 0aee42771..5735d8a39 100644 --- a/esp8266/gccollect.h +++ b/esp8266/gccollect.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/hspi.c b/esp8266/hspi.c index 436fb4f6f..554a50460 100644 --- a/esp8266/hspi.c +++ b/esp8266/hspi.c @@ -28,7 +28,7 @@ /* Wrapper to setup HSPI/SPI GPIO pins and default SPI clock spi_no - SPI (0) or HSPI (1) -Not used in Micropython. +Not used in MicroPython. */ void spi_init(uint8_t spi_no) { spi_init_gpio(spi_no, SPI_CLK_USE_DIV); @@ -48,7 +48,7 @@ Configures SPI mode parameters for clock edge and clock polarity. (1) Data is valid on clock trailing edge spi_cpol - (0) Clock is low when inactive (1) Clock is high when inactive -For Micropython this version is different from original. +For MicroPython this version is different from original. */ void spi_mode(uint8_t spi_no, uint8_t spi_cpha, uint8_t spi_cpol) { if (spi_cpol) { @@ -99,7 +99,7 @@ void spi_init_gpio(uint8_t spi_no, uint8_t sysclk_as_spiclk) { // GPIO14 is HSPI CLK pin (Clock) PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, 2); // GPIO15 is HSPI CS pin (Chip Select / Slave Select) - // In Micropython, we are handling CS ourself in drivers. + // In MicroPython, we are handling CS ourself in drivers. // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, 2); } } diff --git a/esp8266/machine_adc.c b/esp8266/machine_adc.c index 73ec05208..c8c08695b 100644 --- a/esp8266/machine_adc.c +++ b/esp8266/machine_adc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/machine_pin.c b/esp8266/machine_pin.c index 6f75a0a6a..de65735ba 100644 --- a/esp8266/machine_pin.c +++ b/esp8266/machine_pin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/machine_pwm.c b/esp8266/machine_pwm.c index 5d30f0965..8d73e6bb1 100644 --- a/esp8266/machine_pwm.c +++ b/esp8266/machine_pwm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/machine_rtc.c b/esp8266/machine_rtc.c index 984e8b6e8..2ad44318f 100644 --- a/esp8266/machine_rtc.c +++ b/esp8266/machine_rtc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/main.c b/esp8266/main.c index 43b83759e..957198aa0 100644 --- a/esp8266/main.c +++ b/esp8266/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modesp.c b/esp8266/modesp.c index 1aec1f90e..a63d50564 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modnetwork.c b/esp8266/modnetwork.c index a621522d0..283abecaf 100644 --- a/esp8266/modnetwork.c +++ b/esp8266/modnetwork.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modpyb.c b/esp8266/modpyb.c index 9fe8039bc..e977191ee 100644 --- a/esp8266/modpyb.c +++ b/esp8266/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/moduos.c b/esp8266/moduos.c index 807d2e18a..d0554096e 100644 --- a/esp8266/moduos.c +++ b/esp8266/moduos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modutime.c b/esp8266/modutime.c index bdeb3bb45..afb14dfd6 100644 --- a/esp8266/modutime.c +++ b/esp8266/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h index ab5591bb7..bbded43f4 100644 --- a/esp8266/mpconfigport.h +++ b/esp8266/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C) #define MICROPY_ALLOC_PATH_MAX (128) diff --git a/esp8266/qstrdefsport.h b/esp8266/qstrdefsport.h index 7610eb33d..8f301a69c 100644 --- a/esp8266/qstrdefsport.h +++ b/esp8266/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/examples/embedding/Makefile.upylib b/examples/embedding/Makefile.upylib index bb48fd507..a9b653517 100644 --- a/examples/embedding/Makefile.upylib +++ b/examples/embedding/Makefile.upylib @@ -55,7 +55,7 @@ CFLAGS += -U _FORTIFY_SOURCE endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. -# The unix port of micropython on OSX must be compiled with clang, +# The unix port of MicroPython on OSX must be compiled with clang, # while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) diff --git a/examples/embedding/hello-embed.c b/examples/embedding/hello-embed.c index e3a484783..3473e5bcd 100644 --- a/examples/embedding/hello-embed.c +++ b/examples/embedding/hello-embed.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/examples/embedding/mpconfigport_minimal.h b/examples/embedding/mpconfigport_minimal.h index 87c87fa97..5b96aa4b0 100644 --- a/examples/embedding/mpconfigport_minimal.h +++ b/examples/embedding/mpconfigport_minimal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (PATH_MAX) #define MICROPY_ENABLE_GC (1) diff --git a/extmod/machine_mem.c b/extmod/machine_mem.c index 88c176803..af987cb7f 100644 --- a/extmod/machine_mem.c +++ b/extmod/machine_mem.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/machine_mem.h b/extmod/machine_mem.h index 4bc9ac127..a48a52c82 100644 --- a/extmod/machine_mem.h +++ b/extmod/machine_mem.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index 4dda3c442..d79191b3e 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modubinascii.h b/extmod/modubinascii.h index 6c0156fc4..fb3169267 100644 --- a/extmod/modubinascii.h +++ b/extmod/modubinascii.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moductypes.c b/extmod/moductypes.c index d2d2e85de..9678fd58f 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduhashlib.c b/extmod/moduhashlib.c index 13525cc3f..f3beb3939 100644 --- a/extmod/moduhashlib.c +++ b/extmod/moduhashlib.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index 567ee83da..e6e417d2b 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modure.c b/extmod/modure.c index b4c7a364f..b85ba2673 100644 --- a/extmod/modure.c +++ b/extmod/modure.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduselect.c b/extmod/moduselect.c index 2b8b87b5a..a9f25c195 100644 --- a/extmod/moduselect.c +++ b/extmod/moduselect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index be1aa0359..86dd8e29c 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index 6e045c403..a05d0f2ed 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h index 63c4abb82..443e4eda8 100644 --- a/extmod/vfs_fat.h +++ b/extmod/vfs_fat.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/vfs_fat_diskio.c b/extmod/vfs_fat_diskio.c index 24c00ffba..ff23c6b0c 100644 --- a/extmod/vfs_fat_diskio.c +++ b/extmod/vfs_fat_diskio.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Original template for this file comes from: * Low level disk I/O module skeleton for FatFs, (C)ChaN, 2013 diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 22907c12a..8fb48f01a 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/libc/string0.c b/lib/libc/string0.c index 1b37169ed..c2f2abd0f 100644 --- a/lib/libc/string0.c +++ b/lib/libc/string0.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/libm/ef_rem_pio2.c b/lib/libm/ef_rem_pio2.c index f7a695e17..ca55243fb 100644 --- a/lib/libm/ef_rem_pio2.c +++ b/lib/libm/ef_rem_pio2.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/erf_lgamma.c b/lib/libm/erf_lgamma.c index a0da86b8d..877816a0c 100644 --- a/lib/libm/erf_lgamma.c +++ b/lib/libm/erf_lgamma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/fdlibm.h b/lib/libm/fdlibm.h index 529a3975a..ace3b2da2 100644 --- a/lib/libm/fdlibm.h +++ b/lib/libm/fdlibm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * This file is adapted from from newlib-nano-2, the newlib/libm/common/fdlib.h, * available from https://github.com/32bitmicro/newlib-nano-2. The main change diff --git a/lib/libm/kf_cos.c b/lib/libm/kf_cos.c index f1f883ced..691f9842f 100644 --- a/lib/libm/kf_cos.c +++ b/lib/libm/kf_cos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/kf_rem_pio2.c b/lib/libm/kf_rem_pio2.c index e267b65f9..c7e947957 100644 --- a/lib/libm/kf_rem_pio2.c +++ b/lib/libm/kf_rem_pio2.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/kf_sin.c b/lib/libm/kf_sin.c index 81390b4eb..07ea99344 100644 --- a/lib/libm/kf_sin.c +++ b/lib/libm/kf_sin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/kf_tan.c b/lib/libm/kf_tan.c index 68254c682..6da9bd817 100644 --- a/lib/libm/kf_tan.c +++ b/lib/libm/kf_tan.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/math.c b/lib/libm/math.c index d7e27e775..984636627 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/libm/sf_cos.c b/lib/libm/sf_cos.c index 33cde50e2..fabb129cd 100644 --- a/lib/libm/sf_cos.c +++ b/lib/libm/sf_cos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_erf.c b/lib/libm/sf_erf.c index 00ac4baf1..3f0172c6e 100644 --- a/lib/libm/sf_erf.c +++ b/lib/libm/sf_erf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_frexp.c b/lib/libm/sf_frexp.c index 397373fde..df50fb773 100644 --- a/lib/libm/sf_frexp.c +++ b/lib/libm/sf_frexp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_ldexp.c b/lib/libm/sf_ldexp.c index a0941df9f..37968d475 100644 --- a/lib/libm/sf_ldexp.c +++ b/lib/libm/sf_ldexp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_modf.c b/lib/libm/sf_modf.c index 4fcae057a..410db2a37 100644 --- a/lib/libm/sf_modf.c +++ b/lib/libm/sf_modf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/common * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_sin.c b/lib/libm/sf_sin.c index 585ab8d8c..d27050778 100644 --- a/lib/libm/sf_sin.c +++ b/lib/libm/sf_sin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_tan.c b/lib/libm/sf_tan.c index a9296d8bf..148b16d61 100644 --- a/lib/libm/sf_tan.c +++ b/lib/libm/sf_tan.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/wf_lgamma.c b/lib/libm/wf_lgamma.c index 7d2f42c54..d86ede790 100644 --- a/lib/libm/wf_lgamma.c +++ b/lib/libm/wf_lgamma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/wf_tgamma.c b/lib/libm/wf_tgamma.c index afd16bf67..64b2488d1 100644 --- a/lib/libm/wf_tgamma.c +++ b/lib/libm/wf_tgamma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 5b35c8660..9d254d8cf 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/mp-readline/readline.h b/lib/mp-readline/readline.h index f53fdeaa8..00aa9622a 100644 --- a/lib/mp-readline/readline.h +++ b/lib/mp-readline/readline.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/netutils/netutils.c b/lib/netutils/netutils.c index a2ea31cf3..a32452161 100644 --- a/lib/netutils/netutils.c +++ b/lib/netutils/netutils.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/netutils/netutils.h b/lib/netutils/netutils.h index 1e147afa9..4befc90db 100644 --- a/lib/netutils/netutils.h +++ b/lib/netutils/netutils.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/timeutils/timeutils.c b/lib/timeutils/timeutils.c index 06915f25a..eb3dc80d4 100644 --- a/lib/timeutils/timeutils.c +++ b/lib/timeutils/timeutils.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -67,7 +67,7 @@ mp_uint_t timeutils_year_day(mp_uint_t year, mp_uint_t month, mp_uint_t date) { void timeutils_seconds_since_2000_to_struct_time(mp_uint_t t, timeutils_struct_time_t *tm) { // The following algorithm was adapted from musl's __secs_to_tm and adapted - // for differences in Micro Python's timebase. + // for differences in MicroPython's timebase. mp_int_t seconds = t - LEAPOCH; diff --git a/lib/timeutils/timeutils.h b/lib/timeutils/timeutils.h index 1dc486e2e..9b1abeb8f 100644 --- a/lib/timeutils/timeutils.h +++ b/lib/timeutils/timeutils.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/utils/printf.c b/lib/utils/printf.c index 303edfcca..51dfa5b96 100644 --- a/lib/utils/printf.c +++ b/lib/utils/printf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 7d0d1cc38..d3500b42b 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index 69cdb4762..bc98ba94a 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/logo/FONT-LICENSE.txt b/logo/FONT-LICENSE.txt index 18ac0379f..69c49d84c 100644 --- a/logo/FONT-LICENSE.txt +++ b/logo/FONT-LICENSE.txt @@ -1,4 +1,4 @@ -The font used for the Micro Python logo is "Exo", +The font used for the MicroPython logo is "Exo", http://www.google.com/fonts/specimen/Exo. Copyright (c) 2013, Natanael Gama (https://plus.google.com/u/0/+NatanaelGama), diff --git a/minimal/mpconfigport.h b/minimal/mpconfigport.h index 47fc98429..ce4f8f240 100644 --- a/minimal/mpconfigport.h +++ b/minimal/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built // You can disable the built-in MicroPython compiler by setting the following // config option to 0. If you do this then you won't get a REPL prompt, but you diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile index c04adaf6a..cdec130ee 100644 --- a/mpy-cross/Makefile +++ b/mpy-cross/Makefile @@ -44,7 +44,7 @@ COPT = -Os #-DNDEBUG endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. -# The unix port of micropython on OSX must be compiled with clang, +# The unix port of MicroPython on OSX must be compiled with clang, # while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) diff --git a/pic16bit/board.c b/pic16bit/board.c index 77f059fc7..0321b0ee2 100644 --- a/pic16bit/board.c +++ b/pic16bit/board.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/board.h b/pic16bit/board.h index f79dd3497..f45f87544 100644 --- a/pic16bit/board.h +++ b/pic16bit/board.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/main.c b/pic16bit/main.c index 343fe86d0..4a61c5ff5 100644 --- a/pic16bit/main.c +++ b/pic16bit/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpyb.c b/pic16bit/modpyb.c index 326d37f8a..4a608541e 100644 --- a/pic16bit/modpyb.c +++ b/pic16bit/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpyb.h b/pic16bit/modpyb.h index 910ec1b6e..ac19fd2f3 100644 --- a/pic16bit/modpyb.h +++ b/pic16bit/modpyb.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpybled.c b/pic16bit/modpybled.c index 797246d13..eb04689aa 100644 --- a/pic16bit/modpybled.c +++ b/pic16bit/modpybled.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpybswitch.c b/pic16bit/modpybswitch.c index aa102e821..4af0c9dfc 100644 --- a/pic16bit/modpybswitch.c +++ b/pic16bit/modpybswitch.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/mpconfigport.h b/pic16bit/mpconfigport.h index e4113956b..3cd099c67 100644 --- a/pic16bit/mpconfigport.h +++ b/pic16bit/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/pic16bit_mphal.c b/pic16bit/pic16bit_mphal.c index 557b1e0da..35955f2d3 100644 --- a/pic16bit/pic16bit_mphal.c +++ b/pic16bit/pic16bit_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/pic16bit_mphal.h b/pic16bit/pic16bit_mphal.h index ffcca41bf..f5da6cdc8 100644 --- a/pic16bit/pic16bit_mphal.h +++ b/pic16bit/pic16bit_mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/argcheck.c b/py/argcheck.c index 9f225345d..22fd9cd2c 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmarm.c b/py/asmarm.c index ff22aba90..552fdfb34 100644 --- a/py/asmarm.c +++ b/py/asmarm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmarm.h b/py/asmarm.h index c5900925f..a302b1590 100644 --- a/py/asmarm.h +++ b/py/asmarm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmthumb.c b/py/asmthumb.c index 7e92e4de4..4360a6af9 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmthumb.h b/py/asmthumb.h index 589c481cd..7070e03ac 100644 --- a/py/asmthumb.h +++ b/py/asmthumb.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx64.c b/py/asmx64.c index 6775e8e93..aa2a8ec7c 100644 --- a/py/asmx64.c +++ b/py/asmx64.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx64.h b/py/asmx64.h index a384cca00..425bdf2d3 100644 --- a/py/asmx64.h +++ b/py/asmx64.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx86.c b/py/asmx86.c index dd3ad0224..6a78fbd5e 100644 --- a/py/asmx86.c +++ b/py/asmx86.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx86.h b/py/asmx86.h index fd34228d1..0a00e2e7c 100644 --- a/py/asmx86.h +++ b/py/asmx86.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/bc.c b/py/bc.c index 2e481bce7..522eb0aeb 100644 --- a/py/bc.c +++ b/py/bc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/bc.h b/py/bc.h index c55d31fe4..69e213e42 100644 --- a/py/bc.h +++ b/py/bc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/bc0.h b/py/bc0.h index be8ac6c15..f671c5b5a 100644 --- a/py/bc0.h +++ b/py/bc0.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -26,7 +26,7 @@ #ifndef MICROPY_INCLUDED_PY_BC0_H #define MICROPY_INCLUDED_PY_BC0_H -// Micro Python byte-codes. +// MicroPython byte-codes. // The comment at the end of the line (if it exists) tells the arguments to the byte-code. #define MP_BC_LOAD_CONST_FALSE (0x10) diff --git a/py/binary.c b/py/binary.c index 4a999b9aa..e38aae8ea 100644 --- a/py/binary.c +++ b/py/binary.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/binary.h b/py/binary.h index 04cc6d83b..7b5c60f1a 100644 --- a/py/binary.h +++ b/py/binary.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/builtin.h b/py/builtin.h index 4915383f2..a637b6e22 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/builtinevex.c b/py/builtinevex.c index 4390d0cc7..ba8048f70 100644 --- a/py/builtinevex.c +++ b/py/builtinevex.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/builtinimport.c b/py/builtinimport.c index 7a8474cac..e0ce91d9b 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/compile.c b/py/compile.c index d2e05d0b2..00052e190 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -569,7 +569,7 @@ STATIC void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int for (int j = 0; j < this_scope->id_info_len; j++) { id_info_t *id2 = &this_scope->id_info[j]; if (id2->kind == ID_INFO_KIND_FREE && id->qst == id2->qst) { - // in Micro Python we load closures using LOAD_FAST + // in MicroPython we load closures using LOAD_FAST EMIT_LOAD_FAST(id->qst, id->local_num); nfree += 1; } @@ -654,9 +654,9 @@ STATIC void compile_funcdef_lambdef_param(compiler_t *comp, mp_parse_node_t pn) if (comp->have_star) { comp->num_dict_params += 1; - // in Micro Python we put the default dict parameters into a dictionary using the bytecode + // in MicroPython we put the default dict parameters into a dictionary using the bytecode if (comp->num_dict_params == 1) { - // in Micro Python we put the default positional parameters into a tuple using the bytecode + // in MicroPython we put the default positional parameters into a tuple using the bytecode // we need to do this here before we start building the map for the default keywords if (comp->num_default_params > 0) { EMIT_ARG(build_tuple, comp->num_default_params); @@ -700,7 +700,7 @@ STATIC void compile_funcdef_lambdef(compiler_t *comp, scope_t *scope, mp_parse_n return; } - // in Micro Python we put the default positional parameters into a tuple using the bytecode + // in MicroPython we put the default positional parameters into a tuple using the bytecode // the default keywords args may have already made the tuple; if not, do it now if (comp->num_default_params > 0 && comp->num_dict_params == 0) { EMIT_ARG(build_tuple, comp->num_default_params); @@ -3275,7 +3275,7 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind #endif STATIC void scope_compute_things(scope_t *scope) { - // in Micro Python we put the *x parameter after all other parameters (except **y) + // in MicroPython we put the *x parameter after all other parameters (except **y) if (scope->scope_flags & MP_SCOPE_FLAG_VARARGS) { id_info_t *id_param = NULL; for (int i = scope->id_info_len - 1; i >= 0; i--) { @@ -3313,7 +3313,7 @@ STATIC void scope_compute_things(scope_t *scope) { // compute the index of cell vars for (int i = 0; i < scope->id_info_len; i++) { id_info_t *id = &scope->id_info[i]; - // in Micro Python the cells come right after the fast locals + // in MicroPython the cells come right after the fast locals // parameters are not counted here, since they remain at the start // of the locals, even if they are cell vars if (id->kind == ID_INFO_KIND_CELL && !(id->flags & ID_FLAG_IS_PARAM)) { @@ -3333,14 +3333,14 @@ STATIC void scope_compute_things(scope_t *scope) { id_info_t *id2 = &scope->id_info[j]; if (id2->kind == ID_INFO_KIND_FREE && id->qst == id2->qst) { assert(!(id2->flags & ID_FLAG_IS_PARAM)); // free vars should not be params - // in Micro Python the frees come first, before the params + // in MicroPython the frees come first, before the params id2->local_num = num_free; num_free += 1; } } } } - // in Micro Python shift all other locals after the free locals + // in MicroPython shift all other locals after the free locals if (num_free > 0) { for (int i = 0; i < scope->id_info_len; i++) { id_info_t *id = &scope->id_info[i]; diff --git a/py/compile.h b/py/compile.h index f6b262d18..3297e83ae 100644 --- a/py/compile.h +++ b/py/compile.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emit.h b/py/emit.h index a58e20e3d..2b2c904f6 100644 --- a/py/emit.h +++ b/py/emit.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitbc.c b/py/emitbc.c index 127bf0bf9..677020925 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitcommon.c b/py/emitcommon.c index e914431d3..07b1dbb4c 100644 --- a/py/emitcommon.c +++ b/py/emitcommon.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitglue.c b/py/emitglue.c index fb7a54926..383e6a136 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitglue.h b/py/emitglue.h index 309996596..43930333d 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c index c1a4eac5d..577f65672 100644 --- a/py/emitinlinethumb.c +++ b/py/emitinlinethumb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitnative.c b/py/emitnative.c index 99adc809c..5ed69ff9b 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/formatfloat.c b/py/formatfloat.c index 2f10d425a..4130e8b26 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/formatfloat.h b/py/formatfloat.h index 9c8d137bb..9a1643b4d 100644 --- a/py/formatfloat.h +++ b/py/formatfloat.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/frozenmod.c b/py/frozenmod.c index 1eaaf574a..06d4f84c8 100644 --- a/py/frozenmod.c +++ b/py/frozenmod.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/frozenmod.h b/py/frozenmod.h index 6993167ac..8cddef681 100644 --- a/py/frozenmod.h +++ b/py/frozenmod.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/gc.c b/py/gc.c index 2af886c56..7253b7db6 100644 --- a/py/gc.c +++ b/py/gc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/gc.h b/py/gc.h index 136695517..739349c1f 100644 --- a/py/gc.h +++ b/py/gc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/grammar.h b/py/grammar.h index 0b70538d4..6abb1de8c 100644 --- a/py/grammar.h +++ b/py/grammar.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -32,7 +32,7 @@ // # single_input is a single interactive statement; // # file_input is a module or sequence of commands read from an input file; // # eval_input is the input for the eval() functions. -// # NB: compound_stmt in single_input is followed by extra NEWLINE! --> not in Micro Python +// # NB: compound_stmt in single_input is followed by extra NEWLINE! --> not in MicroPython // single_input: NEWLINE | simple_stmt | compound_stmt // file_input: (NEWLINE | stmt)* ENDMARKER // eval_input: testlist NEWLINE* ENDMARKER diff --git a/py/lexer.c b/py/lexer.c index 6e5cc18f4..32b3567cc 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/lexer.h b/py/lexer.h index 435aa096b..a29709107 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -32,7 +32,7 @@ #include "py/qstr.h" #include "py/reader.h" -/* lexer.h -- simple tokeniser for Micro Python +/* lexer.h -- simple tokeniser for MicroPython * * Uses (byte) length instead of null termination. * Tokens are the same - UTF-8 with (byte) length. diff --git a/py/malloc.c b/py/malloc.c index f48cb8da4..e679e2092 100644 --- a/py/malloc.c +++ b/py/malloc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -46,7 +46,7 @@ #include "py/gc.h" // We redirect standard alloc functions to GC heap - just for the rest of -// this module. In the rest of micropython source, system malloc can be +// this module. In the rest of MicroPython source, system malloc can be // freely accessed - for interfacing with system and 3rd-party libs for // example. On the other hand, some (e.g. bare-metal) ports may use GC // heap as system heap, so, to avoid warnings, we do undef's first. diff --git a/py/map.c b/py/map.c index 50d74f38f..7f3c90059 100644 --- a/py/map.c +++ b/py/map.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/misc.h b/py/misc.h index cebbd38ea..71425b85e 100644 --- a/py/misc.h +++ b/py/misc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mkrules.mk b/py/mkrules.mk index e66082001..860074caa 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -47,7 +47,7 @@ $(BUILD)/%.o: %.c $(call compile_c) # List all native flags since the current build system doesn't have -# the micropython configuration available. However, these flags are +# the MicroPython configuration available. However, these flags are # needed to extract all qstrings QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB -DN_ARM -DN_XTENSA QSTR_GEN_EXTRA_CFLAGS += -I$(BUILD)/tmp diff --git a/py/modarray.c b/py/modarray.c index 356e48bee..c0cdca928 100644 --- a/py/modarray.c +++ b/py/modarray.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 8fbf4daeb..1711ae58b 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modcmath.c b/py/modcmath.c index 7ad8f5ad6..627a2cbad 100644 --- a/py/modcmath.c +++ b/py/modcmath.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modcollections.c b/py/modcollections.c index e610a28d2..1a1560387 100644 --- a/py/modcollections.c +++ b/py/modcollections.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modgc.c b/py/modgc.c index 24564622e..d45e007eb 100644 --- a/py/modgc.c +++ b/py/modgc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modio.c b/py/modio.c index a6a093278..353a00286 100644 --- a/py/modio.c +++ b/py/modio.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modmath.c b/py/modmath.c index d5d135fc1..c56056a5d 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modmicropython.c b/py/modmicropython.c index 46a3922e6..6fa3f9ad2 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modstruct.c b/py/modstruct.c index 3c99ef1d8..1daa33338 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modsys.c b/py/modsys.c index 0a8f3cd50..ee6f8686e 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -87,7 +87,7 @@ STATIC const mp_rom_obj_tuple_t mp_sys_implementation_obj = { #undef I #ifdef MICROPY_PY_SYS_PLATFORM -/// \constant platform - the platform that Micro Python is running on +/// \constant platform - the platform that MicroPython is running on STATIC const MP_DEFINE_STR_OBJ(platform_obj, MICROPY_PY_SYS_PLATFORM); #endif diff --git a/py/mphal.h b/py/mphal.h index 93a0a40ce..92de01d08 100644 --- a/py/mphal.h +++ b/py/mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpprint.c b/py/mpprint.c index 0afd8ca3b..6c02d7cef 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpprint.h b/py/mpprint.h index 20bd875b4..07462bddc 100644 --- a/py/mpprint.h +++ b/py/mpprint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpstate.c b/py/mpstate.c index 4fc8bc506..6ce64adfd 100644 --- a/py/mpstate.c +++ b/py/mpstate.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpstate.h b/py/mpstate.h index b09ba08cf..eca14a9e4 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -36,7 +36,7 @@ #include "py/objlist.h" #include "py/objexcept.h" -// This file contains structures defining the state of the Micro Python +// This file contains structures defining the state of the MicroPython // memory system, runtime and virtual machine. The state is a global // variable, but in the future it is hoped that the state can become local. diff --git a/py/mpz.c b/py/mpz.c index f58e262e2..d300a8e5d 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpz.h b/py/mpz.h index 55967cc4c..e2d0c30aa 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/nativeglue.c b/py/nativeglue.c index c75e5ec04..46c6906d9 100644 --- a/py/nativeglue.c +++ b/py/nativeglue.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -42,7 +42,7 @@ #if MICROPY_EMIT_NATIVE -// convert a Micro Python object to a valid native value based on type +// convert a MicroPython object to a valid native value based on type mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) { DEBUG_printf("mp_convert_obj_to_native(%p, " UINT_FMT ")\n", obj, type); switch (type & 0xf) { @@ -66,7 +66,7 @@ mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) { #if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM -// convert a native value to a Micro Python object based on type +// convert a native value to a MicroPython object based on type mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type) { DEBUG_printf("mp_convert_native_to_obj(" UINT_FMT ", " UINT_FMT ")\n", val, type); switch (type & 0xf) { diff --git a/py/nlr.h b/py/nlr.h index 624e97307..63fe392d9 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/nlrsetjmp.c b/py/nlrsetjmp.c index c3873e0b6..1fb459440 100644 --- a/py/nlrsetjmp.c +++ b/py/nlrsetjmp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/obj.c b/py/obj.c index 1238b7011..515a95b2e 100644 --- a/py/obj.c +++ b/py/obj.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/obj.h b/py/obj.h index f88c10004..22bfda0f9 100644 --- a/py/obj.h +++ b/py/obj.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objarray.c b/py/objarray.c index 21479a800..99146bd4c 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objattrtuple.c b/py/objattrtuple.c index 8c5e79575..3cc298d4e 100644 --- a/py/objattrtuple.c +++ b/py/objattrtuple.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objbool.c b/py/objbool.c index 5bc04bb6f..e5bc3c228 100644 --- a/py/objbool.c +++ b/py/objbool.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objboundmeth.c b/py/objboundmeth.c index 57be6a6cf..890f8b15b 100644 --- a/py/objboundmeth.c +++ b/py/objboundmeth.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objcell.c b/py/objcell.c index 06a88b954..111906412 100644 --- a/py/objcell.c +++ b/py/objcell.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objclosure.c b/py/objclosure.c index 3e12358bb..4eb9eb8b8 100644 --- a/py/objclosure.c +++ b/py/objclosure.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objcomplex.c b/py/objcomplex.c index e4fbed1e8..f945f3560 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objdict.c b/py/objdict.c index 23d3008b8..a272ebdb6 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objenumerate.c b/py/objenumerate.c index faae6516c..1a9d30f83 100644 --- a/py/objenumerate.c +++ b/py/objenumerate.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objexcept.c b/py/objexcept.c index 4722aca91..a9fe04094 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objexcept.h b/py/objexcept.h index 2232e1e21..f67651a7e 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objfilter.c b/py/objfilter.c index a655b8a78..cb965d8c3 100644 --- a/py/objfilter.c +++ b/py/objfilter.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objfloat.c b/py/objfloat.c index d0e616612..15edd810f 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objfun.c b/py/objfun.c index 9f3589124..eaba13129 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -480,7 +480,7 @@ typedef mp_uint_t (*inline_asm_fun_2_t)(mp_uint_t, mp_uint_t); typedef mp_uint_t (*inline_asm_fun_3_t)(mp_uint_t, mp_uint_t, mp_uint_t); typedef mp_uint_t (*inline_asm_fun_4_t)(mp_uint_t, mp_uint_t, mp_uint_t, mp_uint_t); -// convert a Micro Python object to a sensible value for inline asm +// convert a MicroPython object to a sensible value for inline asm STATIC mp_uint_t convert_obj_for_inline_asm(mp_obj_t obj) { // TODO for byte_array, pass pointer to the array if (MP_OBJ_IS_SMALL_INT(obj)) { diff --git a/py/objfun.h b/py/objfun.h index 450c98f76..fbb351626 100644 --- a/py/objfun.h +++ b/py/objfun.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objgenerator.c b/py/objgenerator.c index 9d6e636b3..2f39f3a52 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objgenerator.h b/py/objgenerator.h index d61332a20..80bf9cd86 100644 --- a/py/objgenerator.h +++ b/py/objgenerator.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objgetitemiter.c b/py/objgetitemiter.c index a3c754448..afd6fb22b 100644 --- a/py/objgetitemiter.c +++ b/py/objgetitemiter.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint.c b/py/objint.c index 2749ec51c..29d889629 100644 --- a/py/objint.c +++ b/py/objint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint.h b/py/objint.h index f341306ed..394c23714 100644 --- a/py/objint.h +++ b/py/objint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 1d184a7dc..02c005d2f 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint_mpz.c b/py/objint_mpz.c index 26492aab4..0791a8af2 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objlist.c b/py/objlist.c index 45e69c8bc..ba1c50677 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objlist.h b/py/objlist.h index 740ba9fda..28b5495a9 100644 --- a/py/objlist.h +++ b/py/objlist.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objmap.c b/py/objmap.c index 111c964fd..908c61507 100644 --- a/py/objmap.c +++ b/py/objmap.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objmodule.c b/py/objmodule.c index 43bb36b98..fc8507c27 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objmodule.h b/py/objmodule.h index 5bfbe51d5..b5c07dc33 100644 --- a/py/objmodule.h +++ b/py/objmodule.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 7ec5c2f41..fb9d9f02c 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objnone.c b/py/objnone.c index 5d5b83540..cd7319bec 100644 --- a/py/objnone.c +++ b/py/objnone.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objobject.c b/py/objobject.c index f9a7d17c3..49d2ec62e 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objproperty.c b/py/objproperty.c index 8189935d2..0934fad05 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objrange.c b/py/objrange.c index 8c4e14f49..33b07a9d4 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objreversed.c b/py/objreversed.c index fc85e72bf..a596a2fde 100644 --- a/py/objreversed.c +++ b/py/objreversed.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objset.c b/py/objset.c index f74bc74a0..376439b73 100644 --- a/py/objset.c +++ b/py/objset.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objsingleton.c b/py/objsingleton.c index 394c12767..ea72ae38c 100644 --- a/py/objsingleton.c +++ b/py/objsingleton.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objslice.c b/py/objslice.c index 928be6dab..358c44d06 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstr.c b/py/objstr.c index cea10770c..ddad7d3bd 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstr.h b/py/objstr.h index 6fbed405a..3aef8c68e 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstringio.c b/py/objstringio.c index 645c441cb..046d32580 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstrunicode.c b/py/objstrunicode.c index d53428586..0cf791ff7 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objtuple.c b/py/objtuple.c index eaf0e37f4..0b05755fb 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objtuple.h b/py/objtuple.h index 686702395..05c6490fe 100644 --- a/py/objtuple.h +++ b/py/objtuple.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objtype.c b/py/objtype.c index 0c0826cf9..a258915f3 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -917,8 +917,8 @@ const mp_obj_type_t mp_type_type = { }; mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict) { - assert(MP_OBJ_IS_TYPE(bases_tuple, &mp_type_tuple)); // Micro Python restriction, for now - assert(MP_OBJ_IS_TYPE(locals_dict, &mp_type_dict)); // Micro Python restriction, for now + assert(MP_OBJ_IS_TYPE(bases_tuple, &mp_type_tuple)); // MicroPython restriction, for now + assert(MP_OBJ_IS_TYPE(locals_dict, &mp_type_dict)); // MicroPython restriction, for now // TODO might need to make a copy of locals_dict; at least that's how CPython does it diff --git a/py/objtype.h b/py/objtype.h index 104b20aab..52419f3cd 100644 --- a/py/objtype.h +++ b/py/objtype.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objzip.c b/py/objzip.c index 6f72d1595..0183925e3 100644 --- a/py/objzip.c +++ b/py/objzip.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/opmethods.c b/py/opmethods.c index 80a953fb8..1200ba39e 100644 --- a/py/opmethods.c +++ b/py/opmethods.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parse.c b/py/parse.c index 2f16748a6..e399aac53 100644 --- a/py/parse.c +++ b/py/parse.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parse.h b/py/parse.h index fec18825b..9a1a2b4dd 100644 --- a/py/parse.h +++ b/py/parse.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenum.c b/py/parsenum.c index 177118843..b62029f7c 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenum.h b/py/parsenum.h index 77fd0f4a5..a5bed731d 100644 --- a/py/parsenum.h +++ b/py/parsenum.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenumbase.c b/py/parsenumbase.c index 73a3372f0..ba1059122 100644 --- a/py/parsenumbase.c +++ b/py/parsenumbase.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenumbase.h b/py/parsenumbase.h index 143796df4..3a525f993 100644 --- a/py/parsenumbase.h +++ b/py/parsenumbase.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/qstr.c b/py/qstr.c index 5aa161064..fdb38f1de 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/qstr.h b/py/qstr.h index 4116eb81d..e2bdcc351 100644 --- a/py/qstr.h +++ b/py/qstr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 4581e5e1b..9375b9101 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/repl.c b/py/repl.c index 8e55eb017..7e8922e19 100644 --- a/py/repl.c +++ b/py/repl.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/repl.h b/py/repl.h index c2499a270..a7a4136ca 100644 --- a/py/repl.h +++ b/py/repl.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/runtime.c b/py/runtime.c index ecc3ae2f5..6a0db007e 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -1038,7 +1038,7 @@ void mp_load_method_maybe(mp_obj_t obj, qstr attr, mp_obj_t *dest) { } else if (type->locals_dict != NULL) { // generic method lookup // this is a lookup in the object (ie not class or type) - assert(type->locals_dict->base.type == &mp_type_dict); // Micro Python restriction, for now + assert(type->locals_dict->base.type == &mp_type_dict); // MicroPython restriction, for now mp_map_t *locals_map = &type->locals_dict->map; mp_map_elem_t *elem = mp_map_lookup(locals_map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP); if (elem != NULL) { diff --git a/py/runtime.h b/py/runtime.h index 0add564cc..fe492885b 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/runtime0.h b/py/runtime0.h index 060ee8c0a..d22c2fabe 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/runtime_utils.c b/py/runtime_utils.c index e0495495a..56a918064 100644 --- a/py/runtime_utils.c +++ b/py/runtime_utils.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/scope.c b/py/scope.c index 8fe6f960a..1a6ae7b8a 100644 --- a/py/scope.c +++ b/py/scope.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/scope.h b/py/scope.h index 4d0c1b1d9..e3b6a57c7 100644 --- a/py/scope.h +++ b/py/scope.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/sequence.c b/py/sequence.c index 32db640dc..0752ee109 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/showbc.c b/py/showbc.c index 0bccf8427..bb2b084ed 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/smallint.c b/py/smallint.c index 4c42ee0cc..aa542ca7b 100644 --- a/py/smallint.c +++ b/py/smallint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/smallint.h b/py/smallint.h index b2bfc6df9..42679a78f 100644 --- a/py/smallint.h +++ b/py/smallint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stackctrl.c b/py/stackctrl.c index 1843e7339..0bcd82f4f 100644 --- a/py/stackctrl.c +++ b/py/stackctrl.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stackctrl.h b/py/stackctrl.h index 84c0e1427..ff8da0ab1 100644 --- a/py/stackctrl.h +++ b/py/stackctrl.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stream.c b/py/stream.c index 018609903..5d1868153 100644 --- a/py/stream.c +++ b/py/stream.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stream.h b/py/stream.h index 0b5fd7cc0..401ae313c 100644 --- a/py/stream.h +++ b/py/stream.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/unicode.c b/py/unicode.c index c6f872038..eddb007d5 100644 --- a/py/unicode.c +++ b/py/unicode.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/unicode.h b/py/unicode.h index f99c9705d..19487a65a 100644 --- a/py/unicode.h +++ b/py/unicode.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/vm.c b/py/vm.c index bb120e775..c7fc83d04 100644 --- a/py/vm.c +++ b/py/vm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/vmentrytable.h b/py/vmentrytable.h index dd9789e34..352a6dc31 100644 --- a/py/vmentrytable.h +++ b/py/vmentrytable.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/vstr.c b/py/vstr.c index f41bd2e23..8a00f6c6f 100644 --- a/py/vstr.c +++ b/py/vstr.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/warning.c b/py/warning.c index 4cdf3b3f1..46b31ecca 100644 --- a/py/warning.c +++ b/py/warning.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/qemu-arm/mpconfigport.h b/qemu-arm/mpconfigport.h index ebec027e8..87e537af7 100644 --- a/qemu-arm/mpconfigport.h +++ b/qemu-arm/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (512) #define MICROPY_EMIT_X64 (0) diff --git a/stmhal/accel.c b/stmhal/accel.c index 0e6eaf03d..512a6e313 100644 --- a/stmhal/accel.c +++ b/stmhal/accel.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -102,7 +102,7 @@ STATIC void accel_start(void) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ #define NUM_AXIS (3) #define FILT_DEPTH (4) diff --git a/stmhal/accel.h b/stmhal/accel.h index 42b156329..fc35f7775 100644 --- a/stmhal/accel.h +++ b/stmhal/accel.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/adc.c b/stmhal/adc.c index 6485e2ab7..dd59e29c8 100644 --- a/stmhal/adc.c +++ b/stmhal/adc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -263,7 +263,7 @@ STATIC uint32_t adc_read_channel(ADC_HandleTypeDef *adcHandle) { } /******************************************************************************/ -/* Micro Python bindings : adc object (single channel) */ +/* MicroPython bindings : adc object (single channel) */ STATIC void adc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_obj_adc_t *self = self_in; @@ -596,7 +596,7 @@ float adc_read_core_vref(ADC_HandleTypeDef *adcHandle) { #endif /******************************************************************************/ -/* Micro Python bindings : adc_all object */ +/* MicroPython bindings : adc_all object */ STATIC mp_obj_t adc_all_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { // check number of arguments diff --git a/stmhal/adc.h b/stmhal/adc.h index 6ec558464..c90e6b343 100644 --- a/stmhal/adc.h +++ b/stmhal/adc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/bufhelper.c b/stmhal/bufhelper.c index ca76e9496..79511969b 100644 --- a/stmhal/bufhelper.c +++ b/stmhal/bufhelper.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/bufhelper.h b/stmhal/bufhelper.h index 55f57be8e..c1967bf43 100644 --- a/stmhal/bufhelper.h +++ b/stmhal/bufhelper.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/can.c b/stmhal/can.c index 6152022b7..9047e78ca 100644 --- a/stmhal/can.c +++ b/stmhal/can.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -262,7 +262,7 @@ STATIC HAL_StatusTypeDef CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout) } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC void pyb_can_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_can_obj_t *self = self_in; diff --git a/stmhal/can.h b/stmhal/can.h index 7c40e9bf9..860012813 100644 --- a/stmhal/can.h +++ b/stmhal/can.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/dac.c b/stmhal/dac.c index 243aa08c3..cdb3a9bcd 100644 --- a/stmhal/dac.c +++ b/stmhal/dac.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -124,7 +124,7 @@ STATIC uint32_t TIMx_Config(mp_obj_t timer) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings typedef enum { DAC_STATE_RESET, diff --git a/stmhal/dac.h b/stmhal/dac.h index 93192c0fe..f487f52a9 100644 --- a/stmhal/dac.h +++ b/stmhal/dac.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/dma.c b/stmhal/dma.c index e43b67e73..df6275d65 100644 --- a/stmhal/dma.c +++ b/stmhal/dma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/dma.h b/stmhal/dma.h index d8b11ca3a..55fb62175 100644 --- a/stmhal/dma.h +++ b/stmhal/dma.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/extint.c b/stmhal/extint.c index 70023557f..24a68c2a2 100644 --- a/stmhal/extint.c +++ b/stmhal/extint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/extint.h b/stmhal/extint.h index 0eae8942c..846790b9b 100644 --- a/stmhal/extint.h +++ b/stmhal/extint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/flash.c b/stmhal/flash.c index e374be0e5..bebb3a161 100644 --- a/stmhal/flash.c +++ b/stmhal/flash.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/flash.h b/stmhal/flash.h index c5b5bf352..688e70a3c 100644 --- a/stmhal/flash.h +++ b/stmhal/flash.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/font_petme128_8x8.h b/stmhal/font_petme128_8x8.h index f27277760..8b0cc9cb0 100644 --- a/stmhal/font_petme128_8x8.h +++ b/stmhal/font_petme128_8x8.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/gccollect.c b/stmhal/gccollect.c index d7223dedc..937fb6f36 100644 --- a/stmhal/gccollect.c +++ b/stmhal/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/gccollect.h b/stmhal/gccollect.h index 2cb32a8d4..1b64a51a6 100644 --- a/stmhal/gccollect.h +++ b/stmhal/gccollect.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h b/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h index b890c3d98..52ca6406b 100644 --- a/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h +++ b/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h @@ -1370,7 +1370,7 @@ void UART_AdvFeatureConfig(UART_HandleTypeDef *huart); /** * @} */ -/* Functions added by micropython */ +/* Functions added by MicroPython */ uint32_t HAL_UART_CalcBrr(uint32_t fck, uint32_t baud); #ifdef __cplusplus diff --git a/stmhal/hal/l4/src/stm32l4xx_hal_uart.c b/stmhal/hal/l4/src/stm32l4xx_hal_uart.c index 2b0d76d30..adb3d79ab 100644 --- a/stmhal/hal/l4/src/stm32l4xx_hal_uart.c +++ b/stmhal/hal/l4/src/stm32l4xx_hal_uart.c @@ -2104,7 +2104,7 @@ static HAL_StatusTypeDef UART_Receive_IT(UART_HandleTypeDef *huart) /** * @brief Calculate register BRR value without using uint64. - * @note This function is added by the micropython project. + * @note This function is added by the MicroPython project. * @param fck: Input clock frequency to the uart block in Hz. * @param baud: baud rate should be one of {300, 600, 1200, 2400, 4800, 9600, 19200, 57600, 115200}. * @retval BRR value diff --git a/stmhal/help.c b/stmhal/help.c index 83ef7e596..87b2af526 100644 --- a/stmhal/help.c +++ b/stmhal/help.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/i2c.c b/stmhal/i2c.c index f77222715..f102fd0f2 100644 --- a/stmhal/i2c.c +++ b/stmhal/i2c.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -511,7 +511,7 @@ STATIC HAL_StatusTypeDef i2c_wait_dma_finished(I2C_HandleTypeDef *i2c, uint32_t } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; } diff --git a/stmhal/i2c.h b/stmhal/i2c.h index eda076e82..6affe3973 100644 --- a/stmhal/i2c.h +++ b/stmhal/i2c.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/irq.c b/stmhal/irq.c index 44758e11b..d6db8e83d 100644 --- a/stmhal/irq.c +++ b/stmhal/irq.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/irq.h b/stmhal/irq.h index 8d44b50ed..2cf58639e 100644 --- a/stmhal/irq.h +++ b/stmhal/irq.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/lcd.c b/stmhal/lcd.c index cdf9fa0d1..7368193cf 100644 --- a/stmhal/lcd.c +++ b/stmhal/lcd.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/lcd.h b/stmhal/lcd.h index be4f6ed25..c0d9bd97d 100644 --- a/stmhal/lcd.h +++ b/stmhal/lcd.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/led.c b/stmhal/led.c index 4b9895fc5..030a814dd 100644 --- a/stmhal/led.c +++ b/stmhal/led.c @@ -279,7 +279,7 @@ void led_debug(int n, int delay) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ void led_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_led_obj_t *self = self_in; diff --git a/stmhal/led.h b/stmhal/led.h index fc9348181..f1b05d1e2 100644 --- a/stmhal/led.h +++ b/stmhal/led.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/main.c b/stmhal/main.c index 566c2db07..056c590cd 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -511,7 +511,7 @@ int main(void) { // GC init gc_init(&_heap_start, &_heap_end); - // Micro Python init + // MicroPython init mp_init(); mp_obj_list_init(mp_sys_path, 0); mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script) diff --git a/stmhal/modnetwork.c b/stmhal/modnetwork.c index 09a80ef3c..6b4949a0d 100644 --- a/stmhal/modnetwork.c +++ b/stmhal/modnetwork.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modnetwork.h b/stmhal/modnetwork.h index 83e4255d5..ecda94da4 100644 --- a/stmhal/modnetwork.h +++ b/stmhal/modnetwork.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modnwcc3k.c b/stmhal/modnwcc3k.c index 957d74e6e..a04a2d260 100644 --- a/stmhal/modnwcc3k.c +++ b/stmhal/modnwcc3k.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -412,7 +412,7 @@ STATIC int cc3k_socket_ioctl(mod_network_socket_obj_t *socket, mp_uint_t request } /******************************************************************************/ -// Micro Python bindings; CC3K class +// MicroPython bindings; CC3K class typedef struct _cc3k_obj_t { mp_obj_base_t base; diff --git a/stmhal/modnwwiznet5k.c b/stmhal/modnwwiznet5k.c index 4752cdc0b..eb7eb8443 100644 --- a/stmhal/modnwwiznet5k.c +++ b/stmhal/modnwwiznet5k.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -314,7 +314,7 @@ STATIC mp_obj_t wiznet5k_socket_disconnect(mp_obj_t self_in) { #endif /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings /// \classmethod \constructor(spi, pin_cs, pin_rst) /// Create and return a WIZNET5K object. diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c index 7322c6a5b..5dc28e132 100644 --- a/stmhal/modpyb.c +++ b/stmhal/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modstm.c b/stmhal/modstm.c index eabbf08e4..2084c0aa0 100644 --- a/stmhal/modstm.c +++ b/stmhal/modstm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/moduos.c b/stmhal/moduos.c index ece6019fb..77a60c0cb 100644 --- a/stmhal/moduos.c +++ b/stmhal/moduos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modusocket.c b/stmhal/modusocket.c index 081a322ae..e1da53a4b 100644 --- a/stmhal/modusocket.c +++ b/stmhal/modusocket.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modutime.c b/stmhal/modutime.c index 58c43a55e..fe13f80c0 100644 --- a/stmhal/modutime.c +++ b/stmhal/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pendsv.c b/stmhal/pendsv.c index 7b3906f25..00ea12f46 100644 --- a/stmhal/pendsv.c +++ b/stmhal/pendsv.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pendsv.h b/stmhal/pendsv.h index b64e61386..6a9eb0d79 100644 --- a/stmhal/pendsv.h +++ b/stmhal/pendsv.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin.c b/stmhal/pin.c index f30474e1f..0dce0c1c0 100644 --- a/stmhal/pin.c +++ b/stmhal/pin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin.h b/stmhal/pin.h index 1ec4bd6b8..90de79e5c 100644 --- a/stmhal/pin.h +++ b/stmhal/pin.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin_defs_stmhal.h b/stmhal/pin_defs_stmhal.h index d6a2ef424..6cf3b1b83 100644 --- a/stmhal/pin_defs_stmhal.h +++ b/stmhal/pin_defs_stmhal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin_named_pins.c b/stmhal/pin_named_pins.c index fac19ee97..726da54dd 100644 --- a/stmhal/pin_named_pins.c +++ b/stmhal/pin_named_pins.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/portmodules.h b/stmhal/portmodules.h index 4e892da96..b575109b8 100644 --- a/stmhal/portmodules.h +++ b/stmhal/portmodules.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/qstrdefsport.h b/stmhal/qstrdefsport.h index 1d83f43bd..31220c5a4 100644 --- a/stmhal/qstrdefsport.h +++ b/stmhal/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/rng.c b/stmhal/rng.c index a5a9874d1..c0c5e9aeb 100644 --- a/stmhal/rng.c +++ b/stmhal/rng.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/rng.h b/stmhal/rng.h index f022f3a67..43e49fe72 100644 --- a/stmhal/rng.h +++ b/stmhal/rng.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/rtc.c b/stmhal/rtc.c index 755684570..4efc56d5c 100644 --- a/stmhal/rtc.c +++ b/stmhal/rtc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -412,7 +412,7 @@ STATIC void RTC_CalendarConfig(void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings typedef struct _pyb_rtc_obj_t { mp_obj_base_t base; diff --git a/stmhal/rtc.h b/stmhal/rtc.h index f382fa6b6..09ab2aedf 100644 --- a/stmhal/rtc.h +++ b/stmhal/rtc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c index 5260e0a50..dfa7158a4 100644 --- a/stmhal/sdcard.c +++ b/stmhal/sdcard.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -356,7 +356,7 @@ mp_uint_t sdcard_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t n } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings // // Expose the SD card as an object with the block protocol. diff --git a/stmhal/sdcard.h b/stmhal/sdcard.h index d595f0f1a..8c698fc2f 100644 --- a/stmhal/sdcard.h +++ b/stmhal/sdcard.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/servo.c b/stmhal/servo.c index e4bcbc30e..fa39587a8 100644 --- a/stmhal/servo.c +++ b/stmhal/servo.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -147,7 +147,7 @@ STATIC void servo_init_channel(pyb_servo_obj_t *s) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC mp_obj_t pyb_servo_set(mp_obj_t port, mp_obj_t value) { int p = mp_obj_get_int(port); diff --git a/stmhal/servo.h b/stmhal/servo.h index 18fd493d5..c602a07da 100644 --- a/stmhal/servo.h +++ b/stmhal/servo.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/spi.c b/stmhal/spi.c index b710fc3a7..574fed073 100644 --- a/stmhal/spi.c +++ b/stmhal/spi.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/spi.h b/stmhal/spi.h index e6752fdd1..eda109a7e 100644 --- a/stmhal/spi.h +++ b/stmhal/spi.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/stm32_it.c b/stmhal/stm32_it.c index 357b6d79d..2111da1ae 100644 --- a/stmhal/stm32_it.c +++ b/stmhal/stm32_it.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Original template from ST Cube library. See below for header. * diff --git a/stmhal/stm32_it.h b/stmhal/stm32_it.h index d6ed1b2b9..b498dee8d 100644 --- a/stmhal/stm32_it.h +++ b/stmhal/stm32_it.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Original template from ST Cube library. See below for header. * diff --git a/stmhal/storage.c b/stmhal/storage.c index 1931cd607..6da1ba95c 100644 --- a/stmhal/storage.c +++ b/stmhal/storage.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/storage.h b/stmhal/storage.h index 0ecb5715a..291e09a9a 100644 --- a/stmhal/storage.h +++ b/stmhal/storage.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/system_stm32.c b/stmhal/system_stm32.c index a63bd3c57..7fc16b148 100644 --- a/stmhal/system_stm32.c +++ b/stmhal/system_stm32.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Taken from ST Cube library and modified. See below for original header. * diff --git a/stmhal/systick.c b/stmhal/systick.c index 4eac583e2..c07d0fabc 100644 --- a/stmhal/systick.c +++ b/stmhal/systick.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/systick.h b/stmhal/systick.h index 524afae40..c1def50c2 100644 --- a/stmhal/systick.h +++ b/stmhal/systick.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/timer.c b/stmhal/timer.c index 6513f95d3..570558775 100644 --- a/stmhal/timer.c +++ b/stmhal/timer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -247,7 +247,7 @@ uint32_t timer_get_source_freq(uint32_t tim_id) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC const mp_obj_type_t pyb_timer_channel_type; diff --git a/stmhal/timer.h b/stmhal/timer.h index 72e461f2f..775accc3d 100644 --- a/stmhal/timer.h +++ b/stmhal/timer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/uart.c b/stmhal/uart.c index b4ff40e79..ddff8b9f2 100644 --- a/stmhal/uart.c +++ b/stmhal/uart.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -509,7 +509,7 @@ void uart_irq_handler(mp_uint_t uart_id) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_uart_obj_t *self = self_in; diff --git a/stmhal/uart.h b/stmhal/uart.h index 749530954..e96b25b5f 100644 --- a/stmhal/uart.h +++ b/stmhal/uart.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usb.c b/stmhal/usb.c index f70dea142..9bf351f49 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -169,7 +169,7 @@ void usb_vcp_send_strn_cooked(const char *str, int len) { } /******************************************************************************/ -// Micro Python bindings for USB +// MicroPython bindings for USB /* Philosophy of USB driver and Python API: pyb.usb_mode(...) configures the USB @@ -324,7 +324,7 @@ STATIC mp_obj_t pyb_usb_mode(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(pyb_usb_mode_obj, 0, pyb_usb_mode); /******************************************************************************/ -// Micro Python bindings for USB VCP +// MicroPython bindings for USB VCP /// \moduleref pyb /// \class USB_VCP - USB virtual comm port @@ -525,7 +525,7 @@ const mp_obj_type_t pyb_usb_vcp_type = { }; /******************************************************************************/ -// Micro Python bindings for USB HID +// MicroPython bindings for USB HID typedef struct _pyb_usb_hid_obj_t { mp_obj_base_t base; diff --git a/stmhal/usb.h b/stmhal/usb.h index e04fe70d7..d39f49a6c 100644 --- a/stmhal/usb.h +++ b/stmhal/usb.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbd_cdc_interface.h b/stmhal/usbd_cdc_interface.h index 6f9a1e8a3..811a28928 100644 --- a/stmhal/usbd_cdc_interface.h +++ b/stmhal/usbd_cdc_interface.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ #ifndef MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H #define MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H diff --git a/stmhal/usbd_conf.c b/stmhal/usbd_conf.c index e2bd6c949..d39144851 100644 --- a/stmhal/usbd_conf.c +++ b/stmhal/usbd_conf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ /** diff --git a/stmhal/usbd_conf.h b/stmhal/usbd_conf.h index b69ba52c2..34ebe27b9 100644 --- a/stmhal/usbd_conf.h +++ b/stmhal/usbd_conf.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ /** diff --git a/stmhal/usbd_desc.c b/stmhal/usbd_desc.c index 1ad960b46..09e1608c8 100644 --- a/stmhal/usbd_desc.c +++ b/stmhal/usbd_desc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ /** diff --git a/stmhal/usbd_desc.h b/stmhal/usbd_desc.h index f48e364e1..05cbbe5b1 100644 --- a/stmhal/usbd_desc.h +++ b/stmhal/usbd_desc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbd_msc_storage.h b/stmhal/usbd_msc_storage.h index a4bc8004a..6cc40d2d6 100644 --- a/stmhal/usbd_msc_storage.h +++ b/stmhal/usbd_msc_storage.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h index ec03c860a..08882bb1a 100644 --- a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h +++ b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c index e0edf1370..d61073f4d 100644 --- a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c +++ b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c index 63cd440d4..a7721ad77 100644 --- a/stmhal/usrsw.c +++ b/stmhal/usrsw.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -63,7 +63,7 @@ int switch_get(void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings typedef struct _pyb_switch_obj_t { mp_obj_base_t base; diff --git a/stmhal/usrsw.h b/stmhal/usrsw.h index 9fbe6109d..d96e3c281 100644 --- a/stmhal/usrsw.h +++ b/stmhal/usrsw.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/hal_ftm.c b/teensy/hal_ftm.c index 28992881b..3c031bf6d 100644 --- a/teensy/hal_ftm.c +++ b/teensy/hal_ftm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/hal_ftm.h b/teensy/hal_ftm.h index ad627358b..84fae8312 100644 --- a/teensy/hal_ftm.h +++ b/teensy/hal_ftm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/help.c b/teensy/help.c index 3b3916b94..ebe4bed6b 100644 --- a/teensy/help.c +++ b/teensy/help.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/led.c b/teensy/led.c index c7ac8be1f..c043e4399 100644 --- a/teensy/led.c +++ b/teensy/led.c @@ -81,7 +81,7 @@ void led_toggle(pyb_led_t led) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ void led_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_led_obj_t *self = self_in; diff --git a/teensy/main.c b/teensy/main.c index 41bbeb5d9..3edaa28a0 100644 --- a/teensy/main.c +++ b/teensy/main.c @@ -266,7 +266,7 @@ int main(void) { // GC init gc_init(&_heap_start, (void*)HEAP_END); - // Micro Python init + // MicroPython init mp_init(); mp_obj_list_init(mp_sys_path, 0); mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script) diff --git a/teensy/modpyb.c b/teensy/modpyb.c index 9f601e327..deb1f32f9 100644 --- a/teensy/modpyb.c +++ b/teensy/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -154,7 +154,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_sync_obj, pyb_sync); /// \function millis() /// Returns the number of milliseconds since the board was last reset. /// -/// The result is always a micropython smallint (31-bit signed number), so +/// The result is always a MicroPython smallint (31-bit signed number), so /// after 2^30 milliseconds (about 12.4 days) this will start to return /// negative numbers. STATIC mp_obj_t pyb_millis(void) { @@ -185,7 +185,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_elapsed_millis_obj, pyb_elapsed_millis); /// \function micros() /// Returns the number of microseconds since the board was last reset. /// -/// The result is always a micropython smallint (31-bit signed number), so +/// The result is always a MicroPython smallint (31-bit signed number), so /// after 2^30 microseconds (about 17.8 minutes) this will start to return /// negative numbers. STATIC mp_obj_t pyb_micros(void) { diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h index de30924d9..69cd69d53 100644 --- a/teensy/mpconfigport.h +++ b/teensy/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (128) #define MICROPY_EMIT_THUMB (1) diff --git a/teensy/timer.c b/teensy/timer.c index 45bcc2b8f..bc560d85e 100644 --- a/teensy/timer.c +++ b/teensy/timer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -119,7 +119,7 @@ mp_uint_t get_prescaler_shift(mp_int_t prescaler) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC const mp_obj_type_t pyb_timer_channel_type; diff --git a/teensy/timer.h b/teensy/timer.h index 89095b076..75c2e654e 100644 --- a/teensy/timer.h +++ b/teensy/timer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/uart.c b/teensy/uart.c index b4c0a4d5b..3dd2c5051 100644 --- a/teensy/uart.c +++ b/teensy/uart.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -221,7 +221,7 @@ void uart_tx_strn_cooked(pyb_uart_obj_t *uart_obj, const char *str, uint len) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_uart_obj_t *self = self_in; diff --git a/tests/basics/bytearray_slice_assign.py b/tests/basics/bytearray_slice_assign.py index 48f5938a5..7f7d1d119 100644 --- a/tests/basics/bytearray_slice_assign.py +++ b/tests/basics/bytearray_slice_assign.py @@ -4,7 +4,7 @@ print("SKIP") raise SystemExit -# test slices; only 2 argument version supported by Micro Python at the moment +# test slices; only 2 argument version supported by MicroPython at the moment x = bytearray(range(10)) # Assignment diff --git a/tests/basics/list_slice_assign.py b/tests/basics/list_slice_assign.py index 1ad1ef27c..885615717 100644 --- a/tests/basics/list_slice_assign.py +++ b/tests/basics/list_slice_assign.py @@ -1,4 +1,4 @@ -# test slices; only 2 argument version supported by Micro Python at the moment +# test slices; only 2 argument version supported by MicroPython at the moment x = list(range(10)) # Assignment diff --git a/tests/io/stringio1.py b/tests/io/stringio1.py index fa50f282e..9f7c1e44e 100644 --- a/tests/io/stringio1.py +++ b/tests/io/stringio1.py @@ -36,7 +36,7 @@ a = io.StringIO() a.close() for f in [a.read, a.getvalue, lambda:a.write("")]: - # CPython throws for operations on closed I/O, micropython makes + # CPython throws for operations on closed I/O, MicroPython makes # the underlying string empty unless MICROPY_CPYTHON_COMPAT defined try: f() diff --git a/tests/run-bench-tests b/tests/run-bench-tests index 1e5e7804b..d48b4b7ec 100755 --- a/tests/run-bench-tests +++ b/tests/run-bench-tests @@ -26,7 +26,7 @@ def run_tests(pyb, test_dict): print(base_test + ":") for test_file in tests: - # run Micro Python + # run MicroPython if pyb is None: # run on PC try: diff --git a/tests/run-tests b/tests/run-tests index bd4a1363c..f9c26283d 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -388,7 +388,7 @@ def run_tests(pyb, tests, args, base_path="."): if args.write_exp: continue - # run Micro Python + # run MicroPython output_mupy = run_micropython(pyb, args, test_file) if output_mupy == b'SKIP\n': diff --git a/tools/gen-cpydiff.py b/tools/gen-cpydiff.py index 86ec816e9..aff5b56e7 100644 --- a/tools/gen-cpydiff.py +++ b/tools/gen-cpydiff.py @@ -33,7 +33,7 @@ import re from collections import namedtuple -# Micropython supports syntax of CPython 3.4 with some features from 3.5, and +# MicroPython supports syntax of CPython 3.4 with some features from 3.5, and # such version should be used to test for differences. If your default python3 # executable is of lower version, you can point MICROPY_CPYTHON3 environment var # to the correct executable. diff --git a/unix/Makefile b/unix/Makefile index 83c79ac96..8672b4f18 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -59,7 +59,7 @@ CFLAGS += -U _FORTIFY_SOURCE endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. -# The unix port of micropython on OSX must be compiled with clang, +# The unix port of MicroPython on OSX must be compiled with clang, # while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) diff --git a/unix/alloc.c b/unix/alloc.c index 54fc1d3c4..ca12d025b 100644 --- a/unix/alloc.c +++ b/unix/alloc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/fdfile.h b/unix/fdfile.h index 591159deb..69a9b6be4 100644 --- a/unix/fdfile.h +++ b/unix/fdfile.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/file.c b/unix/file.c index a60840c81..f27e23547 100644 --- a/unix/file.c +++ b/unix/file.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/gccollect.c b/unix/gccollect.c index 4ec8c2bf5..02f6fc91a 100644 --- a/unix/gccollect.c +++ b/unix/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/input.c b/unix/input.c index 4b10350df..7d60b46cc 100644 --- a/unix/input.c +++ b/unix/input.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/main.c b/unix/main.c index 633144c86..e861d7f11 100644 --- a/unix/main.c +++ b/unix/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modffi.c b/unix/modffi.c index 8b392f1c3..6c5e4f22e 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modjni.c b/unix/modjni.c index 896f2f919..540964d44 100644 --- a/unix/modjni.c +++ b/unix/modjni.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modmachine.c b/unix/modmachine.c index 33a3b098e..48dddec0a 100644 --- a/unix/modmachine.c +++ b/unix/modmachine.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modos.c b/unix/modos.c index 8e746c163..8b5d5790f 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modsocket.c b/unix/modsocket.c index c1f88defc..c612f870d 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modtermios.c b/unix/modtermios.c index 5e82e772a..fe19aac83 100644 --- a/unix/modtermios.c +++ b/unix/modtermios.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modtime.c b/unix/modtime.c index 2a6487df2..a74b81f37 100644 --- a/unix/modtime.c +++ b/unix/modtime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/moduselect.c b/unix/moduselect.c index 37a3a33b2..ba1c195ef 100644 --- a/unix/moduselect.c +++ b/unix/moduselect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 047121fe6..b557f3d44 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (PATH_MAX) #define MICROPY_PERSISTENT_CODE_LOAD (1) diff --git a/unix/mpconfigport_fast.h b/unix/mpconfigport_fast.h index b5be9f334..442159eb4 100644 --- a/unix/mpconfigport_fast.h +++ b/unix/mpconfigport_fast.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/mpconfigport_minimal.h b/unix/mpconfigport_minimal.h index b4d9f8143..e37605eab 100644 --- a/unix/mpconfigport_minimal.h +++ b/unix/mpconfigport_minimal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_QSTR_CHUNK_INIT (64) #define MICROPY_ALLOC_PARSE_RULE_INIT (8) diff --git a/unix/mphalport.h b/unix/mphalport.h index cf227872f..ff7a51567 100644 --- a/unix/mphalport.h +++ b/unix/mphalport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/qstrdefsport.h b/unix/qstrdefsport.h index 8ab2db58f..ebfaa6cca 100644 --- a/unix/qstrdefsport.h +++ b/unix/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/unix_mphal.c b/unix/unix_mphal.c index 800484498..02cdbea11 100644 --- a/unix/unix_mphal.c +++ b/unix/unix_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/init.c b/windows/init.c index 669092347..09fa10417 100644 --- a/windows/init.c +++ b/windows/init.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/init.h b/windows/init.h index 480befef6..c6fddb257 100644 --- a/windows/init.h +++ b/windows/init.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index f2f6cbd32..c4e6ba131 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built // Linking with GNU readline (MICROPY_USE_READLINE == 2) causes binary to be licensed under GPL #ifndef MICROPY_USE_READLINE diff --git a/windows/msvc/gettimeofday.c b/windows/msvc/gettimeofday.c index 6d7264ae7..5f816df70 100644 --- a/windows/msvc/gettimeofday.c +++ b/windows/msvc/gettimeofday.c @@ -1,5 +1,5 @@ /* -* This file is part of the Micro Python project, http://micropython.org/ +* This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/msvc/sys/time.h b/windows/msvc/sys/time.h index a36648beb..7c95d409e 100644 --- a/windows/msvc/sys/time.h +++ b/windows/msvc/sys/time.h @@ -1,5 +1,5 @@ /* -* This file is part of the Micro Python project, http://micropython.org/ +* This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/msvc/unistd.h b/windows/msvc/unistd.h index 87787c3d8..1a1629be4 100644 --- a/windows/msvc/unistd.h +++ b/windows/msvc/unistd.h @@ -1,5 +1,5 @@ /* -* This file is part of the Micro Python project, http://micropython.org/ +* This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/realpath.c b/windows/realpath.c index c0ed6b84d..ac9adf812 100644 --- a/windows/realpath.c +++ b/windows/realpath.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/realpath.h b/windows/realpath.h index c7bb3acd7..869fe80fa 100644 --- a/windows/realpath.h +++ b/windows/realpath.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/sleep.c b/windows/sleep.c index b8f0a2e9b..6043ec7b7 100644 --- a/windows/sleep.c +++ b/windows/sleep.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/sleep.h b/windows/sleep.h index 6c0c00332..430ec3a43 100644 --- a/windows/sleep.h +++ b/windows/sleep.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c index a73140e54..153b04423 100644 --- a/windows/windows_mphal.c +++ b/windows/windows_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/windows_mphal.h b/windows/windows_mphal.h index 854e14a7a..5a93d4e18 100644 --- a/windows/windows_mphal.h +++ b/windows/windows_mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/zephyr/machine_pin.c b/zephyr/machine_pin.c index 38971399c..c3722926a 100644 --- a/zephyr/machine_pin.c +++ b/zephyr/machine_pin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/zephyr/modutime.c b/zephyr/modutime.c index 0c268046a..a5d32fe66 100644 --- a/zephyr/modutime.c +++ b/zephyr/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * From 8762cfe97f661e1f8ad199cd61ec5e4d49673626 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 31 Jul 2017 11:20:55 +0200 Subject: [PATCH 172/403] add badge.eink_deep_sleep() and badge.eink_wakeup() --- esp32/modbadge.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 71bb9a53d..c22f48455 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -203,7 +203,7 @@ STATIC mp_obj_t badge_nvs_set_u16_(mp_obj_t _namespace, mp_obj_t _key, mp_obj_t STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); -// EINK +// E-Ink (badge_eink.h) STATIC mp_obj_t badge_eink_init_() { badge_eink_init(BADGE_EINK_DEFAULT); @@ -211,6 +211,19 @@ STATIC mp_obj_t badge_eink_init_() { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_init_obj, badge_eink_init_); +STATIC mp_obj_t badge_eink_deep_sleep_() { + badge_eink_deep_sleep(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_deep_sleep_obj, badge_eink_deep_sleep_); + +STATIC mp_obj_t badge_eink_wakeup_() { + badge_eink_wakeup(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_wakeup_obj, badge_eink_wakeup_); + + /** #define NUM_PICTURES 7 const uint8_t *pictures[NUM_PICTURES] = { @@ -382,7 +395,11 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_badge)}, {MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&badge_init_obj)}, + + // E-Ink {MP_ROM_QSTR(MP_QSTR_eink_init), MP_ROM_PTR(&badge_eink_init_obj)}, + {MP_ROM_QSTR(MP_QSTR_eink_deep_sleep), MP_ROM_PTR(&badge_eink_deep_sleep_obj)}, + {MP_ROM_QSTR(MP_QSTR_eink_wakeup), MP_ROM_PTR(&badge_eink_wakeup_obj)}, // Power {MP_OBJ_NEW_QSTR(MP_QSTR_power_init), (mp_obj_t)&badge_power_init_obj}, From 0853be361abc5bd37dddbe38af054fa0beac2bb1 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Mon, 31 Jul 2017 16:07:05 +0200 Subject: [PATCH 173/403] Fix behaviour of easydraw.msg and included programs that make use of this function --- esp32/modules/easydraw.py | 8 ++++---- esp32/modules/easyrtc.py | 2 +- esp32/modules/easywifi.py | 9 +++++++-- esp32/modules/launcher.py | 3 +-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index f3fa1d9bc..b301390aa 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -21,10 +21,10 @@ def msg(message, title = 'Still Loading Anyway...', reset = False): ugfx.clear(ugfx.WHITE) ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) lineNumber = 0 - else: - ugfx.string(0, 30 + (lineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) - ugfx.flush(ugfx.LUT_FASTER) - lineNumber += 1 + + ugfx.string(0, 30 + (lineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) + ugfx.flush(ugfx.LUT_FASTER) + lineNumber += 1 def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index 67bb387c9..4c5fbc13c 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -37,7 +37,7 @@ def configure(): if not easywifi.status(): if not easywifi.enable(): return False - easydraw.msg("Configuring clock...", True) + easydraw.msg("Configuring clock...") ntp.set_NTP_time() easydraw.msg("Done") return True diff --git a/esp32/modules/easywifi.py b/esp32/modules/easywifi.py index dcf99cc61..9ed551500 100644 --- a/esp32/modules/easywifi.py +++ b/esp32/modules/easywifi.py @@ -17,7 +17,7 @@ def force_enable(): state = False enable() -def enable(): +def enable(showStatus=True): global state if not state: nw = network.WLAN(network.STA_IF) @@ -25,16 +25,21 @@ def enable(): nw.active(True) ssid = badge.nvs_get_str('badge', 'wifi.ssid', 'SHA2017-insecure') password = badge.nvs_get_str('badge', 'wifi.password') + if showStatus: + easydraw.msg("Connecting to '"+ssid+"'...") nw.connect(ssid, password) if password else nw.connect(ssid) - timeout = badge.nvs_get_u8('badge', 'wifi.timeout', 40) while not nw.isconnected(): time.sleep(0.1) timeout = timeout - 1 if (timeout<1): + if showStatus: + easydraw.msg("Error: could not connect!") disable() return False state = True + if showStatus: + easydraw.msg("Connected!") return True def disable(): diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index a6955683f..8979ed0b3 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -53,8 +53,7 @@ def uninstall_it(pushed): def perform_uninstall(ok): if ok: - easydraw.msg("Uninstalling:",True) - easydraw.msg(selected) + easydraw.msg(selected,"Uninstalling...",True) install_path = get_install_path() for rm_file in os.listdir("%s/%s" % (install_path, selected)): os.remove("%s/%s/%s" % (install_path, selected, rm_file)) From 0ba3126515a2440f59740bd60fac6721c7cd1028 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Mon, 31 Jul 2017 16:21:59 +0200 Subject: [PATCH 174/403] Fix crash on msg with reset true while already reset --- esp32/modules/easydraw.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index b301390aa..c0c5b4636 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -14,7 +14,12 @@ def msg(message, title = 'Still Loading Anyway...', reset = False): """ global lineNumber if reset: - del lineNumber + try: + lineNumber + del lineNumber + except: + pass + try: lineNumber except: From c380eeb3194456e4e38324f31136829448385222 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Mon, 31 Jul 2017 16:37:47 +0200 Subject: [PATCH 175/403] Keep message history to allow scrolling when overflow occurs. --- esp32/modules/easydraw.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index c0c5b4636..b26a993fe 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -12,24 +12,38 @@ def msg(message, title = 'Still Loading Anyway...', reset = False): title can be optionaly set when resetting or first call """ - global lineNumber + global messageTitle + global messageHistory if reset: try: - lineNumber - del lineNumber + messageHistory + del messageHistory except: pass try: - lineNumber + messageHistory except: ugfx.clear(ugfx.WHITE) ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) - lineNumber = 0 + messageTitle = title + messageHistory = [] - ugfx.string(0, 30 + (lineNumber * 15), message, "Roboto_Regular12", ugfx.BLACK) + print("LEN: "+str(len(messageHistory))) + + if len(messageHistory)<6: + ugfx.string(0, 30 + (len(messageHistory) * 15), message, "Roboto_Regular12", ugfx.BLACK) + messageHistory.append(message) + else: + print("REDRAW NEEDED") + messageHistory.pop(0) + messageHistory.append(message) + ugfx.clear(ugfx.WHITE) + ugfx.string(0, 0, messageTitle, "PermanentMarker22", ugfx.BLACK) + for i in range(0, len(messageHistory)): + ugfx.string(0, 30 + (i * 15), messageHistory[i], "Roboto_Regular12", ugfx.BLACK) + ugfx.flush(ugfx.LUT_FASTER) - lineNumber += 1 def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') From 9682cd5bb02279afa38ba58035763b6b7c8cdae0 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Mon, 31 Jul 2017 16:46:40 +0200 Subject: [PATCH 176/403] Remove debug messages --- esp32/modules/easydraw.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index b26a993fe..df4c6b1bd 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -29,13 +29,10 @@ def msg(message, title = 'Still Loading Anyway...', reset = False): messageTitle = title messageHistory = [] - print("LEN: "+str(len(messageHistory))) - if len(messageHistory)<6: ugfx.string(0, 30 + (len(messageHistory) * 15), message, "Roboto_Regular12", ugfx.BLACK) messageHistory.append(message) else: - print("REDRAW NEEDED") messageHistory.pop(0) messageHistory.append(message) ugfx.clear(ugfx.WHITE) From 4fbf82f5994403e7d4cc5017e39e8e1771620f26 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Mon, 31 Jul 2017 17:24:43 +0200 Subject: [PATCH 177/403] Refractoring msg --- esp32/modules/easydraw.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index df4c6b1bd..e5ddb47a1 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -12,21 +12,15 @@ def msg(message, title = 'Still Loading Anyway...', reset = False): title can be optionaly set when resetting or first call """ - global messageTitle global messageHistory - if reset: - try: - messageHistory - del messageHistory - except: - pass - + try: messageHistory + if reset: + raise exception except: ugfx.clear(ugfx.WHITE) ugfx.string(0, 0, title, "PermanentMarker22", ugfx.BLACK) - messageTitle = title messageHistory = [] if len(messageHistory)<6: @@ -35,11 +29,10 @@ def msg(message, title = 'Still Loading Anyway...', reset = False): else: messageHistory.pop(0) messageHistory.append(message) - ugfx.clear(ugfx.WHITE) - ugfx.string(0, 0, messageTitle, "PermanentMarker22", ugfx.BLACK) - for i in range(0, len(messageHistory)): - ugfx.string(0, 30 + (i * 15), messageHistory[i], "Roboto_Regular12", ugfx.BLACK) - + ugfx.area(0,30, 296, 98, ugfx.WHITE) + for i, message in enumerate(messageHistory): + ugfx.string(0, 30 + (i * 15), message, "Roboto_Regular12", ugfx.BLACK) + ugfx.flush(ugfx.LUT_FASTER) def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): From 76d93a36b29183ba383af6d7b8982d97da3b4ca5 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Mon, 31 Jul 2017 19:39:59 +0200 Subject: [PATCH 178/403] versioning --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 0e6076605..607287526 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 3 -name = "Charmante Chirurg" +build = 4 +name = "Olijke Opruimers" From cf9966cbb8d11c92553ae4d1a7ff78616b6b4e54 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Mon, 31 Jul 2017 19:42:55 +0200 Subject: [PATCH 179/403] ESP-IDF hash updated --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index a854a700f..fdf5d5a58 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 8b274cd5a5d193a82b49aef384c303b105eda700 +ESPIDF_SUPHASH := 0d4b691a3fbf01061a5a06ca03db08b15e462e67 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) From ee0452509785faa41a3e15a3646130e35f3556cd Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 31 Jul 2017 22:38:37 +0300 Subject: [PATCH 180/403] extmod/modlwip: Implement setsockopt(IP_ADD_MEMBERSHIP). Allows to join multicast groups. --- extmod/modlwip.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 9d1a8c4d0..bde251cca 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -45,6 +45,7 @@ //#include "lwip/raw.h" #include "lwip/dns.h" #include "lwip/tcp_impl.h" +#include "lwip/igmp.h" #if 0 // print debugging info #define DEBUG_printf DEBUG_printf @@ -52,6 +53,10 @@ #define DEBUG_printf(...) (void)0 #endif +// All socket options should be globally distinct, +// because we ignore option levels for efficiency. +#define IP_ADD_MEMBERSHIP 0x400 + // For compatibilily with older lwIP versions. #ifndef ip_set_option #define ip_set_option(pcb, opt) ((pcb)->so_options |= (opt)) @@ -1079,10 +1084,10 @@ STATIC mp_obj_t lwip_socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) { return mp_const_none; } - // Integer options - mp_int_t val = mp_obj_get_int(args[3]); switch (opt) { - case SOF_REUSEADDR: + // level: SOL_SOCKET + case SOF_REUSEADDR: { + mp_int_t val = mp_obj_get_int(args[3]); // Options are common for UDP and TCP pcb's. if (val) { ip_set_option(socket->pcb.tcp, SOF_REUSEADDR); @@ -1090,6 +1095,24 @@ STATIC mp_obj_t lwip_socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) { ip_reset_option(socket->pcb.tcp, SOF_REUSEADDR); } break; + } + + // level: IPPROTO_IP + case IP_ADD_MEMBERSHIP: { + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ); + if (bufinfo.len != sizeof(ip_addr_t) * 2) { + mp_raise_ValueError(NULL); + } + + // POSIX setsockopt has order: group addr, if addr, lwIP has it vice-versa + err_t err = igmp_joingroup((ip_addr_t*)bufinfo.buf + 1, bufinfo.buf); + if (err != ERR_OK) { + mp_raise_OSError(error_lookup_table[-err]); + } + break; + } + default: printf("Warning: lwip.setsockopt() not implemented\n"); } @@ -1342,6 +1365,9 @@ STATIC const mp_rom_map_elem_t mp_module_lwip_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_ROM_INT(1) }, { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_ROM_INT(SOF_REUSEADDR) }, + + { MP_ROM_QSTR(MP_QSTR_IPPROTO_IP), MP_ROM_INT(0) }, + { MP_ROM_QSTR(MP_QSTR_IP_ADD_MEMBERSHIP), MP_ROM_INT(IP_ADD_MEMBERSHIP) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_lwip_globals, mp_module_lwip_globals_table); From 16f901f522489955fbcc44cc703896c12cecd64b Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 1 Aug 2017 00:39:47 +0200 Subject: [PATCH 181/403] Make master functional again - new IDF hash and bugfix modbadge --- esp32/Makefile | 2 +- esp32/modbadge.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index fdf5d5a58..5061907db 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 0d4b691a3fbf01061a5a06ca03db08b15e462e67 +ESPIDF_SUPHASH := d230dbccf4af26c732b748571b89178556dc20c5 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index c22f48455..4b723d02e 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -206,7 +206,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); // E-Ink (badge_eink.h) STATIC mp_obj_t badge_eink_init_() { - badge_eink_init(BADGE_EINK_DEFAULT); + badge_eink_init(); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_init_obj, badge_eink_init_); From 6164847d3f644c78c50dfa47aad1276813575c66 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 1 Aug 2017 01:04:39 +0200 Subject: [PATCH 182/403] Revert removal of eink_init() arg --- esp32/modbadge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 4b723d02e..c22f48455 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -206,7 +206,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); // E-Ink (badge_eink.h) STATIC mp_obj_t badge_eink_init_() { - badge_eink_init(); + badge_eink_init(BADGE_EINK_DEFAULT); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_init_obj, badge_eink_init_); From c0d6a47fb20a9134e28a306cc73cc42c2ec260af Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Tue, 1 Aug 2017 01:24:04 +0200 Subject: [PATCH 183/403] Lower loglevel of wifi at runtime --- esp32/modnetwork.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esp32/modnetwork.c b/esp32/modnetwork.c index 3fdbf3786..21e29193a 100644 --- a/esp32/modnetwork.c +++ b/esp32/modnetwork.c @@ -188,6 +188,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(get_wlan_obj, 0, 1, get_wlan); STATIC mp_obj_t esp_initialize() { static int initialized = 0; if (!initialized) { + // wifi binary does not listens to compuiler log level, and must be set at runtime + esp_log_level_set("wifi", ESP_LOG_WARN); + ESP_LOGD("modnetwork", "Initializing TCP/IP"); tcpip_adapter_init(); ESP_LOGD("modnetwork", "Initializing Event Loop"); From e535046250cbe2e6d68032f483e9da9fccbbacdf Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 01:53:54 +0200 Subject: [PATCH 184/403] Initial version of new API --- esp32/modules/appglue.py | 3 +- esp32/modules/services.py | 253 ++++++++++++++++++++++++++++++++------ esp32/modules/splash.py | 237 +++++++++++++++++------------------ 3 files changed, 327 insertions(+), 166 deletions(-) diff --git a/esp32/modules/appglue.py b/esp32/modules/appglue.py index 69306bf3b..462a2e0de 100644 --- a/esp32/modules/appglue.py +++ b/esp32/modules/appglue.py @@ -21,7 +21,8 @@ def start_ota(): esp.rtcmem_write(1,254) deepsleep.reboot() -def start_bpp(): +def start_bpp(duration): + print("[BPP] Duration = "+str(duration)) esp.rtcmem_write(0,2) esp.rtcmem_write(1,253) deepsleep.reboot() diff --git a/esp32/modules/services.py b/esp32/modules/services.py index a17088674..127b6f64d 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -1,59 +1,232 @@ -import uos - # File: services.py +# Version: 2 +# API version: 1 # Description: Background services for SHA2017 badge # License: MIT # Authors: Renze Nicolai # Thomas Roos -def setup(): +import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge + +services = [] #List containing all the service objects +loopCallbacks = {} #Dict containing: {:} +drawCallbacks = [] #List containing draw functions + +def setup(pmCb=False, drawCb=False): global services + global loopCallbacks + global drawCallbacks + + if pmCb: + print("[SERVICES] Power management callback registered") + global pmCallback + pmCallback = pmCb + + if drawCb: + print("[SERVICES] Draw callback registered") + global drawCallback + drawCallback = drawCb #This might need a better name... + + # Status of wifi + wifiFailed = False + + #Check if lib folder exists and get application list, else stop try: apps = uos.listdir('lib') except OSError: - print("[SERVICES] Can't setup services: no lib folder!") - return False - found = False + return [False, False] + + #For each app... for app in apps: + print("APP: "+app) try: - files = uos.listdir('lib/'+app) - except OSError: - print("[SERVICES] Listing app files for app '"+app+"' failed!") - - for f in files: - if (f=="service.py"): - found = True - print("[SERVICES] Found service "+app+"...") - try: - srv = __import__('lib/'+app+'/service') - services.append(srv) #Add to global list - srv.setup() - except BaseException as msg: - print("Exception in service setup "+app+": ", msg) - break - return found + #Try to open and read the json description + fd = open('/lib/'+app+'/service.json') + description = ujson.loads(fd.read()) + fd.close() + except: + print("[SERVICES] No description found for "+app) + continue #Or skip the app + + print("DESC FOUND FOR: "+app) + + try: + #Try to open the service itself + fd = open('/lib/'+app+'/service.py') + fd.close() + except: + print("[SERVICES] No script found for "+app) + continue #Or skip the app + + print("SCRIPT FOUND FOR: "+app) + + rtcRequired = False # True if RTC should be set before starting service + loopEnabled = False # True if loop callback is requested + drawEnabled = False # True if draw callback is requested + + wifiInSetup = False # True if wifi needed in setup + wifiInLoop = False # True if wifi needed in loop + + try: + if description['apiVersion']!=1: + print("[SERVICES] Service for "+app+" is not compatible with current firmware") + continue #Skip the app + wifiInSetup = description['wifi']['setup'] + wifiInLoop = description['wifi']['setup'] + rtcRequired = description['rtc'] + loopEnabled = description['loop'] + drawEnabled = description['draw'] + except: + print("[SERVICES] Could not parse description of app "+app) + continue #Skip the app + + print("[SERVICES] Found service for "+app) + + # Import the service.py script + try: + srv = __import__('lib/'+app+'/service') + except: + print("[SERVICES] Could not import service of app "+app) + continue #Skip the app + + if wifiInSetup: + if wifiFailed: + print("[SERVICES] Service of app "+app+" requires wifi and wifi failed so the service has been disabled.") + continue + if not easywifi.status(): + if not easywifi.enable(): + wifiFailed = True + print("[SERVICES] Could not connect to wifi!") + continue # Skip the app -def loop(lcnt): - noSleep = False - global services - for srv in services: + if rtcRequired and time.time() < 1482192000: + if not wifiFailed: + print("[SERVICES] RTC required, configuring...") + easyrtc.configure() + else: + print("[SERVICES] RTC required but not available. Skipping service.") + continue # Skip the app (because wifi failed and rtc not available) + + try: + srv.setup() + except BaseException as msg: + print("[SERVICES] Exception in service setup "+app+": ", msg) + continue + + if loopEnabled: + try: + loopCallbacks[srv.loop] = 0 + except: + print("[SERVICES] Loop requested but not defined in service "+app) + + if drawEnabled and drawCb: + try: + drawCallbacks[srv.draw] = 0 + except: + print("[SERVICES] Draw requested but not defined in service "+app) + + # Add the script to the global service list + services.append(srv) + + # Create loop timer + hasLoopTimer = False + global loopTimer + if len(loopCallbacks)>0: + print("[SERVICES] There are loop callbacks, starting loop timer!") + loopTimer = machine.Timer(0) #TODO: how to get this number?!? + loop_timer_callback(loopTimer) + hasLoopTimer = True + + # Create draw timer + hasDrawTimer = False + global drawTimer + if len(drawCallbacks)>0 and drawCb: + print("[SERVICES] There are draw callbacks, starting draw timer!") + drawTimer = machine.Timer(1) #TODO: how to get this number?!? + draw_timer_callback(drawTimer) + hasDrawTimer = True + return [hasLoopTimer, hasDrawTimer] + +def loop_timer_callback(tmr): + global loopCallbacks + requestedInterval = 99999999 + newLoopCallbacks = loopCallbacks + for cb in loopCallbacks: + rqi = 0 try: - if (srv.loop(lcnt)): - noSleep = True + rqi = cb() except BaseException as msg: - print("[SERVICES] Service loop exception: ", msg) - return noSleep + print("[SERVICES] Exception in service loop: ", msg) + newLoopCallbacks.pop(cb) + continue + if rqi>0 and rqi0): - y = y + abs(space_used) + [rqi, space_used] = cb(y) + y = y - space_used except BaseException as msg: - print("[SERVICES] Service draw exception: ", msg) + print("[SERVICES] Exception in service draw: ", msg) + newDrawCallbacks.pop(cb) + continue + if rqi>0 and rqi0: + print("[SERVICES] New draw requested in "+str(requestedInterval)+".") + tmr.init(period=requestedInterval*1000, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) + + drawCallback(True) # Complete draw -services = [] +def force_draw(disableTimer): + if disableTimer: + print("[SERVICES] Drawing services one last time before sleep...") + global drawTimer + try: + drawTimer.deinit() + except: + pass + else: + print("[SERVICES] Drawing at boot...") + global drawCallbacks + if len(drawCallbacks)>0: + y = ugfx.height() + for cb in drawCallback: + try: + [rqi, space_used] = cb(y) + y = y - space_used + except BaseException as msg: + print("[SERVICES] Exception in service draw: ", msg) + newDrawCallbacks.pop(cb) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index eeab4d11a..26a99d7bf 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -10,61 +10,97 @@ import easydraw, easywifi, easyrtc -### FUNCTIONS +# Power management -# Graphics -def splash_draw_actions(sleeping): - global otaAvailable - if sleeping: - info1 = 'Sleeping...' - info2 = 'Press any key to wake up' +enableBpp = True +requestedStandbyTime = 0 + +def power_management(timeUntilNextTick): + global requestedStandbyTime + requestedStandbyTime = timeUntilNextTick + if (timeUntilNextTick>60*5): + print("[PM] Next tick after more than 5 minutes (MAY BPP).") + global enableBpp + enableBpp = True + power_countdown_reset(0) + elif (timeUntilNextTick<30): + print("[PM] Next loop in "+str(timeUntilNextTick)+" seconds (STAY AWAKE).") + power_countdown_reset(timeUntilNextTick) + return True #Service loop timer can be restarted else: - info1 = 'Press start to open the launcher' - if otaAvailable: - info2 = 'Press select to start OTA update' - else: - info2 = easyrtc.string(True, True) - - l = ugfx.get_string_width(info1,"Roboto_Regular12") - ugfx.string(296-l, 0, info1, "Roboto_Regular12",ugfx.BLACK) - l = ugfx.get_string_width(info2,"Roboto_Regular12") - ugfx.string(296-l, 12, info2, "Roboto_Regular12",ugfx.BLACK) - -def splash_draw(full=False,sleeping=False): + print("[PM] Next loop in "+str(timeUntilNextTick)+" seconds (MAY SLEEP).") + global enableBpp + enableBpp = False + power_countdown_reset(0) + return False - vUsb = badge.usb_volt_sense() - vBatt = badge.battery_volt_sense() - vBatt += vDrop - charging = badge.battery_charge_status() +powerCountdownOffset = 0 +def power_countdown_reset(timeUntilNextTick=-1): + global powerTimer + global powerCountdownOffset + try: + powerTimer.deinit() + except: + print("POWER TIMER DEINIT FAILED?!?!?") + if timeUntilNextTick>=0: + powerCountdownOffset = timeUntilNextTick + newTarget = powerCountdownOffset+badge.nvs_get_u8('splash', 'urt', 5) #User React Time (in seconds) + print("[SPLASH] Power countdown reset to "+str(newTarget)) + powerTimer.init(period=newTarget*1000, mode=machine.Timer.ONE_SHOT, callback=power_countdown_callback) + +def power_countdown_callback(tmr): + global enableBpp + draw(False, True) + services.force_draw(True) + draw(True, True) + global requestedStandbyTime + if requestedStandbyTime>0: + if enableBpp: + print("[PM] BPP for "+str(round(timeUntilNextTick/60))+" minutes.") + appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes + else: + print("[PM] Sleep for "+str(round())+" seconds.") + deepsleep.start_sleeping(requestedStandbyTime*1000) + else: + print("[PM] BPP forever.") + appglue.start_bpp(-1) - if splash_power_countdown_get()<1: - full= True +# Graphics - if full: +def draw(mode, goingToSleep=False): + if mode: + # We flush the buffer and wait + ugfx.flush(ugfx.LUT_FULL) + badge.eink_busy_wait() + else: + # We prepare the screen refresh ugfx.clear(ugfx.WHITE) + if goingToSleep: + info1 = 'Sleeping...' + info2 = 'Press any key to wake up' + else: + info1 = 'Press start to open the launcher' + global otaAvailable + if otaAvailable: + info2 = 'Press select to start OTA update' + else: + info2 = '' + l = ugfx.get_string_width(info1,"Roboto_Regular12") + ugfx.string(296-l, 0, info1, "Roboto_Regular12",ugfx.BLACK) + l = ugfx.get_string_width(info2,"Roboto_Regular12") + ugfx.string(296-l, 12, info2, "Roboto_Regular12",ugfx.BLACK) + easydraw.nickname() - else: - ugfx.area(0,0,ugfx.width(),24,ugfx.WHITE) - ugfx.area(0,ugfx.height()-64,ugfx.width(),64,ugfx.WHITE) - - easydraw.battery(vUsb, vBatt, charging) - - global splashPowerCountdown - - if splashPowerCountdown>0: + + vUsb = badge.usb_volt_sense() + vBatt = badge.battery_volt_sense() + vBatt += vDrop + charging = badge.battery_charge_status() + + easydraw.battery(vUsb, vBatt, charging) + if vBatt>500: ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) - if splashPowerCountdown>0 and splashPowerCountdown 4000: - splash_power_countdown_reset() - return False - elif splashPowerCountdown<0: - print("[SPLASH] Going to sleep...") - splash_draw(True,True) - badge.eink_busy_wait() - #now = time.time() - #wake_at = round(now + badge.nvs_get_u16('splash', 'sleep.duration', 120)*1000) - #appglue.start_bpp() - deepsleep.start_sleeping(badge.nvs_get_u16('splash', 'sleep.duration', 120)*1000) - return True - else: - print("[SPLASH] Sleep in "+str(splashPowerCountdown)+"...") - return False - - # Button input def splash_input_start(pressed): @@ -237,8 +233,8 @@ def splash_input_start(pressed): def splash_input_a(pressed): if pressed: print("[SPLASH] A button pressed") - splash_power_countdown_reset() splash_about_countdown_trigger() + power_countdown_reset() def splash_input_select(pressed): if pressed: @@ -246,7 +242,7 @@ def splash_input_select(pressed): global otaAvailable if otaAvailable: splash_ota_start() - splash_power_countdown_reset() + power_countdown_reset() #def splash_input_left(pressed): # if pressed: @@ -255,7 +251,7 @@ def splash_input_select(pressed): def splash_input_other(pressed): if pressed: print("[SPLASH] Other button pressed") - splash_power_countdown_reset() + power_countdown_reset() def splash_input_init(): print("[SPLASH] Inputs attached") @@ -269,30 +265,10 @@ def splash_input_init(): ugfx.input_attach(ugfx.JOY_LEFT, splash_input_other) ugfx.input_attach(ugfx.JOY_RIGHT, splash_input_other) -# Event timer -def splash_timer_init(): - global splashTimer - try: - splashTimer - print("[SPLASH] Timer exists already") - except: - splashTimer = machine.Timer(-1) - splashTimer.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) - print("[SPLASH] Timer created") - -def splash_timer_callback(tmr): - try: - if services.loop(splash_power_countdown_get()): - splash_power_countdown_reset() - except: - pass - if not splash_power_countdown_trigger(): - splash_draw(False, False) - tmr.init(period=badge.nvs_get_u16('splash', 'timer.period', 100), mode=machine.Timer.ONE_SHOT, callback=splash_timer_callback) - - ### PROGRAM +powerTimer = machine.Timer(2) #TODO: how to get this number?!? + # Load settings from NVS otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) @@ -305,32 +281,29 @@ def splash_timer_callback(tmr): # Initialize user input subsystem splash_input_init() -# Initialize power management subsystem -splash_power_countdown_reset() - # Initialize about subsystem splash_about_countdown_reset() # Setup / Sponsors / OTA check / NTP clock sync setupState = badge.nvs_get_u8('badge', 'setup.state', 0) if setupState == 0: #First boot - print("[SPLASH] First boot...") + print("[SPLASH] First boot (start setup)...") appglue.start_app("setup") elif setupState == 1: # Second boot: Show sponsors - print("[SPLASH] Second boot...") + print("[SPLASH] Second boot (show sponsors)...") badge.nvs_set_u8('badge', 'setup.state', 2) splash_sponsors_show() elif setupState == 2: # Third boot: force OTA check - print("[SPLASH] Third boot...") + print("[SPLASH] Third boot (force ota check)...") badge.nvs_set_u8('badge', 'setup.state', 3) - otaCheck = easyrtc.configure() if time.time() < 1482192000 else True otaAvailable = splash_ota_check() else: # Normal boot print("[SPLASH] Normal boot...") - otaCheck = easyrtc.configure() if time.time() < 1482192000 else True - if (machine.reset_cause() != machine.DEEPSLEEP_RESET) and otaCheck: + if (machine.reset_cause() != machine.DEEPSLEEP_RESET): + print("... from reset: checking for ota update") otaAvailable = splash_ota_check() else: + print("... from deep sleep: loading ota state from nvs") otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) # Download resources to fatfs @@ -341,16 +314,30 @@ def splash_timer_callback(tmr): splash_sponsors_show() # Initialize services -services.setup() +print("Initialize services") +[srvDoesSleep, srvDoesDraw] = services.setup(power_management, draw) # Disable WiFi if active +print("Disable WiFi if active") easywifi.disable() -# Initialize timer -splash_timer_init() - # Clean memory +print("Clean memory") gc.collect() # Draw homescreen -splash_draw(True, False) +print("Draw homescreen") +if not srvDoesDraw: + print("[SPLASH] No service draw, manually drawing...") + draw(False) + draw(True) + +if not srvDoesSleep: + print("[SPLASH] No service sleep!") + +power_countdown_reset(-1) + +print("----") +print("WARNING: NOT IN REPL MODE, POWER MANAGEMENT ACTIVE") +print("TO USE REPL RESET AND HIT CTRL+C BEFORE SPLASH STARTS") +print("----") From 0f9b2f30b3aa700c037832c8730c2d780456061c Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:02:02 +0200 Subject: [PATCH 185/403] Replaced BPP with normal sleep for now. --- esp32/modules/splash.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 26a99d7bf..42f7241d3 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -57,13 +57,15 @@ def power_countdown_callback(tmr): if requestedStandbyTime>0: if enableBpp: print("[PM] BPP for "+str(round(timeUntilNextTick/60))+" minutes.") - appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes + #appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes + deepsleep.start_sleeping(requestedStandbyTime*1000) else: print("[PM] Sleep for "+str(round())+" seconds.") - deepsleep.start_sleeping(requestedStandbyTime*1000) + deepsleep.start_sleeping(requestedStandbyTime*1000) #Sleep needs time in milliseconds else: print("[PM] BPP forever.") - appglue.start_bpp(-1) + #appglue.start_bpp(-1) + deepsleep.start_sleeping() # Graphics @@ -298,7 +300,8 @@ def splash_input_init(): badge.nvs_set_u8('badge', 'setup.state', 3) otaAvailable = splash_ota_check() else: # Normal boot - print("[SPLASH] Normal boot...") + print("[SPLASH] Normal boot... ") + print("RESET CAUSE: "+str(machine.reset_cause())) if (machine.reset_cause() != machine.DEEPSLEEP_RESET): print("... from reset: checking for ota update") otaAvailable = splash_ota_check() From 29a0db169f4777b511ff71994294a3a0747a5464 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:06:33 +0200 Subject: [PATCH 186/403] Times now include 5 minutes and 30 seconds. --- esp32/modules/splash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 42f7241d3..bea8c8bd9 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -18,12 +18,12 @@ def power_management(timeUntilNextTick): global requestedStandbyTime requestedStandbyTime = timeUntilNextTick - if (timeUntilNextTick>60*5): + if (timeUntilNextTick>=60*5): print("[PM] Next tick after more than 5 minutes (MAY BPP).") global enableBpp enableBpp = True power_countdown_reset(0) - elif (timeUntilNextTick<30): + elif (timeUntilNextTick<=30): print("[PM] Next loop in "+str(timeUntilNextTick)+" seconds (STAY AWAKE).") power_countdown_reset(timeUntilNextTick) return True #Service loop timer can be restarted From fbee24ccf87d58af89111996887cf7d64602bc40 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:18:20 +0200 Subject: [PATCH 187/403] Import machine in services, needed for timers --- esp32/modules/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 127b6f64d..1acf0ebc2 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -6,7 +6,7 @@ # Authors: Renze Nicolai # Thomas Roos -import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge +import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge, machine services = [] #List containing all the service objects loopCallbacks = {} #Dict containing: {:} From d1137d8f4ee889ab4d40056175cae9d55c53ffe5 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:21:38 +0200 Subject: [PATCH 188/403] fix typo --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index bea8c8bd9..4d1a7011e 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -56,7 +56,7 @@ def power_countdown_callback(tmr): global requestedStandbyTime if requestedStandbyTime>0: if enableBpp: - print("[PM] BPP for "+str(round(timeUntilNextTick/60))+" minutes.") + print("[PM] BPP for "+str(round(requestedStandbyTime/60))+" minutes.") #appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes deepsleep.start_sleeping(requestedStandbyTime*1000) else: From 25f8c8ea431a689e2d57494321562aa8c0ae74fc Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:32:18 +0200 Subject: [PATCH 189/403] Set interval when no service does it. --- esp32/modules/services.py | 10 +++++++++- esp32/modules/splash.py | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 1acf0ebc2..fbe7a7af8 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -168,6 +168,10 @@ def loop_timer_callback(tmr): loopCallbacks = newLoopCallbacks del(newLoopCallbacks) + if requestedInterval>=99999999: + print("[SERVICES] No loop interval returned.") + requestedInterval = -1 + try: if pmCallback(requestedInterval): print("[SERVICES] Loop timer (re-)started") @@ -204,7 +208,11 @@ def draw_timer_callback(tmr): badge.eink_busy_wait() - if len(drawCallbacks)>0: + if requestedInterval>=99999999: + print("[SERVICES] No draw interval returned.") + requestedInterval = -1 + + if len(drawCallbacks)>0 and requestedInterval>=0: print("[SERVICES] New draw requested in "+str(requestedInterval)+".") tmr.init(period=requestedInterval*1000, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 4d1a7011e..f6c83c6cb 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -56,12 +56,12 @@ def power_countdown_callback(tmr): global requestedStandbyTime if requestedStandbyTime>0: if enableBpp: - print("[PM] BPP for "+str(round(requestedStandbyTime/60))+" minutes.") + print("[PM] BPP for "+str(requestedStandbyTime)+" seconds.") #appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes - deepsleep.start_sleeping(requestedStandbyTime*1000) + deepsleep.start_sleeping(requestedStandbyTime) else: print("[PM] Sleep for "+str(round())+" seconds.") - deepsleep.start_sleeping(requestedStandbyTime*1000) #Sleep needs time in milliseconds + deepsleep.start_sleeping(requestedStandbyTime) else: print("[PM] BPP forever.") #appglue.start_bpp(-1) From e6f39b42c4798860dba6546f9b7262be485b9c64 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:35:17 +0200 Subject: [PATCH 190/403] Fix bug --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index f6c83c6cb..378f48711 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -18,7 +18,7 @@ def power_management(timeUntilNextTick): global requestedStandbyTime requestedStandbyTime = timeUntilNextTick - if (timeUntilNextTick>=60*5): + if timeUntilNextTick<0 or timeUntilNextTick>=60*5: print("[PM] Next tick after more than 5 minutes (MAY BPP).") global enableBpp enableBpp = True From 0fc20c60360635eb2090f17685c1c362c29ae1f9 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:39:20 +0200 Subject: [PATCH 191/403] Whoops, deepsleep is in ms, not in s. --- esp32/modules/splash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 378f48711..02b6f6beb 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -58,10 +58,10 @@ def power_countdown_callback(tmr): if enableBpp: print("[PM] BPP for "+str(requestedStandbyTime)+" seconds.") #appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes - deepsleep.start_sleeping(requestedStandbyTime) + deepsleep.start_sleeping(requestedStandbyTime*1000) else: print("[PM] Sleep for "+str(round())+" seconds.") - deepsleep.start_sleeping(requestedStandbyTime) + deepsleep.start_sleeping(requestedStandbyTime*1000) else: print("[PM] BPP forever.") #appglue.start_bpp(-1) From 2fa3b1a782f673f3c6b60a4d5934720fe9fd0b1b Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 02:49:14 +0200 Subject: [PATCH 192/403] Fix typo --- esp32/modules/services.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index fbe7a7af8..397b0e84e 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -121,7 +121,7 @@ def setup(pmCb=False, drawCb=False): if drawEnabled and drawCb: try: - drawCallbacks[srv.draw] = 0 + drawCallbacks.append(srv.draw) except: print("[SERVICES] Draw requested but not defined in service "+app) @@ -188,7 +188,7 @@ def draw_timer_callback(tmr): drawCallback(False) # Prepare draw newDrawCallbacks = drawCallbacks - for cb in drawCallback: + for cb in drawCallbacks: rqi = 0 try: [rqi, space_used] = cb(y) @@ -231,7 +231,7 @@ def force_draw(disableTimer): global drawCallbacks if len(drawCallbacks)>0: y = ugfx.height() - for cb in drawCallback: + for cb in drawCallbacks: try: [rqi, space_used] = cb(y) y = y - space_used From d00b4a6ec8c8be9a78b5e1da3a7ca0b21d1b0457 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 03:01:43 +0200 Subject: [PATCH 193/403] Hmm, seems to work :) --- esp32/modules/services.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 397b0e84e..ce03c2f12 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -188,14 +188,15 @@ def draw_timer_callback(tmr): drawCallback(False) # Prepare draw newDrawCallbacks = drawCallbacks - for cb in drawCallbacks: + for i in range(0, len(drawCallbacks)): + cb = drawCallbacks[i] rqi = 0 try: [rqi, space_used] = cb(y) y = y - space_used except BaseException as msg: print("[SERVICES] Exception in service draw: ", msg) - newDrawCallbacks.pop(cb) + newDrawCallbacks.pop(i) continue if rqi>0 and rqi Date: Tue, 1 Aug 2017 03:21:46 +0200 Subject: [PATCH 194/403] Allow wifi settings for service to work. --- esp32/modules/easyrtc.py | 15 +++++++++------ esp32/modules/services.py | 12 +++++++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index 4c5fbc13c..a4b54d13e 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -7,8 +7,11 @@ import machine, time # Functions -def string(date=False, time=True): - [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() +def string(print_date=False, print_time=True, timestamp = -1): + if timestamp<0: + [year, month, mday, wday, hour, minute, sec, usec] = machine.RTC().datetime() + else: + [year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp) monthstr = str(month) if (month<10): monthstr = "0"+monthstr @@ -18,15 +21,15 @@ def string(date=False, time=True): hourstr = str(hour) if (hour<10): hourstr = "0"+hourstr - minstr = str(min) - if (min<10): + minstr = str(minute) + if (minute<10): minstr = "0"+minstr output = "" - if date: + if print_date: output += daystr+"-"+monthstr+"-"+str(year) if time: output += " " - if time: + if print_time: output += hourstr+":"+minstr return output diff --git a/esp32/modules/services.py b/esp32/modules/services.py index ce03c2f12..4c1e10e57 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -115,7 +115,7 @@ def setup(pmCb=False, drawCb=False): if loopEnabled: try: - loopCallbacks[srv.loop] = 0 + loopCallbacks[srv.loop] = wifiInLoop except: print("[SERVICES] Loop requested but not defined in service "+app) @@ -152,6 +152,14 @@ def loop_timer_callback(tmr): requestedInterval = 99999999 newLoopCallbacks = loopCallbacks for cb in loopCallbacks: + if loopCallbacks[cb]: + print("[SERVICES] Loop needs wifi!") + if not easywifi.status(): + if not easywifi.enable(): + print("[SERVICES] Wifi not available!") + continue + else: + print("[SERVICES] Loop does not need wifi!") rqi = 0 try: rqi = cb() @@ -171,6 +179,8 @@ def loop_timer_callback(tmr): if requestedInterval>=99999999: print("[SERVICES] No loop interval returned.") requestedInterval = -1 + + easywifi.disable() # Always disable wifi try: if pmCallback(requestedInterval): From 04e7269c812a5486029a6937c43611874f861a25 Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Sun, 30 Jul 2017 23:11:12 +0800 Subject: [PATCH 195/403] Let micropython use the bpp powerdown manager in order to work nicely with bpp --- esp32/main.c | 43 ++++++++++++++++++++++++++++++++++++++----- esp32/modmachine.c | 21 +++------------------ 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 4ed1f673b..31842e2c1 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -57,6 +57,7 @@ #include "badge_first_run.h" #include #include +#include "powerdown.h" // MicroPython runs as a task under FreeRTOS #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1) @@ -140,6 +141,36 @@ void do_bpp_bgnd() { esp_restart(); } +//PowerDownManager callback. If all objects that call into the powerdown manager are OK to sleep, +//it will calculate the time it can sleep and the mode to wake up in. +void do_deep_sleep(int delayMs, void *arg, PowerMode mode) { + PowerMode currMode=(PowerMode)arg; + delayMs-=8000; //to compensate for startup delay + if (delayMs<0) delayMs=0; + if (currMode==mode && delayMs<5000) return; //not worth sleeping + + printf("Sleeping for %d ms...\n", delayMs); + + //Shutdown anything running + if (currMode==POWER_MODE_BPP) { + bpp_shutdown(); + } + + //Select wake mode + uint8_t rtcmodebit=0; + if (mode==POWER_MODE_BPP) rtcmodebit=2; + if (mode==POWER_MODE_UPY) rtcmodebit=0; + esp_rtcmem_write(0, rtcmodebit); + esp_rtcmem_write(1, ~rtcmodebit); + + // TODO the wake on touch should be in badge_input_init + esp_deep_sleep_enable_ext0_wakeup(GPIO_NUM_25 , 0); + // FIXME don't use hardcoded GPIO_NUM_25 + esp_deep_sleep_enable_timer_wakeup(delayMs*1000); + esp_deep_sleep_start(); +} + + void app_main(void) { badge_check_first_run(); badge_base_init(); @@ -160,20 +191,22 @@ void app_main(void) { badge_init(); if (badge_input_button_state == 0) { printf("Starting bpp.\n"); + powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_BPP, POWER_MODE_BPP); do_bpp_bgnd(); } else { - printf("Touch wake after bpp.\n"); - xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, - &mp_task_stack[0], &mp_task_tcb, 0); - } + printf("Touch wake after bpp.\n"); + powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY); + xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, + &mp_task_stack[0], &mp_task_tcb, 0); + } break; #endif - case 3: badge_first_run(); } } else { + powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY); xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 0); } diff --git a/esp32/modmachine.c b/esp32/modmachine.c index 09a1dbc7c..2f83765c5 100644 --- a/esp32/modmachine.c +++ b/esp32/modmachine.c @@ -45,6 +45,7 @@ #include "extmod/machine_spi.h" #include "modmachine.h" #include "machine_rtc.h" +#include "powerdown.h" #if MICROPY_PY_MACHINE @@ -89,25 +90,9 @@ STATIC mp_obj_t machine_deepsleep(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_int_t expiry = args[ARG_sleep_ms].u_int; - if (expiry != 0) { - esp_deep_sleep_enable_timer_wakeup(expiry * 1000); - } - - if (machine_rtc_config.ext0_pin != -1) { - esp_deep_sleep_enable_ext0_wakeup(machine_rtc_config.ext0_pin, machine_rtc_config.ext0_level ? 1 : 0); - } - - if (machine_rtc_config.ext1_pins != 0) { - esp_deep_sleep_enable_ext1_wakeup( - machine_rtc_config.ext1_pins, - machine_rtc_config.ext1_level ? ESP_EXT1_WAKEUP_ANY_HIGH : ESP_EXT1_WAKEUP_ALL_LOW); - } - - if (machine_rtc_config.wake_on_touch) { - esp_deep_sleep_enable_touchpad_wakeup(); - } + //Let powerdown manager handle the actual power down stuff + powerCanSleepFor((int)machine_init, expiry); - esp_deep_sleep_start(); return mp_const_none; } From 434cda57eb40cb377fe9dbfb00d22bf7e0d9706c Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Tue, 1 Aug 2017 16:56:44 +0800 Subject: [PATCH 196/403] Add debug arg to power manager init --- esp32/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 31842e2c1..0ec224b08 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -191,11 +191,11 @@ void app_main(void) { badge_init(); if (badge_input_button_state == 0) { printf("Starting bpp.\n"); - powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_BPP, POWER_MODE_BPP); + powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_BPP, POWER_MODE_BPP, true); do_bpp_bgnd(); } else { printf("Touch wake after bpp.\n"); - powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY); + powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY, false); xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 0); } @@ -206,7 +206,7 @@ void app_main(void) { } } else { - powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY); + powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY, false); xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 0); } From 2490f79148ff240bf0bf5f96f3f6caa7e30f34d4 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 13:17:04 +0200 Subject: [PATCH 197/403] Revert "Allow wifi settings for service to work." This reverts commit ede709ba1021d70bed3cbdfa2b23101c86530dcc. --- esp32/modules/easyrtc.py | 15 ++++++--------- esp32/modules/services.py | 12 +----------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index a4b54d13e..4c5fbc13c 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -7,11 +7,8 @@ import machine, time # Functions -def string(print_date=False, print_time=True, timestamp = -1): - if timestamp<0: - [year, month, mday, wday, hour, minute, sec, usec] = machine.RTC().datetime() - else: - [year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp) +def string(date=False, time=True): + [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() monthstr = str(month) if (month<10): monthstr = "0"+monthstr @@ -21,15 +18,15 @@ def string(print_date=False, print_time=True, timestamp = -1): hourstr = str(hour) if (hour<10): hourstr = "0"+hourstr - minstr = str(minute) - if (minute<10): + minstr = str(min) + if (min<10): minstr = "0"+minstr output = "" - if print_date: + if date: output += daystr+"-"+monthstr+"-"+str(year) if time: output += " " - if print_time: + if time: output += hourstr+":"+minstr return output diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 4c1e10e57..ce03c2f12 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -115,7 +115,7 @@ def setup(pmCb=False, drawCb=False): if loopEnabled: try: - loopCallbacks[srv.loop] = wifiInLoop + loopCallbacks[srv.loop] = 0 except: print("[SERVICES] Loop requested but not defined in service "+app) @@ -152,14 +152,6 @@ def loop_timer_callback(tmr): requestedInterval = 99999999 newLoopCallbacks = loopCallbacks for cb in loopCallbacks: - if loopCallbacks[cb]: - print("[SERVICES] Loop needs wifi!") - if not easywifi.status(): - if not easywifi.enable(): - print("[SERVICES] Wifi not available!") - continue - else: - print("[SERVICES] Loop does not need wifi!") rqi = 0 try: rqi = cb() @@ -179,8 +171,6 @@ def loop_timer_callback(tmr): if requestedInterval>=99999999: print("[SERVICES] No loop interval returned.") requestedInterval = -1 - - easywifi.disable() # Always disable wifi try: if pmCallback(requestedInterval): From daa25744b1e9ed05f03d41b16d3927ef0250ea7c Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 13:18:04 +0200 Subject: [PATCH 198/403] Allow wifi settings for service to work. --- esp32/modules/services.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index ce03c2f12..4c1e10e57 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -115,7 +115,7 @@ def setup(pmCb=False, drawCb=False): if loopEnabled: try: - loopCallbacks[srv.loop] = 0 + loopCallbacks[srv.loop] = wifiInLoop except: print("[SERVICES] Loop requested but not defined in service "+app) @@ -152,6 +152,14 @@ def loop_timer_callback(tmr): requestedInterval = 99999999 newLoopCallbacks = loopCallbacks for cb in loopCallbacks: + if loopCallbacks[cb]: + print("[SERVICES] Loop needs wifi!") + if not easywifi.status(): + if not easywifi.enable(): + print("[SERVICES] Wifi not available!") + continue + else: + print("[SERVICES] Loop does not need wifi!") rqi = 0 try: rqi = cb() @@ -171,6 +179,8 @@ def loop_timer_callback(tmr): if requestedInterval>=99999999: print("[SERVICES] No loop interval returned.") requestedInterval = -1 + + easywifi.disable() # Always disable wifi try: if pmCallback(requestedInterval): From 4b198eb9be335445f48217ca71b3f86e7bf9452f Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 13:24:35 +0200 Subject: [PATCH 199/403] Add optional timestamp argument to easyrtc.string() --- esp32/modules/easyrtc.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index 4c5fbc13c..a4b54d13e 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -7,8 +7,11 @@ import machine, time # Functions -def string(date=False, time=True): - [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() +def string(print_date=False, print_time=True, timestamp = -1): + if timestamp<0: + [year, month, mday, wday, hour, minute, sec, usec] = machine.RTC().datetime() + else: + [year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp) monthstr = str(month) if (month<10): monthstr = "0"+monthstr @@ -18,15 +21,15 @@ def string(date=False, time=True): hourstr = str(hour) if (hour<10): hourstr = "0"+hourstr - minstr = str(min) - if (min<10): + minstr = str(minute) + if (minute<10): minstr = "0"+minstr output = "" - if date: + if print_date: output += daystr+"-"+monthstr+"-"+str(year) if time: output += " " - if time: + if print_time: output += hourstr+":"+minstr return output From 6a666c2e472e1337f2d596dbc17f99086fe203c2 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 13:25:45 +0200 Subject: [PATCH 200/403] Revert "Add optional timestamp argument to easyrtc.string()" This reverts commit 4b198eb9be335445f48217ca71b3f86e7bf9452f. --- esp32/modules/easyrtc.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index a4b54d13e..4c5fbc13c 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -7,11 +7,8 @@ import machine, time # Functions -def string(print_date=False, print_time=True, timestamp = -1): - if timestamp<0: - [year, month, mday, wday, hour, minute, sec, usec] = machine.RTC().datetime() - else: - [year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp) +def string(date=False, time=True): + [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() monthstr = str(month) if (month<10): monthstr = "0"+monthstr @@ -21,15 +18,15 @@ def string(print_date=False, print_time=True, timestamp = -1): hourstr = str(hour) if (hour<10): hourstr = "0"+hourstr - minstr = str(minute) - if (minute<10): + minstr = str(min) + if (min<10): minstr = "0"+minstr output = "" - if print_date: + if date: output += daystr+"-"+monthstr+"-"+str(year) if time: output += " " - if print_time: + if time: output += hourstr+":"+minstr return output From 0fe96cb620e28b2d1cef557f5c52dd233f4e6470 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 13:26:40 +0200 Subject: [PATCH 201/403] Add optional timestamp argument to easyrtc.string() --- esp32/modules/easyrtc.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index 4c5fbc13c..a4b54d13e 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -7,8 +7,11 @@ import machine, time # Functions -def string(date=False, time=True): - [year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime() +def string(print_date=False, print_time=True, timestamp = -1): + if timestamp<0: + [year, month, mday, wday, hour, minute, sec, usec] = machine.RTC().datetime() + else: + [year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp) monthstr = str(month) if (month<10): monthstr = "0"+monthstr @@ -18,15 +21,15 @@ def string(date=False, time=True): hourstr = str(hour) if (hour<10): hourstr = "0"+hourstr - minstr = str(min) - if (min<10): + minstr = str(minute) + if (minute<10): minstr = "0"+minstr output = "" - if date: + if print_date: output += daystr+"-"+monthstr+"-"+str(year) if time: output += " " - if time: + if print_time: output += hourstr+":"+minstr return output From d7989182028ef25c94a4fa4e0cad17b4d4ef62a8 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 13:52:42 +0200 Subject: [PATCH 202/403] Rename sec to second --- esp32/modules/easyrtc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index a4b54d13e..26761abe2 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -9,7 +9,7 @@ # Functions def string(print_date=False, print_time=True, timestamp = -1): if timestamp<0: - [year, month, mday, wday, hour, minute, sec, usec] = machine.RTC().datetime() + [year, month, mday, wday, hour, minute, second, usec] = machine.RTC().datetime() else: [year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp) monthstr = str(month) From 324e92489aeb3baf8a67d1b49d539d91201f5b03 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 13:59:59 +0200 Subject: [PATCH 203/403] ... --- esp32/modules/easyrtc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esp32/modules/easyrtc.py b/esp32/modules/easyrtc.py index 26761abe2..757663ead 100644 --- a/esp32/modules/easyrtc.py +++ b/esp32/modules/easyrtc.py @@ -9,9 +9,10 @@ # Functions def string(print_date=False, print_time=True, timestamp = -1): if timestamp<0: - [year, month, mday, wday, hour, minute, second, usec] = machine.RTC().datetime() + [year, month, mday, wday, hour, minute, second, microseconds] = machine.RTC().datetime() else: [year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp) + #mday: day in month, wday: day in week, yday: day in year monthstr = str(month) if (month<10): monthstr = "0"+monthstr From bfd2b4e710dd79b7cc82c74bc77acb714984e0ec Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 15:08:43 +0200 Subject: [PATCH 204/403] As requested --- esp32/modules/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 4c1e10e57..22e41ae1a 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -85,8 +85,8 @@ def setup(pmCb=False, drawCb=False): # Import the service.py script try: srv = __import__('lib/'+app+'/service') - except: - print("[SERVICES] Could not import service of app "+app) + except BaseException as msg: + print("[SERVICES] Could not import service of app "+app+": ", msg) continue #Skip the app if wifiInSetup: From 92b06df397c737e602eb9854ba17cb49f7440c1c Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 15:14:12 +0200 Subject: [PATCH 205/403] Forgot setting a variable to global. --- esp32/modules/services.py | 1 + 1 file changed, 1 insertion(+) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 22e41ae1a..2a9bb8b8c 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -183,6 +183,7 @@ def loop_timer_callback(tmr): easywifi.disable() # Always disable wifi try: + global pmCallback if pmCallback(requestedInterval): print("[SERVICES] Loop timer (re-)started") tmr.init(period=requestedInterval*1000, mode=machine.Timer.ONE_SHOT, callback=loop_timer_callback) From adad721e2aa1a3de9b31321465a1f5ac42733203 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 16:55:14 +0200 Subject: [PATCH 206/403] Replace False with None as default value for the callbacks in setup() --- esp32/modules/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 2a9bb8b8c..ecc977bd7 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -12,7 +12,7 @@ loopCallbacks = {} #Dict containing: {:} drawCallbacks = [] #List containing draw functions -def setup(pmCb=False, drawCb=False): +def setup(pmCb=None, drawCb=None): global services global loopCallbacks global drawCallbacks From 427c338d15f920d16dd19c37d664e663c567db4e Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 20:25:24 +0200 Subject: [PATCH 207/403] ... --- esp32/modules/services.py | 36 ++++++++++++++++++++++-------------- esp32/modules/splash.py | 28 +++++++++++----------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index ecc977bd7..3574b8975 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -1,5 +1,5 @@ # File: services.py -# Version: 2 +# Version: 3 # API version: 1 # Description: Background services for SHA2017 badge # License: MIT @@ -12,7 +12,7 @@ loopCallbacks = {} #Dict containing: {:} drawCallbacks = [] #List containing draw functions -def setup(pmCb=None, drawCb=None): +def setup(pmCb=None, drawCb=None, timerId=0): global services global loopCallbacks global drawCallbacks @@ -133,7 +133,7 @@ def setup(pmCb=None, drawCb=None): global loopTimer if len(loopCallbacks)>0: print("[SERVICES] There are loop callbacks, starting loop timer!") - loopTimer = machine.Timer(0) #TODO: how to get this number?!? + loopTimer = machine.Timer(timerId) loop_timer_callback(loopTimer) hasLoopTimer = True @@ -142,7 +142,7 @@ def setup(pmCb=None, drawCb=None): global drawTimer if len(drawCallbacks)>0 and drawCb: print("[SERVICES] There are draw callbacks, starting draw timer!") - drawTimer = machine.Timer(1) #TODO: how to get this number?!? + drawTimer = machine.Timer(timerId+1) draw_timer_callback(drawTimer) hasDrawTimer = True return [hasLoopTimer, hasDrawTimer] @@ -168,7 +168,7 @@ def loop_timer_callback(tmr): newLoopCallbacks.pop(cb) continue if rqi>0 and rqi0 and rqi=99999999: print("[SERVICES] No draw interval returned.") requestedInterval = -1 + + if requestedInterval<100: + print("[SERVICES] A service requested a draw interval < 100 ms. Forcing 100 ms.") + requestedInterval = 100 if len(drawCallbacks)>0 and requestedInterval>=0: print("[SERVICES] New draw requested in "+str(requestedInterval)+".") - tmr.init(period=requestedInterval*1000, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) + tmr.init(period=requestedInterval, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) drawCallback(True) # Complete draw diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 02b6f6beb..cc3098e05 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -18,17 +18,17 @@ def power_management(timeUntilNextTick): global requestedStandbyTime requestedStandbyTime = timeUntilNextTick - if timeUntilNextTick<0 or timeUntilNextTick>=60*5: - print("[PM] Next tick after more than 5 minutes (MAY BPP).") + if timeUntilNextTick<0 or timeUntilNextTick>=60*5000: + print("[PM] Next tick after more than 5 minutes (can do bpp).") global enableBpp enableBpp = True power_countdown_reset(0) - elif (timeUntilNextTick<=30): - print("[PM] Next loop in "+str(timeUntilNextTick)+" seconds (STAY AWAKE).") + elif (timeUntilNextTick<=30000): + print("[PM] Next loop in "+str(timeUntilNextTick)+" ms (stay awake).") power_countdown_reset(timeUntilNextTick) return True #Service loop timer can be restarted else: - print("[PM] Next loop in "+str(timeUntilNextTick)+" seconds (MAY SLEEP).") + print("[PM] Next loop in "+str(timeUntilNextTick)+" ms (can sleep).") global enableBpp enableBpp = False power_countdown_reset(0) @@ -44,9 +44,9 @@ def power_countdown_reset(timeUntilNextTick=-1): print("POWER TIMER DEINIT FAILED?!?!?") if timeUntilNextTick>=0: powerCountdownOffset = timeUntilNextTick - newTarget = powerCountdownOffset+badge.nvs_get_u8('splash', 'urt', 5) #User React Time (in seconds) + newTarget = powerCountdownOffset+badge.nvs_get_u16('splash', 'urt', 5000) #User React Time (in ms) print("[SPLASH] Power countdown reset to "+str(newTarget)) - powerTimer.init(period=newTarget*1000, mode=machine.Timer.ONE_SHOT, callback=power_countdown_callback) + powerTimer.init(period=newTarget, mode=machine.Timer.ONE_SHOT, callback=power_countdown_callback) def power_countdown_callback(tmr): global enableBpp @@ -55,16 +55,10 @@ def power_countdown_callback(tmr): draw(True, True) global requestedStandbyTime if requestedStandbyTime>0: - if enableBpp: - print("[PM] BPP for "+str(requestedStandbyTime)+" seconds.") - #appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes - deepsleep.start_sleeping(requestedStandbyTime*1000) - else: - print("[PM] Sleep for "+str(round())+" seconds.") - deepsleep.start_sleeping(requestedStandbyTime*1000) + print("[PM] Sleep for "+str(requestedStandbyTime)+" ms.") + deepsleep.start_sleeping(requestedStandbyTime) else: print("[PM] BPP forever.") - #appglue.start_bpp(-1) deepsleep.start_sleeping() # Graphics @@ -269,7 +263,7 @@ def splash_input_init(): ### PROGRAM -powerTimer = machine.Timer(2) #TODO: how to get this number?!? +powerTimer = machine.Timer(0) #TODO: how to get this number?!? # Load settings from NVS otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) @@ -318,7 +312,7 @@ def splash_input_init(): # Initialize services print("Initialize services") -[srvDoesSleep, srvDoesDraw] = services.setup(power_management, draw) +[srvDoesSleep, srvDoesDraw] = services.setup(power_management, draw, 1) # Disable WiFi if active print("Disable WiFi if active") From dd7cb07488b3da08f4e545a0539e4cb630215526 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Tue, 1 Aug 2017 22:11:00 +0200 Subject: [PATCH 208/403] ...2 --- esp32/.machine_timer.c.kate-swp | Bin 0 -> 174 bytes esp32/modules/services.py | 50 ++++++++++++++++++-------------- esp32/modules/splash.py | 12 ++++++-- 3 files changed, 39 insertions(+), 23 deletions(-) create mode 100644 esp32/.machine_timer.c.kate-swp diff --git a/esp32/.machine_timer.c.kate-swp b/esp32/.machine_timer.c.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..28ae905641872582801178b2ff3503e0bcb97db0 GIT binary patch literal 174 zcmZQzU=Z?7EJ;-eE>A2_aLdd|RWQ;sU|?VnxgPhs|6qsbuEGU(-8e0$Xa()rb1^s^ zC{qc<46ebRK(Y$N1OgTXAV3JQ0EJX@3*rlkGV@B(G{BUOf>KCkZfcQ+YJs(al8!=g gYEGJ_wQFz?P%X$9F(6h)7y;rkDj}pnMoPK@057~IIRF3v literal 0 HcmV?d00001 diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 3574b8975..644af7656 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -12,11 +12,16 @@ loopCallbacks = {} #Dict containing: {:} drawCallbacks = [] #List containing draw functions -def setup(pmCb=None, drawCb=None, timerId=0): +def setup(loopTmr, drawTmr, pmCb=None, drawCb=None): global services global loopCallbacks global drawCallbacks + global loopTimer + loopTimer = loopTmr + global drawTimer + drawTimer = drawTmr + if pmCb: print("[SERVICES] Power management callback registered") global pmCallback @@ -130,19 +135,15 @@ def setup(pmCb=None, drawCb=None, timerId=0): # Create loop timer hasLoopTimer = False - global loopTimer if len(loopCallbacks)>0: print("[SERVICES] There are loop callbacks, starting loop timer!") - loopTimer = machine.Timer(timerId) loop_timer_callback(loopTimer) hasLoopTimer = True # Create draw timer hasDrawTimer = False - global drawTimer if len(drawCallbacks)>0 and drawCb: print("[SERVICES] There are draw callbacks, starting draw timer!") - drawTimer = machine.Timer(timerId+1) draw_timer_callback(drawTimer) hasDrawTimer = True return [hasLoopTimer, hasDrawTimer] @@ -180,19 +181,23 @@ def loop_timer_callback(tmr): print("[SERVICES] No loop interval returned.") requestedInterval = -1 - if requestedInterval<100: - print("[SERVICES] A service requested a loop interval < 100 ms. Forcing 100 ms.") - requestedInterval = 100 + if requestedInterval<1000: + requestedInterval = 1000 easywifi.disable() # Always disable wifi - #try: - global pmCallback - if pmCallback(requestedInterval): - print("[SERVICES] Loop timer (re-)started "+str(requestedInterval)) - tmr.init(period=requestedInterval, mode=machine.Timer.ONE_SHOT, callback=loop_timer_callback) - #except: - # print("[SERVICES] Error in power management callback!") + try: + global pmCallback + if pmCallback(requestedInterval): + print("[SERVICES] Loop timer (re-)started "+str(requestedInterval)) + tmr.deinit() + try: + tmrperiod = round(requestedInterval/1000)*1000 + tmr.init(period=tmrperiod, mode=machine.Timer.ONE_SHOT, callback=loop_timer_callback) + except BaseException as msg: + print("TIMER INIT ERROR: LOOP TIMER - ", msg) + except: + print("[SERVICES] Error in power management callback!") def draw_timer_callback(tmr): global drawCallback #The function that allows us to hook into our host @@ -228,14 +233,17 @@ def draw_timer_callback(tmr): print("[SERVICES] No draw interval returned.") requestedInterval = -1 - if requestedInterval<100: - print("[SERVICES] A service requested a draw interval < 100 ms. Forcing 100 ms.") - requestedInterval = 100 + if requestedInterval<1000: + requestedInterval = 1000 if len(drawCallbacks)>0 and requestedInterval>=0: - print("[SERVICES] New draw requested in "+str(requestedInterval)+".") - tmr.init(period=requestedInterval, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) - + print("[SERVICES] New draw requested in "+str(requestedInterval)) + tmr.deinit() + try: + tmrperiod = round(requestedInterval/1000)*1000 + tmr.init(period=tmrperiod, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) + except BaseException as msg: + print("TIMER INIT ERROR: DRAW TIMER - ",msg) drawCallback(True) # Complete draw def force_draw(disableTimer): diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index cc3098e05..0a154cee9 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -263,7 +263,15 @@ def splash_input_init(): ### PROGRAM -powerTimer = machine.Timer(0) #TODO: how to get this number?!? +# Init hardware timers +powerTimer = machine.Timer(0) +powerTimer.deinit() +loopTimer = machine.Timer(1) +loopTimer.deinit() +drawTimer = machine.Timer(2) +drawTimer.deinit() +unusedTimer = machine.Timer(3) +unusedTimer.deinit() # Load settings from NVS otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) @@ -312,7 +320,7 @@ def splash_input_init(): # Initialize services print("Initialize services") -[srvDoesSleep, srvDoesDraw] = services.setup(power_management, draw, 1) +[srvDoesSleep, srvDoesDraw] = services.setup(loopTimer, drawTimer, power_management, draw) # Disable WiFi if active print("Disable WiFi if active") From 2b2686039239a05140cdb300f10236eefe5da2c6 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Tue, 1 Aug 2017 23:52:01 +0200 Subject: [PATCH 209/403] Add some warning notes when using badge.leds_send_data() incorrectly --- esp32/modbadge.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index c22f48455..297ae8425 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -368,11 +368,24 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_leds_disable_obj, badge_leds_disable_); STATIC mp_obj_t badge_leds_send_data_(mp_uint_t n_args, const mp_obj_t *args) { - mp_uint_t len = mp_obj_get_int(args[1]); + bool is_bytes = MP_OBJ_IS_TYPE(args[0], &mp_type_bytes); + + if (!is_bytes) { + printf("badge.leds_send_data() used with string object instead of bytestring object.\n"); + } + + mp_uint_t len; uint8_t *leds = (uint8_t *)mp_obj_str_get_data(args[0], &len); + if (n_args > 1) { + mp_uint_t arglen = mp_obj_get_int(args[1]); + if (len != arglen) { + printf("badge.leds_send_data() len mismatch. (%d != %d)\n", len, arglen); + } + } + return mp_obj_new_int(badge_leds_send_data(leds, len)); } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_leds_send_data_obj, 2,2 ,badge_leds_send_data_); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_leds_send_data_obj, 1,2 ,badge_leds_send_data_); #endif #if defined(PORTEXP_PIN_NUM_VIBRATOR) || defined(MPR121_PIN_NUM_VIBRATOR) From 52be5e92126c0f250d9277321aa2a00c8e32a2c4 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 00:12:37 +0200 Subject: [PATCH 210/403] IT COMPILES, SHIP IT! --- esp32/.machine_timer.c.kate-swp | Bin 174 -> 0 bytes esp32/modules/services.py | 51 ++++++------------- esp32/modules/splash.py | 85 ++++++++++++++++++++++++-------- 3 files changed, 79 insertions(+), 57 deletions(-) delete mode 100644 esp32/.machine_timer.c.kate-swp diff --git a/esp32/.machine_timer.c.kate-swp b/esp32/.machine_timer.c.kate-swp deleted file mode 100644 index 28ae905641872582801178b2ff3503e0bcb97db0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 174 zcmZQzU=Z?7EJ;-eE>A2_aLdd|RWQ;sU|?VnxgPhs|6qsbuEGU(-8e0$Xa()rb1^s^ zC{qc<46ebRK(Y$N1OgTXAV3JQ0EJX@3*rlkGV@B(G{BUOf>KCkZfcQ+YJs(al8!=g gYEGJ_wQFz?P%X$9F(6h)7y;rkDj}pnMoPK@057~IIRF3v diff --git a/esp32/modules/services.py b/esp32/modules/services.py index 644af7656..d75644cf3 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -12,16 +12,11 @@ loopCallbacks = {} #Dict containing: {:} drawCallbacks = [] #List containing draw functions -def setup(loopTmr, drawTmr, pmCb=None, drawCb=None): +def setup(pmCb=None, drawCb=None): global services global loopCallbacks global drawCallbacks - global loopTimer - loopTimer = loopTmr - global drawTimer - drawTimer = drawTmr - if pmCb: print("[SERVICES] Power management callback registered") global pmCallback @@ -136,19 +131,17 @@ def setup(loopTmr, drawTmr, pmCb=None, drawCb=None): # Create loop timer hasLoopTimer = False if len(loopCallbacks)>0: - print("[SERVICES] There are loop callbacks, starting loop timer!") - loop_timer_callback(loopTimer) + print("[SERVICES] There are loop callbacks!") hasLoopTimer = True # Create draw timer hasDrawTimer = False if len(drawCallbacks)>0 and drawCb: - print("[SERVICES] There are draw callbacks, starting draw timer!") - draw_timer_callback(drawTimer) + print("[SERVICES] There are draw callbacks!") hasDrawTimer = True return [hasLoopTimer, hasDrawTimer] -def loop_timer_callback(tmr): +def loop_timer(): global loopCallbacks requestedInterval = 99999999 newLoopCallbacks = loopCallbacks @@ -180,26 +173,19 @@ def loop_timer_callback(tmr): if requestedInterval>=99999999: print("[SERVICES] No loop interval returned.") requestedInterval = -1 - - if requestedInterval<1000: - requestedInterval = 1000 - + easywifi.disable() # Always disable wifi try: global pmCallback if pmCallback(requestedInterval): print("[SERVICES] Loop timer (re-)started "+str(requestedInterval)) - tmr.deinit() - try: - tmrperiod = round(requestedInterval/1000)*1000 - tmr.init(period=tmrperiod, mode=machine.Timer.ONE_SHOT, callback=loop_timer_callback) - except BaseException as msg: - print("TIMER INIT ERROR: LOOP TIMER - ", msg) + return requestedInterval except: print("[SERVICES] Error in power management callback!") + return 0 -def draw_timer_callback(tmr): +def draw_timer(): global drawCallback #The function that allows us to hook into our host global drawCallbacks #The functions of the services requestedInterval = 99999999 @@ -234,28 +220,21 @@ def draw_timer_callback(tmr): requestedInterval = -1 if requestedInterval<1000: + #Draw at most once a second + print("[SERVICES] Can't draw more than once a second!") requestedInterval = 1000 + retVal = 0 + if len(drawCallbacks)>0 and requestedInterval>=0: print("[SERVICES] New draw requested in "+str(requestedInterval)) - tmr.deinit() - try: - tmrperiod = round(requestedInterval/1000)*1000 - tmr.init(period=tmrperiod, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) - except BaseException as msg: - print("TIMER INIT ERROR: DRAW TIMER - ",msg) + retVal = requestedInterval drawCallback(True) # Complete draw + return retVal def force_draw(disableTimer): if disableTimer: - print("[SERVICES] Drawing services one last time before sleep...") - global drawTimer - try: - drawTimer.deinit() - except: - pass - else: - print("[SERVICES] Drawing at boot...") + print("[SERVICES] FIXME!!!!!!") global drawCallbacks if len(drawCallbacks)>0: y = ugfx.height() diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 0a154cee9..278003477 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -38,17 +38,19 @@ def power_management(timeUntilNextTick): def power_countdown_reset(timeUntilNextTick=-1): global powerTimer global powerCountdownOffset - try: - powerTimer.deinit() - except: - print("POWER TIMER DEINIT FAILED?!?!?") - if timeUntilNextTick>=0: - powerCountdownOffset = timeUntilNextTick - newTarget = powerCountdownOffset+badge.nvs_get_u16('splash', 'urt', 5000) #User React Time (in ms) - print("[SPLASH] Power countdown reset to "+str(newTarget)) - powerTimer.init(period=newTarget, mode=machine.Timer.ONE_SHOT, callback=power_countdown_callback) -def power_countdown_callback(tmr): + global scheduler + found = False + for i in range(0, len(scheduler)): + if (scheduler[i]["cb"]==power_countdown_callback): + scheduler[i]["pos"] = 0 + scheduler[i]["target"] = powerCountdownOffset+badge.nvs_get_u16('splash', 'urt', 5000) + found = True + break + if not found: + scheduler_add(powerCountdownOffset+badge.nvs_get_u16('splash', 'urt', 5000), power_countdown_callback) + +def power_countdown_callback(): global enableBpp draw(False, True) services.force_draw(True) @@ -260,18 +262,45 @@ def splash_input_init(): ugfx.input_attach(ugfx.JOY_DOWN, splash_input_other) ugfx.input_attach(ugfx.JOY_LEFT, splash_input_other) ugfx.input_attach(ugfx.JOY_RIGHT, splash_input_other) + +# TIMERS + +scheduler = [] + +loopTimerPos = 0 +loopTimerTarget = 0 +drawTimerPos = 0 +drawTimerTarget = 0 +powerTimerPos = 0 +powerTimerTarget = 0 + +def scheduler_add(target, callback): + global scheduler + item = {"pos":0, "target":target, "cb":callback} + scheduler.append(item) + +def timer_callback(tmr): + global scheduler + newScheduler = scheduler + for i in range(0, len(scheduler)): + scheduler[i]["pos"] += 25 + if scheduler[i]["pos"] > scheduler[i]["target"]: + print("Target reached "+str(i)) + newTarget = scheduler[i]["cb"]() + if newTarget > 0: + print("New target "+str(i)) + newScheduler[i]["pos"] = 0 + newScheduler[i]["target"] = newTarget + else: + print("Discard "+str(i)) + newScheduler[i]["pos"] = -1 + newScheduler[i]["target"] = -1 + ### PROGRAM -# Init hardware timers -powerTimer = machine.Timer(0) -powerTimer.deinit() -loopTimer = machine.Timer(1) -loopTimer.deinit() -drawTimer = machine.Timer(2) -drawTimer.deinit() -unusedTimer = machine.Timer(3) -unusedTimer.deinit() +timer = machine.Timer(0) +timer.init(period=25, mode=machine.Timer.PERIODIC, callback=timer_callback) # Load settings from NVS otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) @@ -320,7 +349,21 @@ def splash_input_init(): # Initialize services print("Initialize services") -[srvDoesSleep, srvDoesDraw] = services.setup(loopTimer, drawTimer, power_management, draw) +[srvDoesLoop, srvDoesDraw] = services.setup(power_management, draw) + +if srvDoesLoop: + print("Service does loop.") + requestedInterval = services.loop_timer() + if requestedInterval>0: + scheduler_add(requestedInterval, services.loop_timer) + #loopTimer.init(period=requestedInterval, mode=machine.Timer.ONE_SHOT, callback=loop_timer_callback) + +if srvDoesDraw: + print("Service does draw.") + requestedInterval = services.draw_timer() + if requestedInterval>0: + scheduler_add(requestedInterval, services.draw_timer) + #drawTimer.init(period=requestedInterval, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) # Disable WiFi if active print("Disable WiFi if active") @@ -337,7 +380,7 @@ def splash_input_init(): draw(False) draw(True) -if not srvDoesSleep: +if not srvDoesLoop: print("[SPLASH] No service sleep!") power_countdown_reset(-1) From 2adf628aafffb6f994554aca2910c1c144962cd2 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 00:19:40 +0200 Subject: [PATCH 211/403] Changed api version to 2 --- esp32/modules/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index d75644cf3..b7745ba49 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -1,6 +1,6 @@ # File: services.py # Version: 3 -# API version: 1 +# API version: 2 # Description: Background services for SHA2017 badge # License: MIT # Authors: Renze Nicolai @@ -68,7 +68,7 @@ def setup(pmCb=None, drawCb=None): wifiInLoop = False # True if wifi needed in loop try: - if description['apiVersion']!=1: + if description['apiVersion']!=2: print("[SERVICES] Service for "+app+" is not compatible with current firmware") continue #Skip the app wifiInSetup = description['wifi']['setup'] From 59af7a79ad7d873bad6d5dec6e6453435d49d766 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 00:51:11 +0200 Subject: [PATCH 212/403] Add nice change by raboof --- esp32/modules/services.py | 27 ++++++++++++++++----------- esp32/modules/splash.py | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/esp32/modules/services.py b/esp32/modules/services.py index b7745ba49..27d290f7d 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/services.py @@ -6,7 +6,7 @@ # Authors: Renze Nicolai # Thomas Roos -import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge, machine +import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge, machine, sys services = [] #List containing all the service objects loopCallbacks = {} #Dict containing: {:} @@ -85,8 +85,9 @@ def setup(pmCb=None, drawCb=None): # Import the service.py script try: srv = __import__('lib/'+app+'/service') - except BaseException as msg: - print("[SERVICES] Could not import service of app "+app+": ", msg) + except BaseException as e: + print("[SERVICES] Could not import service of app "+app+": ") + sys.print_exception(e) continue #Skip the app if wifiInSetup: @@ -109,8 +110,9 @@ def setup(pmCb=None, drawCb=None): try: srv.setup() - except BaseException as msg: - print("[SERVICES] Exception in service setup "+app+": ", msg) + except BaseException as e: + print("[SERVICES] Exception in service setup "+app+":") + sys.print_exception(e) continue if loopEnabled: @@ -157,8 +159,9 @@ def loop_timer(): rqi = 0 try: rqi = cb() - except BaseException as msg: - print("[SERVICES] Exception in service loop: ", msg) + except BaseException as e: + print("[SERVICES] Exception in service loop:") + sys.print_exception(e) newLoopCallbacks.pop(cb) continue if rqi>0 and rqi0 and rqi Date: Wed, 2 Aug 2017 01:03:50 +0200 Subject: [PATCH 213/403] set type after determining type.. --- extmod/vfs_native_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extmod/vfs_native_file.c b/extmod/vfs_native_file.c index 12b76f846..4a2e1b8b3 100644 --- a/extmod/vfs_native_file.c +++ b/extmod/vfs_native_file.c @@ -137,7 +137,6 @@ STATIC const mp_arg_t file_open_args[] = { STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_arg_val_t *args) { pyb_file_obj_t *o = m_new_obj_with_finaliser(pyb_file_obj_t); - o->base.type = type; const char *fname = mp_obj_str_get_str(args[0].u_obj); const char *mode_s = mp_obj_str_get_str(args[1].u_obj); @@ -181,6 +180,8 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar } } + o->base.type = type; + assert(vfs != NULL); int fd = open(fname, mode_x | mode_rw, 0644); if (fd == -1) { From 105480239677328678a47565ce3382d76df466ac Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 01:06:24 +0200 Subject: [PATCH 214/403] Fix bug in timer_callback --- esp32/modules/splash.py | 14 ++------ esp32/modules/virtualtimers.py | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 esp32/modules/virtualtimers.py diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 1ce92ec2f..51d82cccf 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -268,13 +268,6 @@ def splash_input_init(): scheduler = [] -loopTimerPos = 0 -loopTimerTarget = 0 -drawTimerPos = 0 -drawTimerTarget = 0 -powerTimerPos = 0 -powerTimerTarget = 0 - def scheduler_add(target, callback): global scheduler item = {"pos":0, "target":target, "cb":callback} @@ -286,16 +279,13 @@ def timer_callback(tmr): for i in range(0, len(scheduler)): scheduler[i]["pos"] += 25 if scheduler[i]["pos"] > scheduler[i]["target"]: - print("Target reached "+str(i)) newTarget = scheduler[i]["cb"]() if newTarget > 0: - print("New target "+str(i)) newScheduler[i]["pos"] = 0 newScheduler[i]["target"] = newTarget else: - print("Discard "+str(i)) - newScheduler[i]["pos"] = -1 - newScheduler[i]["target"] = -1 + newScheduler.pop(i) + scheduler = newScheduler ### PROGRAM diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py new file mode 100644 index 000000000..cceed4684 --- /dev/null +++ b/esp32/modules/virtualtimers.py @@ -0,0 +1,62 @@ +# File: virtualtimers.py +# Version: 1 +# Description: Uses one hardware timer to simulate timers +# License: MIT +# Authors: Renze Nicolai + +scheduler = [] +timer = machine.Timer(0) +period = 0 + +def new(target, callback): + global scheduler + item = {"pos":0, "target":target, "cb":callback} + scheduler.append(item) + +def delete(callback): + global scheduler + newScheduler = scheduler + found = False + for i in range(0, len(scheduler)): + if (scheduler[i]["cb"]==callback): + newScheduler.pop(i) + found = True + break + scheduler = newScheduler + return found + +def update(target, callback): + global scheduler + found = False + for i in range(0, len(scheduler)): + if (scheduler[i]["cb"]==callback): + scheduler[i]["target"] = target + found = True + return found + +def activate(p): + global timer + global period + if p<1: + return + period = p + timer.init(period=p, mode=machine.Timer.PERIODIC, callback=timer_callback) + +def stop(): + global timer + timer.deinit() + +def timer_callback(tmr): + global scheduler + global period + newScheduler = scheduler + for i in range(0, len(scheduler)): + scheduler[i]["pos"] += period + if scheduler[i]["pos"] > scheduler[i]["target"]: + newTarget = scheduler[i]["cb"]() + if newTarget > 0: + newScheduler[i]["pos"] = 0 + newScheduler[i]["target"] = newTarget + else: + newScheduler.pop(i) + scheduler = newScheduler From 04521e30dc2343eb08b995fac24db7408dc5ffb6 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 01:12:59 +0200 Subject: [PATCH 215/403] Fix --- esp32/modules/virtualtimers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index cceed4684..ed3560642 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -4,6 +4,8 @@ # License: MIT # Authors: Renze Nicolai +import machine + scheduler = [] timer = machine.Timer(0) period = 0 From 5710e0ec81d404c3f9047dc5441951135109a542 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 02:46:14 +0200 Subject: [PATCH 216/403] Aww yiss... complete overhaul... again... just... wow... --- esp32/modules/splash.py | 288 +++---------------------- esp32/modules/tasks/otacheck.py | 43 ++++ esp32/modules/tasks/powermanagement.py | 56 +++++ esp32/modules/tasks/resourcescheck.py | 32 +++ esp32/modules/{ => tasks}/services.py | 88 ++------ esp32/modules/tasks/sponsorscheck.py | 40 ++++ esp32/modules/virtualtimers.py | 28 ++- 7 files changed, 244 insertions(+), 331 deletions(-) create mode 100644 esp32/modules/tasks/otacheck.py create mode 100644 esp32/modules/tasks/powermanagement.py create mode 100644 esp32/modules/tasks/resourcescheck.py rename esp32/modules/{ => tasks}/services.py (72%) create mode 100644 esp32/modules/tasks/sponsorscheck.py diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 51d82cccf..aa3eafddc 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,67 +1,19 @@ # File: splash.py -# Version: 4 +# Version: 5 # Description: Homescreen for SHA2017 badge # License: MIT # Authors: Renze Nicolai # Thomas Roos -import ugfx, time, ntp, badge, machine, deepsleep, network, esp, gc -import appglue, services - +import ugfx, time, badge, machine, deepsleep, gc +import appglue, virtualtimers import easydraw, easywifi, easyrtc -# Power management - -enableBpp = True -requestedStandbyTime = 0 - -def power_management(timeUntilNextTick): - global requestedStandbyTime - requestedStandbyTime = timeUntilNextTick - if timeUntilNextTick<0 or timeUntilNextTick>=60*5000: - print("[PM] Next tick after more than 5 minutes (can do bpp).") - global enableBpp - enableBpp = True - power_countdown_reset(0) - elif (timeUntilNextTick<=30000): - print("[PM] Next loop in "+str(timeUntilNextTick)+" ms (stay awake).") - power_countdown_reset(timeUntilNextTick) - return True #Service loop timer can be restarted - else: - print("[PM] Next loop in "+str(timeUntilNextTick)+" ms (can sleep).") - global enableBpp - enableBpp = False - power_countdown_reset(0) - return False - -powerCountdownOffset = 0 -def power_countdown_reset(timeUntilNextTick=-1): - global powerTimer - global powerCountdownOffset - - global scheduler - found = False - for i in range(0, len(scheduler)): - if (scheduler[i]["cb"]==power_countdown_callback): - scheduler[i]["pos"] = 0 - scheduler[i]["target"] = powerCountdownOffset+badge.nvs_get_u16('splash', 'urt', 5000) - found = True - break - if not found: - scheduler_add(powerCountdownOffset+badge.nvs_get_u16('splash', 'urt', 5000), power_countdown_callback) - -def power_countdown_callback(): - global enableBpp - draw(False, True) - services.force_draw(True) - draw(True, True) - global requestedStandbyTime - if requestedStandbyTime>0: - print("[PM] Sleep for "+str(requestedStandbyTime)+" ms.") - deepsleep.start_sleeping(requestedStandbyTime) - else: - print("[PM] Sleep forever.") - deepsleep.start_sleeping() +import tasks.powermanagement as pm +import tasks.otacheck as otac +import tasks.resourcescheck as resc +import tasks.sponsorscheck as spoc +import tasks.services as services # Graphics @@ -78,8 +30,7 @@ def draw(mode, goingToSleep=False): info2 = 'Press any key to wake up' else: info1 = 'Press start to open the launcher' - global otaAvailable - if otaAvailable: + if otac.available(False): info2 = 'Press select to start OTA update' else: info2 = '' @@ -100,107 +51,6 @@ def draw(mode, goingToSleep=False): if vBatt>500: ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) -# OTA update checking - -def splash_ota_download_info(): - import urequests as requests - easydraw.msg("Checking for updates...") - result = False - try: - data = requests.get("https://badge.sha2017.org/version") - except: - easydraw.msg("Error: could not download JSON!") - time.sleep(5) - return False - try: - result = data.json() - except: - data.close() - easydraw.msg("Error: could not decode JSON!") - time.sleep(5) - return False - data.close() - return result - -def splash_ota_check(): - if not easywifi.status(): - if not easywifi.enable(): - return False - - info = splash_ota_download_info() - if info: - import version - if info["build"] > version.build: - badge.nvs_set_u8('badge','OTA.ready',1) - return True - - badge.nvs_set_u8('badge','OTA.ready',0) - return False - -def splash_ota_start(): - appglue.start_ota() - -# Resources -def splash_resources_install(): - easydraw.msg("Installing resources...") - if not easywifi.status(): - if not easywifi.enable(): - return False - import woezel - woezel.install("resources") - appglue.home() - -def splash_resources_check(): - needToInstall = True - try: - fp = open("/lib/resources/version", "r") - version = int(fp.read(99)) - print("[SPLASH] Current resources version: "+str(version)) - if version>=2: - needToInstall = False - except: - pass - if needToInstall: - print("[SPLASH] Resources need to be updated!") - splash_resources_install() - return True - return False - -# Sponsors - -def splash_sponsors_install(): - if not easywifi.status(): - if not easywifi.enable(): - return False - print("[SPLASH] Installing sponsors...") - easydraw.msg("Installing sponsors...") - import woezel - woezel.install("sponsors") - easydraw.msg("Done!") - -def splash_sponsors_show(): - needToInstall = True - version = 0 - try: - fp = open("/lib/sponsors/version", "r") - version = int(fp.read(99)) - print("[SPLASH] Current sponsors version: "+str(version)) - except: - print("[SPLASH] Sponsors not installed.") - if version>=14: - needToInstall = False - if needToInstall: - splash_sponsors_install() - try: - fp = open("/lib/sponsors/version", "r") - version = int(fp.read(99)) - # Now we know for sure that a version of the sponsors app has been installed - badge.nvs_set_u8('sponsors', 'shown', 1) - appglue.start_app("sponsors") - except: - pass - - # About def splash_about_countdown_reset(): @@ -232,24 +82,19 @@ def splash_input_a(pressed): if pressed: print("[SPLASH] A button pressed") splash_about_countdown_trigger() - power_countdown_reset() + pm.feed() def splash_input_select(pressed): if pressed: print("[SPLASH] Select button pressed") - global otaAvailable - if otaAvailable: - splash_ota_start() - power_countdown_reset() - -#def splash_input_left(pressed): -# if pressed: -# appglue.start_bpp() + if otac.available(False): + appglue.start_ota() + pm.feed() def splash_input_other(pressed): if pressed: print("[SPLASH] Other button pressed") - power_countdown_reset() + pm.feed() def splash_input_init(): print("[SPLASH] Inputs attached") @@ -262,52 +107,25 @@ def splash_input_init(): ugfx.input_attach(ugfx.JOY_DOWN, splash_input_other) ugfx.input_attach(ugfx.JOY_LEFT, splash_input_other) ugfx.input_attach(ugfx.JOY_RIGHT, splash_input_other) - - -# TIMERS -scheduler = [] - -def scheduler_add(target, callback): - global scheduler - item = {"pos":0, "target":target, "cb":callback} - scheduler.append(item) +# Power management + +def onSleep(idleTime): + draw(False, True) + services.force_draw() + draw(True, True) -def timer_callback(tmr): - global scheduler - newScheduler = scheduler - for i in range(0, len(scheduler)): - scheduler[i]["pos"] += 25 - if scheduler[i]["pos"] > scheduler[i]["target"]: - newTarget = scheduler[i]["cb"]() - if newTarget > 0: - newScheduler[i]["pos"] = 0 - newScheduler[i]["target"] = newTarget - else: - newScheduler.pop(i) - scheduler = newScheduler - ### PROGRAM -timer = machine.Timer(0) -timer.init(period=25, mode=machine.Timer.PERIODIC, callback=timer_callback) - -# Load settings from NVS -otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) - # Calibrate battery voltage drop if badge.battery_charge_status() == False and badge.usb_volt_sense() > 4500 and badge.battery_volt_sense() > 2500: badge.nvs_set_u16('splash', 'bat.volt.drop', 5200 - badge.battery_volt_sense()) # mV print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 1000) - 1000 # mV -# Initialize user input subsystem splash_input_init() - -# Initialize about subsystem splash_about_countdown_reset() -# Setup / Sponsors / OTA check / NTP clock sync setupState = badge.nvs_get_u8('badge', 'setup.state', 0) if setupState == 0: #First boot print("[SPLASH] First boot (start setup)...") @@ -315,67 +133,31 @@ def timer_callback(tmr): elif setupState == 1: # Second boot: Show sponsors print("[SPLASH] Second boot (show sponsors)...") badge.nvs_set_u8('badge', 'setup.state', 2) - splash_sponsors_show() + spoc.show(True) elif setupState == 2: # Third boot: force OTA check print("[SPLASH] Third boot (force ota check)...") badge.nvs_set_u8('badge', 'setup.state', 3) - otaAvailable = splash_ota_check() + otac.available(True) else: # Normal boot - print("[SPLASH] Normal boot... ") - print("RESET CAUSE: "+str(machine.reset_cause())) + print("[SPLASH] Normal boot... ("+str(machine.reset_cause())+")") if (machine.reset_cause() != machine.DEEPSLEEP_RESET): print("... from reset: checking for ota update") - otaAvailable = splash_ota_check() - else: - print("... from deep sleep: loading ota state from nvs") - otaAvailable = badge.nvs_get_u8('badge','OTA.ready',0) - -# Download resources to fatfs -splash_resources_check() - -# Show updated sponsors if not yet shown -if badge.nvs_get_u8('sponsors', 'shown', 0)<1: - splash_sponsors_show() - -# Initialize services -print("Initialize services") -[srvDoesLoop, srvDoesDraw] = services.setup(power_management, draw) - -if srvDoesLoop: - print("Service does loop.") - requestedInterval = services.loop_timer() - if requestedInterval>0: - scheduler_add(requestedInterval, services.loop_timer) - #loopTimer.init(period=requestedInterval, mode=machine.Timer.ONE_SHOT, callback=loop_timer_callback) - -if srvDoesDraw: - print("Service does draw.") - requestedInterval = services.draw_timer() - if requestedInterval>0: - scheduler_add(requestedInterval, services.draw_timer) - #drawTimer.init(period=requestedInterval, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback) - -# Disable WiFi if active -print("Disable WiFi if active") -easywifi.disable() - -# Clean memory -print("Clean memory") -gc.collect() + otac.available(True) -# Draw homescreen -print("Draw homescreen") -if not srvDoesDraw: - print("[SPLASH] No service draw, manually drawing...") +resc.check() # Check resources +spoc.show(False) # Check sponsors +if not services.setup(draw): # Start services draw(False) draw(True) -if not srvDoesLoop: - print("[SPLASH] No service sleep!") - -power_countdown_reset(-1) +easywifi.disable() +gc.collect() + +virtualtimers.activate(25) +pm.callback(onSleep) +pm.feed() print("----") -print("WARNING: NOT IN REPL MODE, POWER MANAGEMENT ACTIVE") -print("TO USE REPL RESET AND HIT CTRL+C BEFORE SPLASH STARTS") +print("WARNING: POWER MANAGEMENT ACTIVE") +print("TO USE REPL START LAUNCHER") print("----") diff --git a/esp32/modules/tasks/otacheck.py b/esp32/modules/tasks/otacheck.py new file mode 100644 index 000000000..4b4e9ff60 --- /dev/null +++ b/esp32/modules/tasks/otacheck.py @@ -0,0 +1,43 @@ +# File: otacheck.py +# Version: 1 +# Description: OTA check module +# License: MIT +# Authors: Renze Nicolai + +import easywifi, easydraw, badge + +def download_info(): + import urequests as requests + easydraw.msg("Checking for updates...") + result = False + try: + data = requests.get("https://badge.sha2017.org/version") + except: + easydraw.msg("Error: could not download JSON!") + time.sleep(5) + return False + try: + result = data.json() + except: + data.close() + easydraw.msg("Error: could not decode JSON!") + time.sleep(5) + return False + data.close() + return result + +def available(update=False): + if update: + if not easywifi.status(): + if not easywifi.enable(): + return badge.nvs_get_u8('badge','OTA.ready',0) + + info = download_info() + if info: + import version + if info["build"] > version.build: + badge.nvs_set_u8('badge','OTA.ready',1) + return True + + badge.nvs_set_u8('badge','OTA.ready',0) + return badge.nvs_get_u8('badge','OTA.ready',0) diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py new file mode 100644 index 000000000..bc69d26da --- /dev/null +++ b/esp32/modules/tasks/powermanagement.py @@ -0,0 +1,56 @@ +# File: powermanagement.py +# Version: 1 +# Description: Power management task, puts the badge to sleep when idle +# License: MIT +# Authors: Renze Nicolai + +import virtualtimers, deepsleep, badge, sys + + + +requestedStandbyTime = 0 +onSleepCallback = None + +userResponseTime = badge.nvs_get_u16('splash', 'urt', 5000) + +def pm_task(): + ''' The power management task [internal function] ''' + global requestedStandbyTime + + idleTime = virtualtimers.idle_time() + print("[Power management] Next task wants to run in "+str(idleTime)+" ms.") + + if idleTime>30000 or idleTime<0: + global onSleepCallback + if not onSleepCallback==None: + print("[Power management] Running onSleepCallback...") + try: + onSleepCallback(idleTime) + except BaseException as e: + print("[ERROR] An error occured in the on sleep callback.") + sys.print_exception(e) + + if idleTime<0: + print("[Power management] Sleeping forever...") + deepsleep.start_sleeping() + else: + print("[Power management] Sleeping for "+str(idleTime)+" ms...") + deepsleep.start_sleeping(idleTime) + + global userResponseTime + return userResponseTime + +def feed(): + ''' Start / resets the power management task ''' + global userResponseTime + if not virtualtimers.update(userResponseTime, pm_task): + virtualtimers.new(userResponseTime, pm_task) + +def kill(): + ''' Kills the power management task ''' + virtualtimers.delete(pm_task) + +def callback(cb): + ''' Set a callback which is run before sleeping ''' + global onSleepCallback + onSleepCallback = cb diff --git a/esp32/modules/tasks/resourcescheck.py b/esp32/modules/tasks/resourcescheck.py new file mode 100644 index 000000000..bc901d6d5 --- /dev/null +++ b/esp32/modules/tasks/resourcescheck.py @@ -0,0 +1,32 @@ +# File: resourcecheck.py +# Version: 1 +# Description: Resources check module +# License: MIT +# Authors: Renze Nicolai + +import easywifi, easydraw + +def install(): + easydraw.msg("Installing resources...") + if not easywifi.status(): + if not easywifi.enable(): + return False + import woezel + woezel.install("resources") + appglue.home() + +def check(): + needToInstall = True + try: + fp = open("/lib/resources/version", "r") + version = int(fp.read(99)) + print("[RESOURCES] Current version: "+str(version)) + if version>=2: + needToInstall = False + except: + pass + if needToInstall: + print("[RESOURCESH] Update required!") + install() + return True + return False diff --git a/esp32/modules/services.py b/esp32/modules/tasks/services.py similarity index 72% rename from esp32/modules/services.py rename to esp32/modules/tasks/services.py index 27d290f7d..84ac66e60 100644 --- a/esp32/modules/services.py +++ b/esp32/modules/tasks/services.py @@ -1,27 +1,20 @@ # File: services.py -# Version: 3 +# Version: 4 # API version: 2 # Description: Background services for SHA2017 badge # License: MIT # Authors: Renze Nicolai # Thomas Roos -import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge, machine, sys +import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge, machine, sys, virtualtimers services = [] #List containing all the service objects -loopCallbacks = {} #Dict containing: {:} drawCallbacks = [] #List containing draw functions -def setup(pmCb=None, drawCb=None): +def setup(drawCb=None): global services - global loopCallbacks global drawCallbacks - - if pmCb: - print("[SERVICES] Power management callback registered") - global pmCallback - pmCallback = pmCb - + if drawCb: print("[SERVICES] Draw callback registered") global drawCallback @@ -90,7 +83,7 @@ def setup(pmCb=None, drawCb=None): sys.print_exception(e) continue #Skip the app - if wifiInSetup: + if wifiInSetup or wifiInLoop: if wifiFailed: print("[SERVICES] Service of app "+app+" requires wifi and wifi failed so the service has been disabled.") continue @@ -117,7 +110,7 @@ def setup(pmCb=None, drawCb=None): if loopEnabled: try: - loopCallbacks[srv.loop] = wifiInLoop + virtualtimers.new(1, srv.loop) except: print("[SERVICES] Loop requested but not defined in service "+app) @@ -129,66 +122,15 @@ def setup(pmCb=None, drawCb=None): # Add the script to the global service list services.append(srv) - - # Create loop timer - hasLoopTimer = False - if len(loopCallbacks)>0: - print("[SERVICES] There are loop callbacks!") - hasLoopTimer = True - - # Create draw timer - hasDrawTimer = False + + handleDraw = False if len(drawCallbacks)>0 and drawCb: - print("[SERVICES] There are draw callbacks!") - hasDrawTimer = True - return [hasLoopTimer, hasDrawTimer] - -def loop_timer(): - global loopCallbacks - requestedInterval = 99999999 - newLoopCallbacks = loopCallbacks - for cb in loopCallbacks: - if loopCallbacks[cb]: - print("[SERVICES] Loop needs wifi!") - if not easywifi.status(): - if not easywifi.enable(): - print("[SERVICES] Wifi not available!") - continue - else: - print("[SERVICES] Loop does not need wifi!") - rqi = 0 - try: - rqi = cb() - except BaseException as e: - print("[SERVICES] Exception in service loop:") - sys.print_exception(e) - newLoopCallbacks.pop(cb) - continue - if rqi>0 and rqi=99999999: - print("[SERVICES] No loop interval returned.") - requestedInterval = -1 - - easywifi.disable() # Always disable wifi - - try: - global pmCallback - if pmCallback(requestedInterval): - print("[SERVICES] Loop timer (re-)started "+str(requestedInterval)) - return requestedInterval - except: - print("[SERVICES] Error in power management callback!") - return 0 + print("[SERVICES] The service subsystem now handles screen redraws") + handleDraw = True + virtualtimers.new(1, draw_task) + return handleDraw -def draw_timer(): +def draw_task(): global drawCallback #The function that allows us to hook into our host global drawCallbacks #The functions of the services requestedInterval = 99999999 @@ -236,9 +178,7 @@ def draw_timer(): drawCallback(True) # Complete draw return retVal -def force_draw(disableTimer): - if disableTimer: - print("[SERVICES] FIXME!!!!!!") +def force_draw(): global drawCallbacks if len(drawCallbacks)>0: y = ugfx.height() diff --git a/esp32/modules/tasks/sponsorscheck.py b/esp32/modules/tasks/sponsorscheck.py new file mode 100644 index 000000000..5d2824407 --- /dev/null +++ b/esp32/modules/tasks/sponsorscheck.py @@ -0,0 +1,40 @@ +# File: sponsorscheck.py +# Version: 1 +# Description: Sponsors check module +# License: MIT +# Authors: Renze Nicolai + +import easywifi, easydraw, appglue, badge + +def install(): + if not easywifi.status(): + if not easywifi.enable(): + return False + print("[SPONSORS] Installing...") + easydraw.msg("Installing sponsors...") + import woezel + woezel.install("sponsors") + easydraw.msg("OK") + +def show(force=False): + if (not badge.nvs_get_u8('sponsors', 'shown', 0)) or force: + needToInstall = True + version = 0 + try: + fp = open("/lib/sponsors/version", "r") + version = int(fp.read(99)) + print("[SPONSORS] Current version: "+str(version)) + except: + print("[SPONSORS] Not installed!") + if version>=14: + needToInstall = False + if needToInstall: + install() + try: + fp = open("/lib/sponsors/version", "r") + version = int(fp.read(99)) + # Now we know for sure that a version of the sponsors app has been installed + badge.nvs_set_u8('sponsors', 'shown', 1) + appglue.start_app("sponsors") + except: + pass diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index ed3560642..0454f7590 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -4,17 +4,32 @@ # License: MIT # Authors: Renze Nicolai -import machine +import machine, sys scheduler = [] timer = machine.Timer(0) period = 0 -def new(target, callback): +def new(target, callback, hfpm=False): + ''' Creates new task. Arguments: time until callback is called, callback, hide from power management ''' global scheduler - item = {"pos":0, "target":target, "cb":callback} + item = {"pos":0, "target":target, "cb":callback, "hfpm":hfpm} scheduler.append(item) +def idle_time(): + ''' Returns time until next task in ms, ignores tasks hidden from power management ''' + global scheduler + idleTime = 86400000 # One day + for i in range(0, len(scheduler)): + if not scheduler[i]["hfpm"]: + timeUntilTaskExecution = scheduler[i]['target']-scheduler[i]['pos'] + if timeUntilTaskExecution scheduler[i]["target"]: - newTarget = scheduler[i]["cb"]() + try: + newTarget = scheduler[i]["cb"]() + except BaseException as e: + print("[ERROR] An error occured in a task. Task disabled.") + sys.print_exception(e) + newTarget = -1 if newTarget > 0: newScheduler[i]["pos"] = 0 newScheduler[i]["target"] = newTarget From 6a313b68be8fed8b9b9224d983cd5b880e2c36e9 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 02:52:13 +0200 Subject: [PATCH 217/403] Whoops, fix bug that causes unwanted sleep --- esp32/modules/tasks/powermanagement.py | 4 ++-- esp32/modules/virtualtimers.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index bc69d26da..9dda28ca2 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -20,7 +20,7 @@ def pm_task(): idleTime = virtualtimers.idle_time() print("[Power management] Next task wants to run in "+str(idleTime)+" ms.") - if idleTime>30000 or idleTime<0: + if idleTime>30000: global onSleepCallback if not onSleepCallback==None: print("[Power management] Running onSleepCallback...") @@ -30,7 +30,7 @@ def pm_task(): print("[ERROR] An error occured in the on sleep callback.") sys.print_exception(e) - if idleTime<0: + if idleTime>=86400000: # One day print("[Power management] Sleeping forever...") deepsleep.start_sleeping() else: diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index 0454f7590..d73953493 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -19,14 +19,12 @@ def new(target, callback, hfpm=False): def idle_time(): ''' Returns time until next task in ms, ignores tasks hidden from power management ''' global scheduler - idleTime = 86400000 # One day + idleTime = 86400000 # One day (causes the badge to sleep forever) for i in range(0, len(scheduler)): if not scheduler[i]["hfpm"]: timeUntilTaskExecution = scheduler[i]['target']-scheduler[i]['pos'] if timeUntilTaskExecution Date: Wed, 2 Aug 2017 02:54:13 +0200 Subject: [PATCH 218/403] Oops --- esp32/modules/tasks/powermanagement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index 9dda28ca2..01513b41b 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -44,7 +44,7 @@ def feed(): ''' Start / resets the power management task ''' global userResponseTime if not virtualtimers.update(userResponseTime, pm_task): - virtualtimers.new(userResponseTime, pm_task) + virtualtimers.new(userResponseTime, pm_task, True) def kill(): ''' Kills the power management task ''' From e05e7fa7ee6c5ffbd134a754f444352ce198cdcf Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 03:14:09 +0200 Subject: [PATCH 219/403] Splat said the bug --- esp32/modules/splash.py | 1 + esp32/modules/tasks/powermanagement.py | 3 +++ esp32/modules/tasks/services.py | 2 +- esp32/modules/virtualtimers.py | 24 ++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index aa3eafddc..887a71b2b 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -153,6 +153,7 @@ def onSleep(idleTime): easywifi.disable() gc.collect() +virtualtimers.debug(True) virtualtimers.activate(25) pm.callback(onSleep) pm.feed() diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index 01513b41b..bf49e4ac3 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -45,6 +45,9 @@ def feed(): global userResponseTime if not virtualtimers.update(userResponseTime, pm_task): virtualtimers.new(userResponseTime, pm_task, True) + print("PM CREATE") + else: + print("PM FEED") def kill(): ''' Kills the power management task ''' diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index 84ac66e60..a4bfaed58 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -127,7 +127,7 @@ def setup(drawCb=None): if len(drawCallbacks)>0 and drawCb: print("[SERVICES] The service subsystem now handles screen redraws") handleDraw = True - virtualtimers.new(1, draw_task) + virtualtimers.new(1, draw_task, True) return handleDraw def draw_task(): diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index d73953493..0d0b42ce8 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -9,6 +9,11 @@ scheduler = [] timer = machine.Timer(0) period = 0 +debugEnabled = False + +def debug(s): + global debugEnabled + debugEnabled = s def new(target, callback, hfpm=False): ''' Creates new task. Arguments: time until callback is called, callback, hide from power management ''' @@ -21,7 +26,25 @@ def idle_time(): global scheduler idleTime = 86400000 # One day (causes the badge to sleep forever) for i in range(0, len(scheduler)): + timeUntilTaskExecution = scheduler[i]['target']-scheduler[i]['pos'] + + global debugEnabled + if debugEnabled: + print("idle time for task "+str(i)+" = "+str(timeUntilTaskExecution)+" - ",scheduler[i]) + if not scheduler[i]["hfpm"]: + if timeUntilTaskExecution<0: + timeUntilTaskExecution = 0 + if timeUntilTaskExecution Date: Wed, 2 Aug 2017 03:16:36 +0200 Subject: [PATCH 220/403] Remove debug --- esp32/modules/splash.py | 4 ---- esp32/modules/tasks/powermanagement.py | 3 --- 2 files changed, 7 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 887a71b2b..87529d91a 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -75,25 +75,21 @@ def splash_about_countdown_trigger(): def splash_input_start(pressed): # Pressing start always starts the launcher if pressed: - print("[SPLASH] Start button pressed") appglue.start_app("launcher", False) def splash_input_a(pressed): if pressed: - print("[SPLASH] A button pressed") splash_about_countdown_trigger() pm.feed() def splash_input_select(pressed): if pressed: - print("[SPLASH] Select button pressed") if otac.available(False): appglue.start_ota() pm.feed() def splash_input_other(pressed): if pressed: - print("[SPLASH] Other button pressed") pm.feed() def splash_input_init(): diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index bf49e4ac3..01513b41b 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -45,9 +45,6 @@ def feed(): global userResponseTime if not virtualtimers.update(userResponseTime, pm_task): virtualtimers.new(userResponseTime, pm_task, True) - print("PM CREATE") - else: - print("PM FEED") def kill(): ''' Kills the power management task ''' From cd6f911c2f36c8db6e769dde7b3253e49875716f Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 03:23:06 +0200 Subject: [PATCH 221/403] Remove debug --- esp32/modules/virtualtimers.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index 0d0b42ce8..77582ec6f 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -89,18 +89,19 @@ def timer_callback(tmr): global scheduler global period newScheduler = scheduler - for i in range(0, len(scheduler)): - scheduler[i]["pos"] += period - if scheduler[i]["pos"] > scheduler[i]["target"]: - try: - newTarget = scheduler[i]["cb"]() - except BaseException as e: - print("[ERROR] An error occured in a task. Task disabled.") - sys.print_exception(e) - newTarget = -1 - if newTarget > 0: - newScheduler[i]["pos"] = 0 - newScheduler[i]["target"] = newTarget - else: - newScheduler.pop(i) - scheduler = newScheduler + if len(scheduler)>0: + for i in range(0, len(scheduler)): + scheduler[i]["pos"] += period + if scheduler[i]["pos"] > scheduler[i]["target"]: + try: + newTarget = scheduler[i]["cb"]() + except BaseException as e: + print("[ERROR] An error occured in a task. Task disabled.") + sys.print_exception(e) + newTarget = -1 + if newTarget > 0: + newScheduler[i]["pos"] = 0 + newScheduler[i]["target"] = newTarget + else: + newScheduler.pop(i) + scheduler = newScheduler From 8aa11b110a7495051366dabce0dcb1e5599356cc Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 03:24:01 +0200 Subject: [PATCH 222/403] Remove debug --- esp32/modules/tasks/services.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index a4bfaed58..5569daf7a 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -40,9 +40,7 @@ def setup(drawCb=None): except: print("[SERVICES] No description found for "+app) continue #Or skip the app - - print("DESC FOUND FOR: "+app) - + try: #Try to open the service itself fd = open('/lib/'+app+'/service.py') @@ -50,9 +48,7 @@ def setup(drawCb=None): except: print("[SERVICES] No script found for "+app) continue #Or skip the app - - print("SCRIPT FOUND FOR: "+app) - + rtcRequired = False # True if RTC should be set before starting service loopEnabled = False # True if loop callback is requested drawEnabled = False # True if draw callback is requested From 97418b3bb3c42d10a931db81b1cf0523ebf94b9a Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 04:06:49 +0200 Subject: [PATCH 223/403] Pop said the bug --- esp32/modules/tasks/services.py | 6 +++-- esp32/modules/virtualtimers.py | 48 ++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index 5569daf7a..b36a12a69 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -134,7 +134,9 @@ def draw_task(): drawCallback(False) # Prepare draw - newDrawCallbacks = drawCallbacks + newDrawCallbacks = [] + for cbs in drawCallbacks: + newDrawCallbacks.append(cbs) for i in range(0, len(drawCallbacks)): cb = drawCallbacks[i] rqi = 0 @@ -151,7 +153,7 @@ def draw_task(): requestedInterval = rqi elif rqi<=0: # Service doesn't want to draw again until next wakeup - newDrawCallbacks.pop(cb) + newDrawCallbacks.pop(i) drawCallbacks = newDrawCallbacks del(newDrawCallbacks) diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index 77582ec6f..78cee60d5 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -53,7 +53,9 @@ def pm_time(): def delete(callback): global scheduler - newScheduler = scheduler + newScheduler = [] + for task in scheduler: + newScheduler.append(task) found = False for i in range(0, len(scheduler)): if (scheduler[i]["cb"]==callback): @@ -88,20 +90,30 @@ def stop(): def timer_callback(tmr): global scheduler global period - newScheduler = scheduler - if len(scheduler)>0: - for i in range(0, len(scheduler)): - scheduler[i]["pos"] += period - if scheduler[i]["pos"] > scheduler[i]["target"]: - try: - newTarget = scheduler[i]["cb"]() - except BaseException as e: - print("[ERROR] An error occured in a task. Task disabled.") - sys.print_exception(e) - newTarget = -1 - if newTarget > 0: - newScheduler[i]["pos"] = 0 - newScheduler[i]["target"] = newTarget - else: - newScheduler.pop(i) - scheduler = newScheduler + newScheduler = [] + for task in scheduler: + newScheduler.append(task) + if len(scheduler)>3: + print("WHAT THE FUCK") + print(scheduler) + + s = len(scheduler) + for i in range(0, len(scheduler)): + if not s == len(scheduler): + print("LENGTH OF SCHEDULER CHANGED IN LOOP") + scheduler[i]["pos"] += period + if scheduler[i]["pos"] > scheduler[i]["target"]: + try: + newTarget = scheduler[i]["cb"]() + except BaseException as e: + print("[ERROR] An error occured in a task. Task disabled.") + sys.print_exception(e) + newTarget = -1 + if newTarget > 0: + print("TASK RESCHEDULED") + newScheduler[i]["pos"] = 0 + newScheduler[i]["target"] = newTarget + else: + print("TASK REMOVED") + newScheduler.pop(i) + scheduler = newScheduler From c0ce57fbcb531be2f38535178152f12981bcf4bc Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 04:09:04 +0200 Subject: [PATCH 224/403] Remove debug prints --- esp32/modules/virtualtimers.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index 78cee60d5..4a1e7430c 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -93,14 +93,9 @@ def timer_callback(tmr): newScheduler = [] for task in scheduler: newScheduler.append(task) - if len(scheduler)>3: - print("WHAT THE FUCK") - print(scheduler) s = len(scheduler) for i in range(0, len(scheduler)): - if not s == len(scheduler): - print("LENGTH OF SCHEDULER CHANGED IN LOOP") scheduler[i]["pos"] += period if scheduler[i]["pos"] > scheduler[i]["target"]: try: @@ -110,10 +105,8 @@ def timer_callback(tmr): sys.print_exception(e) newTarget = -1 if newTarget > 0: - print("TASK RESCHEDULED") newScheduler[i]["pos"] = 0 newScheduler[i]["target"] = newTarget else: - print("TASK REMOVED") newScheduler.pop(i) scheduler = newScheduler From 106fac85d3010d93a45bd12bcb12c62400062a3b Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 04:38:03 +0200 Subject: [PATCH 225/403] :D --- esp32/modules/badge_event_reminder.py | 38 +++++++++++++++++++++++ esp32/modules/splash.py | 3 ++ esp32/modules/tasks/badgeeventreminder.py | 28 +++++++++++++++++ esp32/modules/virtualtimers.py | 5 ++- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 esp32/modules/badge_event_reminder.py create mode 100644 esp32/modules/tasks/badgeeventreminder.py diff --git a/esp32/modules/badge_event_reminder.py b/esp32/modules/badge_event_reminder.py new file mode 100644 index 000000000..6f9678342 --- /dev/null +++ b/esp32/modules/badge_event_reminder.py @@ -0,0 +1,38 @@ +import ugfx, badge, time, appglue + +def exit(p): + if p: + appglue.home() + +ugfx.clear(ugfx.WHITE) +ugfx.string(0, 0, "Message here!", "PermanentMarker22", ugfx.BLACK) +ugfx.string(0, 25, "Hello wolrd", "Roboto_Regular12", ugfx.BLACK) +ugfx.string(0, 25+13, "Nothing here yet!", "Roboto_Regular12", ugfx.BLACK) + +ugfx.string(0, ugfx.height()-13, "Press any key to close reminder.", "Roboto_Regular12", ugfx.BLACK) +ugfx.set_lut(ugfx.LUT_FULL) +ugfx.flush() + +ugfx.input_init() +ugfx.input_attach(ugfx.JOY_UP, exit) +ugfx.input_attach(ugfx.JOY_DOWN, exit) +ugfx.input_attach(ugfx.JOY_LEFT, exit) +ugfx.input_attach(ugfx.JOY_RIGHT, exit) +ugfx.input_attach(ugfx.BTN_SELECT, exit) +ugfx.input_attach(ugfx.BTN_START, exit) +ugfx.input_attach(ugfx.BTN_A, exit) +ugfx.input_attach(ugfx.BTN_B, exit) + +def led(on): + ledVal = 0 + if on: + ledVal = 255 + badge.leds_send_data(bytes([ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal]),24) + +for i in range(0,30): + led(True) + badge.vibrator_activate(0xFF) + led(False) + badge.vibrator_activate(0xFF) + +appglue.home() diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 87529d91a..3d01485fb 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -14,6 +14,7 @@ import tasks.resourcescheck as resc import tasks.sponsorscheck as spoc import tasks.services as services +import tasks.badgeeventreminder as ber # Graphics @@ -154,6 +155,8 @@ def onSleep(idleTime): pm.callback(onSleep) pm.feed() +ber.enable() + print("----") print("WARNING: POWER MANAGEMENT ACTIVE") print("TO USE REPL START LAUNCHER") diff --git a/esp32/modules/tasks/badgeeventreminder.py b/esp32/modules/tasks/badgeeventreminder.py new file mode 100644 index 000000000..00500ab66 --- /dev/null +++ b/esp32/modules/tasks/badgeeventreminder.py @@ -0,0 +1,28 @@ +# File: badgeeventreminder.py +# Version: 1 +# Description: Easter egg +# License: MIT +# Authors: Renze Nicolai + +import virtualtimers, time, appglue, badge + +whenToTrigger = 1502196900 - 600 + +def ber_task(): + global whenToTrigger + now = time.time() + if now>=whenToTrigger: + badge.nvs_set_u8('badge','evrt',1) + print("BADGE EVENT REMINDER ACTIVATED") + appglue.start_app("badge_event_reminder") + idleFor = whenToTrigger - now + if idleFor<0: + idleFor = 0 + return idleFor + +def enable(): + if badge.nvs_get_u8('badge','evrt',0)==0: + virtualtimers.new(1, ber_task) + +def disable(): + virtualtimers.delete(ber_task) diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index 4a1e7430c..2677e082d 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -108,5 +108,8 @@ def timer_callback(tmr): newScheduler[i]["pos"] = 0 newScheduler[i]["target"] = newTarget else: - newScheduler.pop(i) + try: + newScheduler.pop(i) + except: + print("CAN NOT REMOVE TASK ?!?!") scheduler = newScheduler From 9f6c61f490e0d746ebea8e47d8134a43f9648237 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 04:59:48 +0200 Subject: [PATCH 226/403] Removed all the pops --- esp32/modules/badge_event_reminder.py | 9 +++++--- esp32/modules/tasks/services.py | 15 +++++++------- esp32/modules/virtualtimers.py | 30 +++++++++++---------------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/esp32/modules/badge_event_reminder.py b/esp32/modules/badge_event_reminder.py index 6f9678342..1e0c9dd47 100644 --- a/esp32/modules/badge_event_reminder.py +++ b/esp32/modules/badge_event_reminder.py @@ -5,10 +5,13 @@ def exit(p): appglue.home() ugfx.clear(ugfx.WHITE) -ugfx.string(0, 0, "Message here!", "PermanentMarker22", ugfx.BLACK) -ugfx.string(0, 25, "Hello wolrd", "Roboto_Regular12", ugfx.BLACK) -ugfx.string(0, 25+13, "Nothing here yet!", "Roboto_Regular12", ugfx.BLACK) +ugfx.string(0, 0, "SHA2017 Badge", "PermanentMarker22", ugfx.BLACK) +ugfx.string(0, 25, "Please join us for a short talk on how the", "Roboto_Regular12", ugfx.BLACK) +ugfx.string(0, 25+13, "official SHA2017 badge was designed,", "Roboto_Regular12", ugfx.BLACK) +ugfx.string(0, 25+13*2, "some nice numbers and an overview of what all", "Roboto_Regular12", ugfx.BLACK) +ugfx.string(0, 25+13*3, "of you are doing with it.", "Roboto_Regular12", ugfx.BLACK) +ugfx.string(0, 25+13*5, "The events starts now, in room 'No'!", "Roboto_Regular12", ugfx.BLACK) ugfx.string(0, ugfx.height()-13, "Press any key to close reminder.", "Roboto_Regular12", ugfx.BLACK) ugfx.set_lut(ugfx.LUT_FULL) ugfx.flush() diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index b36a12a69..20ee5129d 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -134,9 +134,8 @@ def draw_task(): drawCallback(False) # Prepare draw - newDrawCallbacks = [] - for cbs in drawCallbacks: - newDrawCallbacks.append(cbs) + deleted = [] + for i in range(0, len(drawCallbacks)): cb = drawCallbacks[i] rqi = 0 @@ -146,16 +145,18 @@ def draw_task(): except BaseException as e: print("[SERVICES] Exception in service draw:") sys.print_exception(e) - newDrawCallbacks.pop(i) + deleted.append(cb) continue if rqi>0 and rqi 0: - newScheduler[i]["pos"] = 0 - newScheduler[i]["target"] = newTarget + scheduler[i]["pos"] = 0 + scheduler[i]["target"] = newTarget else: - try: - newScheduler.pop(i) - except: - print("CAN NOT REMOVE TASK ?!?!") - scheduler = newScheduler + scheduler[i]["pos"] = -1 + scheduler[i]["target"] = -1 + + scheduler = tuple(task for task in scheduler if task["pos"]>=0) From 8c33c1bd02d43e2a5068242b48922e034ab1282c Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 05:04:42 +0200 Subject: [PATCH 227/403] List instead of tuple --- esp32/modules/tasks/services.py | 2 +- esp32/modules/virtualtimers.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index 20ee5129d..a5beb282a 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -156,7 +156,7 @@ def draw_task(): for i in range(0,len(deleted)): print("[DEBUG] Deleted draw callback: ",dcb) - drawCallbacks = tuple(dcb for dcb in drawCallbacks if dcb!=deleted[i]) + drawCallbacks = list(dcb for dcb in drawCallbacks if dcb!=deleted[i]) badge.eink_busy_wait() diff --git a/esp32/modules/virtualtimers.py b/esp32/modules/virtualtimers.py index 6165a51d7..0b216573c 100644 --- a/esp32/modules/virtualtimers.py +++ b/esp32/modules/virtualtimers.py @@ -60,7 +60,7 @@ def delete(callback): found = True break - scheduler = tuple(task for task in scheduler if task['cb']!=callback) + scheduler = list(task for task in scheduler if task['cb']!=callback) return found @@ -106,4 +106,4 @@ def timer_callback(tmr): scheduler[i]["pos"] = -1 scheduler[i]["target"] = -1 - scheduler = tuple(task for task in scheduler if task["pos"]>=0) + scheduler = list(task for task in scheduler if task["pos"]>=0) From 25b88b6e112e4a93f39f514b7b511162aa607184 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 05:32:01 +0200 Subject: [PATCH 228/403] Fixed a couple of small bugs --- esp32/modules/easywifi.py | 12 ++++++++++++ esp32/modules/splash.py | 22 +++++++++++++++------- esp32/modules/tasks/resourcescheck.py | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/esp32/modules/easywifi.py b/esp32/modules/easywifi.py index 9ed551500..d2d24a20b 100644 --- a/esp32/modules/easywifi.py +++ b/esp32/modules/easywifi.py @@ -7,17 +7,25 @@ import time, network, badge, easydraw state = False +failed = False def status(): global state return state +def failure(): + global failed + return failed + def force_enable(): global state state = False + global failed + failed = False enable() def enable(showStatus=True): + global failed global state if not state: nw = network.WLAN(network.STA_IF) @@ -36,8 +44,10 @@ def enable(showStatus=True): if showStatus: easydraw.msg("Error: could not connect!") disable() + failed = True return False state = True + failed = False if showStatus: easydraw.msg("Connected!") return True @@ -45,5 +55,7 @@ def enable(showStatus=True): def disable(): global state state = False + global failed + failed = False nw = network.WLAN(network.STA_IF) nw.active(False) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 3d01485fb..44326e651 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -134,18 +134,26 @@ def onSleep(idleTime): elif setupState == 2: # Third boot: force OTA check print("[SPLASH] Third boot (force ota check)...") badge.nvs_set_u8('badge', 'setup.state', 3) - otac.available(True) + if not easywifi.failure(): + otac.available(True) else: # Normal boot print("[SPLASH] Normal boot... ("+str(machine.reset_cause())+")") if (machine.reset_cause() != machine.DEEPSLEEP_RESET): print("... from reset: checking for ota update") - otac.available(True) + if not easywifi.failure(): + otac.available(True) + + +if not easywifi.failure(): + resc.check() # Check resources +if not easywifi.failure(): + spoc.show(False) # Check sponsors + +services.setup(draw) # Start services -resc.check() # Check resources -spoc.show(False) # Check sponsors -if not services.setup(draw): # Start services - draw(False) - draw(True) +draw(False) +services.force_draw() +draw(True) easywifi.disable() gc.collect() diff --git a/esp32/modules/tasks/resourcescheck.py b/esp32/modules/tasks/resourcescheck.py index bc901d6d5..f930e6e1d 100644 --- a/esp32/modules/tasks/resourcescheck.py +++ b/esp32/modules/tasks/resourcescheck.py @@ -4,7 +4,7 @@ # License: MIT # Authors: Renze Nicolai -import easywifi, easydraw +import easywifi, easydraw, appglue def install(): easydraw.msg("Installing resources...") From 0f12082f5b7d957d920bce4e40ee589abce84e38 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 2 Aug 2017 13:42:34 +1000 Subject: [PATCH 229/403] py,extmod,stmhal: Use "static inline" for funcs that should be inline. "STATIC inline" can expand to "inline" if STATIC is defined to nothing, and this case can lead to link errors. --- extmod/moductypes.c | 4 ++-- py/modbuiltins.c | 2 +- stmhal/i2c.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extmod/moductypes.c b/extmod/moductypes.c index 9678fd58f..c2d226562 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -281,13 +281,13 @@ STATIC mp_obj_t uctypes_struct_sizeof(mp_obj_t obj_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(uctypes_struct_sizeof_obj, uctypes_struct_sizeof); -STATIC inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) { +static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) { char struct_type = big_endian ? '>' : '<'; static const char type2char[16] = "BbHhIiQq------fd"; return mp_binary_get_val(struct_type, type2char[val_type], &p); } -STATIC inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) { +static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) { char struct_type = big_endian ? '>' : '<'; static const char type2char[16] = "BbHhIiQq------fd"; mp_binary_set_val(struct_type, type2char[val_type], val, &p); diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 1711ae58b..1c76b8073 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -540,7 +540,7 @@ STATIC mp_obj_t mp_builtin_sorted(size_t n_args, const mp_obj_t *args, mp_map_t MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj, 1, mp_builtin_sorted); // See mp_load_attr() if making any changes -STATIC inline mp_obj_t mp_load_attr_default(mp_obj_t base, qstr attr, mp_obj_t defval) { +static inline mp_obj_t mp_load_attr_default(mp_obj_t base, qstr attr, mp_obj_t defval) { mp_obj_t dest[2]; // use load_method, raising or not raising exception ((defval == MP_OBJ_NULL) ? mp_load_method : mp_load_method_maybe)(base, attr, dest); diff --git a/stmhal/i2c.c b/stmhal/i2c.c index f102fd0f2..3fcce327f 100644 --- a/stmhal/i2c.c +++ b/stmhal/i2c.c @@ -513,7 +513,7 @@ STATIC HAL_StatusTypeDef i2c_wait_dma_finished(I2C_HandleTypeDef *i2c, uint32_t /******************************************************************************/ /* MicroPython bindings */ -STATIC inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; } +static inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; } STATIC void pyb_i2c_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_i2c_obj_t *self = self_in; From c614f7fc479d8b6e0ffd41124b306819bc202983 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 22:33:05 +0200 Subject: [PATCH 230/403] Change led brightness for event reminder and make rtc mandatory again --- esp32/modules/badge_event_reminder.py | 4 ++-- esp32/modules/splash.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/esp32/modules/badge_event_reminder.py b/esp32/modules/badge_event_reminder.py index 1e0c9dd47..41a439cdd 100644 --- a/esp32/modules/badge_event_reminder.py +++ b/esp32/modules/badge_event_reminder.py @@ -29,8 +29,8 @@ def exit(p): def led(on): ledVal = 0 if on: - ledVal = 255 - badge.leds_send_data(bytes([ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal,ledVal]),24) + ledVal = 64 + badge.leds_send_data(bytes([0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal]),24) for i in range(0,30): led(True) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 44326e651..fbc53b8d7 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -143,7 +143,11 @@ def onSleep(idleTime): if not easywifi.failure(): otac.available(True) - +# RTC === +if time.time() < 1482192000: + easyrtc.configure() +# ======= + if not easywifi.failure(): resc.check() # Check resources if not easywifi.failure(): From faa6ff6100a7e2b8b67888409d1e97452c319009 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 2 Aug 2017 22:45:44 +0200 Subject: [PATCH 231/403] Move mount-code to modbadge; add sdcard support The native locfd-mount was hidden in the vfs_mount code. Mounting the fat partition and having a virtual file-system mount to the native filesystem are two different things. Split it up. Mounting the locfd filesystem is now done with: badge.mount_root() Mounting the native filesystems into micropython is still done with: uos.mount(uos.VfsNative(None), '/') Mounting the bpp moved to: badge.mount_bpp() Added support for sdcard mounts: badge.mount_sdcard() badge.unmount_sdcard() .. and fixed a printf bug in badge_eink_png. --- esp32/Makefile | 3 +- esp32/modbadge.c | 132 ++++++++++++++++++++++++++++++++++++++++- esp32/modules/_boot.py | 5 +- extmod/vfs_native.c | 29 --------- 4 files changed, 136 insertions(+), 33 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index 5061907db..2d9bfb6ce 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -266,7 +266,8 @@ ESPIDF_DRIVER_O = $(addprefix $(ESPCOMP)/driver/,\ spi_common.o \ rtc_module.o \ sdmmc_host.o \ - sdmmc_transaction.o \ + sdmmc_transaction.o \ + sdspi_host.o \ ) $(BUILD)/$(ESPCOMP)/esp32/dport_access.o: CFLAGS += -Wno-array-bounds diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 297ae8425..2d4c37c48 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -32,10 +32,18 @@ #include "modbadge.h" +#include "esp_log.h" +#include "esp_vfs.h" +#include "esp_vfs_fat.h" + +#include "bpp_init.h" + #include "py/mperrno.h" #include "py/mphal.h" #include "py/runtime.h" +#define TAG "esp32/modbadge" + // INIT STATIC mp_obj_t badge_init_() { @@ -290,7 +298,7 @@ STATIC mp_obj_t badge_eink_png(mp_obj_t obj_x, mp_obj_t obj_y, mp_obj_t obj_file if (res < 0) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "failed to load image: res = %i", res)); + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "failed to load image: res = %d", res)); } return mp_const_none; @@ -402,6 +410,122 @@ STATIC mp_obj_t badge_vibrator_activate_(mp_uint_t n_args, const mp_obj_t *args) STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(badge_vibrator_activate_obj, 1,1 ,badge_vibrator_activate_); #endif + +// Mounts +static bool root_mounted = false; +static wl_handle_t s_wl_handle = WL_INVALID_HANDLE; +STATIC mp_obj_t badge_mount_root() { + // already mounted? + if (root_mounted) + { + return mp_const_none; + } + + // mount the block device + const esp_vfs_fat_mount_config_t mount_config = { + .max_files = 3, + .format_if_mount_failed = true, + }; + + ESP_LOGI(TAG, "mounting locfd on /"); + esp_err_t err = esp_vfs_fat_spiflash_mount("", "locfd", &mount_config, &s_wl_handle); + + if (err != ESP_OK) { + ESP_LOGE(TAG, "Failed to mount FATFS (0x%x)", err); + mp_raise_OSError(MP_EIO); + } + + root_mounted = true; + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_mount_root_obj, badge_mount_root); + +static bool sdcard_mounted = false; +STATIC mp_obj_t badge_mount_sdcard() { + // already mounted? + if (sdcard_mounted) + { + return mp_const_none; + } + + badge_power_sdcard_enable(); + + sdmmc_host_t host = SDMMC_HOST_DEFAULT(); + + // To use 1-line SD mode, uncomment the following line: + host.flags = SDMMC_HOST_FLAG_1BIT; + + // This initializes the slot without card detect (CD) and write protect (WP) signals. + // Modify slot_config.gpio_cd and slot_config.gpio_wp if your board has these signals. + sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT(); + + // Options for mounting the filesystem. + // If format_if_mount_failed is set to true, SD card will be partitioned and formatted + // in case when mounting fails. + esp_vfs_fat_sdmmc_mount_config_t mount_config = { + .max_files = 3, + .format_if_mount_failed = false, + }; + + // Use settings defined above to initialize SD card and mount FAT filesystem. + // Note: esp_vfs_fat_sdmmc_mount is an all-in-one convenience function. + // Please check its source code and implement error recovery when developing + // production applications. + sdmmc_card_t* card; + esp_err_t ret = esp_vfs_fat_sdmmc_mount("/sdcard", &host, &slot_config, &mount_config, &card); + if (ret != ESP_OK) { + if (ret == ESP_FAIL) { + ESP_LOGE(TAG, "Failed to mount filesystem. If you want the card to be formatted, set format_if_mount_failed = true."); + } else { + ESP_LOGE(TAG, "Failed to initialize the card (%d). Make sure SD card lines have pull-up resistors in place.", ret); + } + mp_raise_OSError(MP_EIO); + return mp_const_none; + } + + sdcard_mounted = true; + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_mount_sdcard_obj, badge_mount_sdcard); + +STATIC mp_obj_t badge_unmount_sdcard() { + // not mounted? + if (!sdcard_mounted) + { + return mp_const_none; + } + + sdcard_mounted = false; + + // All done, unmount partition and disable SDMMC host peripheral + esp_vfs_fat_sdmmc_unmount(); + ESP_LOGI(TAG, "Card unmounted"); + + badge_power_sdcard_disable(); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_unmount_sdcard_obj, badge_unmount_sdcard); + +static bool bpp_mounted = false; +STATIC mp_obj_t badge_mount_bpp() { + // already mounted? + if (bpp_mounted) + { + return mp_const_none; + } + + bpp_mount_ropart(); + + bpp_mounted = true; + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_mount_bpp_obj, badge_mount_bpp); + + // Module globals STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { @@ -456,6 +580,12 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_display_picture), MP_ROM_PTR(&badge_display_picture_obj)}, */ + // Mounts + {MP_OBJ_NEW_QSTR(MP_QSTR_mount_root), (mp_obj_t)&badge_mount_root_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_mount_sdcard), (mp_obj_t)&badge_mount_sdcard_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_unmount_sdcard), (mp_obj_t)&badge_unmount_sdcard_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_mount_bpp), (mp_obj_t)&badge_mount_bpp_obj}, + }; STATIC MP_DEFINE_CONST_DICT(badge_module_globals, badge_module_globals_table); diff --git a/esp32/modules/_boot.py b/esp32/modules/_boot.py index dfff125e7..3213d27f9 100644 --- a/esp32/modules/_boot.py +++ b/esp32/modules/_boot.py @@ -1,7 +1,8 @@ -import gc, uos +import badge, gc, uos try: - uos.mount(uos.VfsNative(True), '/') + badge.mount_root() + uos.mount(uos.VfsNative(None), '/') open("/boot.py", "r") except OSError: import inisetup diff --git a/extmod/vfs_native.c b/extmod/vfs_native.c index 187aa7e28..781dfa2f1 100644 --- a/extmod/vfs_native.c +++ b/extmod/vfs_native.c @@ -26,9 +26,6 @@ static const char *TAG = "vfs_native.c"; -static wl_handle_t s_wl_handle = WL_INVALID_HANDLE; -static bool native_vfs_mounted = false; - /* esp-idf doesn't seem to have a cwd; create one. */ char cwd[MICROPY_ALLOC_PATH_MAX + 1] = { 0 }; @@ -392,32 +389,6 @@ STATIC mp_obj_t native_vfs_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t m flag_ro ? "true" : "false", flag_mkfs ? "true" : "false"); - /* we do not support mount, but will do an initial mount on first call */ - - // already mounted? - if (native_vfs_mounted) - { - return mp_const_none; - } - - // mount the block device - const esp_vfs_fat_mount_config_t mount_config = { - .max_files = 3, // every open file costs 4236 bytes of heap. - .format_if_mount_failed = true, - }; - - ESP_LOGI(TAG, "mounting locfd on /"); - esp_err_t err = esp_vfs_fat_spiflash_mount("", "locfd", &mount_config, &s_wl_handle); - - if (err != ESP_OK) { - ESP_LOGE(TAG, "Failed to mount FATFS (0x%x)", err); - mp_raise_OSError(MP_EIO); - } - - native_vfs_mounted = true; - - bpp_mount_ropart(); - return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_3(native_vfs_mount_obj, native_vfs_mount); From ca582675e1386fada206b9901e6b8fe3af7fee28 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 3 Aug 2017 00:16:38 +0300 Subject: [PATCH 232/403] zephyr/Makefile: Explicitly define default target as "all". For some reason, with the latest Zephyr master, running just "make" led to executing Zephyr's "qemu" target. --- zephyr/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zephyr/Makefile b/zephyr/Makefile index c1337adf0..988b32fe8 100644 --- a/zephyr/Makefile +++ b/zephyr/Makefile @@ -17,6 +17,9 @@ OUTDIR_PREFIX = $(BOARD) MICROPY_HEAP_SIZE = 16384 FROZEN_DIR = scripts +# Default target +all: + # Zephyr (generated) config files - must be defined before include below Z_EXPORTS = outdir/$(OUTDIR_PREFIX)/Makefile.export ifneq ($(MAKECMDGOALS), clean) From b0699fed0b6183be9887384f3bcf68cbb8841a36 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 2 Aug 2017 23:25:05 +0200 Subject: [PATCH 233/403] disable badge.unmount_sdcard() for now.. --- esp32/modbadge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 2d4c37c48..27ef1daa2 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -497,6 +497,7 @@ STATIC mp_obj_t badge_unmount_sdcard() { return mp_const_none; } +/* sdcard_mounted = false; // All done, unmount partition and disable SDMMC host peripheral @@ -504,6 +505,8 @@ STATIC mp_obj_t badge_unmount_sdcard() { ESP_LOGI(TAG, "Card unmounted"); badge_power_sdcard_disable(); +*/ + printf("Unmounting the sdcard is not yet supported.\n"); return mp_const_none; } From d19109ae0c4da0cad9e92e5a594fbd8caca0457e Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 23:42:17 +0200 Subject: [PATCH 234/403] Add power management to launcher --- esp32/modules/launcher.py | 91 ++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 8979ed0b3..f91418b6a 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,4 +1,4 @@ -import ugfx, badge, sys, uos as os, appglue, version, easydraw +import ugfx, badge, sys, uos as os, appglue, version, easydraw, virtualtimers, tasks.powermanagement as pm def populate_it(): global options @@ -18,11 +18,10 @@ def populate_it(): options.add_item('setup') -def run_it(pushed): - if (pushed): - selected = options.selected_text() - options.destroy() - appglue.start_app(selected) +def run_it(): + selected = options.selected_text() + options.destroy() + appglue.start_app(selected) def expandhome(s): if "~/" in s: @@ -42,27 +41,26 @@ def get_install_path(): install_path = expandhome(install_path) return install_path -def uninstall_it(pushed): - if (pushed): - selected = options.selected_text() - if selected == 'installer': - return - if selected == 'ota_update': - return - options.destroy() - - def perform_uninstall(ok): - if ok: - easydraw.msg(selected,"Uninstalling...",True) - install_path = get_install_path() - for rm_file in os.listdir("%s/%s" % (install_path, selected)): - os.remove("%s/%s/%s" % (install_path, selected, rm_file)) - os.rmdir("%s/%s" % (install_path, selected)) - badge.eink_busy_wait() - appglue.start_app('launcher') - - import dialogs - uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) +def uninstall_it(): + selected = options.selected_text() + if selected == 'installer': + return + if selected == 'ota_update': + return + options.destroy() + + def perform_uninstall(ok): + if ok: + easydraw.msg(selected,"Uninstalling...",True) + install_path = get_install_path() + for rm_file in os.listdir("%s/%s" % (install_path, selected)): + os.remove("%s/%s/%s" % (install_path, selected, rm_file)) + os.rmdir("%s/%s" % (install_path, selected)) + badge.eink_busy_wait() + appglue.start_app('launcher') + + import dialogs + uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) ugfx.input_init() @@ -100,13 +98,38 @@ def perform_uninstall(ok): populate_it() -ugfx.input_attach(ugfx.BTN_A, run_it) -ugfx.input_attach(ugfx.BTN_SELECT, uninstall_it) - -ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0) -ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0) +def input_a(pressed): + pm.feed() + if pressed: + run_it() + +def input_b(pressed): + pm.feed() + if pressed: + appglue.home() -ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.home() if pushed else 0) -#ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.home() if pushed else 0) +def input_select(pressed): + pm.feed() + if pressed: + uninstall_it() + +def input_other(pressed): + pm.feed() + if pressed: + ugfx.flush() + +ugfx.input_attach(ugfx.BTN_A, input_a) +ugfx.input_attach(ugfx.BTN_B, input_b) +ugfx.input_attach(ugfx.BTN_SELECT, input_select) +ugfx.input_attach(ugfx.JOY_UP, input_other) +ugfx.input_attach(ugfx.JOY_DOWN, input_other) +ugfx.input_attach(ugfx.JOY_LEFT, input_other) +ugfx.input_attach(ugfx.JOY_RIGHT, input_other) +ugfx.input_attach(ugfx.BTN_START, input_other) ugfx.flush(ugfx.LUT_FULL) + +# Power management +virtualtimers.activate(1000) # Start scheduler with 1 second ticks +pm.set_timeout(5*60*1000) # Set timeout to 5 minutes +pm.feed() # Feed the power management task, starts the countdown... From 7d07964865d67a62586cdaba68c7995099847aa8 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 23:48:08 +0200 Subject: [PATCH 235/403] Go to splash instead of sleep --- esp32/modules/launcher.py | 1 + 1 file changed, 1 insertion(+) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index f91418b6a..c202fd885 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -132,4 +132,5 @@ def input_other(pressed): # Power management virtualtimers.activate(1000) # Start scheduler with 1 second ticks pm.set_timeout(5*60*1000) # Set timeout to 5 minutes +pm.callback(appglue.home()) # Go to splash instead of sleep pm.feed() # Feed the power management task, starts the countdown... From 0a9cc6f1c5c366b707aeeead69a0ebc02410e43b Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 23:49:59 +0200 Subject: [PATCH 236/403] Oops --- esp32/modules/launcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index c202fd885..a060dadaf 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -132,5 +132,5 @@ def input_other(pressed): # Power management virtualtimers.activate(1000) # Start scheduler with 1 second ticks pm.set_timeout(5*60*1000) # Set timeout to 5 minutes -pm.callback(appglue.home()) # Go to splash instead of sleep +pm.callback(appglue.home) # Go to splash instead of sleep pm.feed() # Feed the power management task, starts the countdown... From 0ea431cebcac52981ffb0b543b61d79b393d7fe1 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Wed, 2 Aug 2017 23:58:47 +0200 Subject: [PATCH 237/403] Hmm --- esp32/modules/launcher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index a060dadaf..0dbe174f1 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -129,8 +129,11 @@ def input_other(pressed): ugfx.flush(ugfx.LUT_FULL) +def pm_cb(dummy): + appglue.home() + # Power management virtualtimers.activate(1000) # Start scheduler with 1 second ticks pm.set_timeout(5*60*1000) # Set timeout to 5 minutes -pm.callback(appglue.home) # Go to splash instead of sleep +pm.callback(pm_cb) # Go to splash instead of sleep pm.feed() # Feed the power management task, starts the countdown... From 8b7fee1492c0c097ecb38578eaf888112a0dd73a Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 13:28:48 +0200 Subject: [PATCH 238/403] Add updater --- esp32/modules/update.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 esp32/modules/update.py diff --git a/esp32/modules/update.py b/esp32/modules/update.py new file mode 100644 index 000000000..668833afa --- /dev/null +++ b/esp32/modules/update.py @@ -0,0 +1,26 @@ +import ugfx, woezel, easywifi, easydraw, appglue, time, os + +def stop(): + time.sleep(2) + appglue.start_app("launcher") + +easydraw.msg("Welcome!","Still updating anyway...",True) + + +if not easywifi.status(): + if not easywifi.enable(): + stop() + +try: + apps = os.listdir('lib') +except OSError: + easydraw.msg("There are no apps installed.") + stop() + +for app in apps: + easydraw.msg("Updating '"+app+"'...") + woezel.install(app) + easydraw.msg("Done!") + +easydraw.msg("All your apps are now up-to-date!") +stop() From eb58fbbeac48652bd5af21dc703e31b1bdff81d1 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 14:50:55 +0200 Subject: [PATCH 239/403] Add set_timeout --- esp32/modules/tasks/powermanagement.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index 01513b41b..92d27b263 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -1,13 +1,11 @@ # File: powermanagement.py -# Version: 1 +# Version: 2 # Description: Power management task, puts the badge to sleep when idle # License: MIT # Authors: Renze Nicolai import virtualtimers, deepsleep, badge, sys - - requestedStandbyTime = 0 onSleepCallback = None @@ -54,3 +52,8 @@ def callback(cb): ''' Set a callback which is run before sleeping ''' global onSleepCallback onSleepCallback = cb + +def set_timeout(t): + ''' Set timeout ''' + global userResponseTime + userResponseTime = t From 4370b2264ddb6052ac2cb1c6c21b4c252c7b582f Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Thu, 3 Aug 2017 15:15:19 +0200 Subject: [PATCH 240/403] add badge.mpr121_get_touch_info() --- esp32/modbadge.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 27ef1daa2..8b72cbc5a 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -38,6 +38,8 @@ #include "bpp_init.h" +#include "badge_mpr121.h" + #include "py/mperrno.h" #include "py/mphal.h" #include "py/runtime.h" @@ -211,6 +213,31 @@ STATIC mp_obj_t badge_nvs_set_u16_(mp_obj_t _namespace, mp_obj_t _key, mp_obj_t STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); +// Mpr121 (badge_mpr121.h) +#ifdef I2C_MPR121_ADDR +STATIC mp_obj_t badge_mpr121_get_touch_info_(void) { + struct badge_mpr121_touch_info info; + esp_err_t err = badge_mpr121_get_touch_info(&info); + if (err != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + + mp_obj_t list_items[8]; + int i; + for (i=0; i<8; i++) { + list_items[i] = mp_obj_new_dict(4); + mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_data), mp_obj_new_int(info.data[i])); + mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_baseline), mp_obj_new_int(info.baseline[i])); + mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_touch), mp_obj_new_int(info.touch[i])); + mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_release), mp_obj_new_int(info.release[i])); + } + mp_obj_t list = mp_obj_new_list(8, list_items); + return list; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_mpr121_get_touch_info_obj, badge_mpr121_get_touch_info_); +#endif // I2C_MPR121_ADDR + + // E-Ink (badge_eink.h) STATIC mp_obj_t badge_eink_init_() { @@ -536,6 +563,11 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&badge_init_obj)}, + // Mpr121 +#ifdef I2C_MPR121_ADDR + {MP_ROM_QSTR(MP_QSTR_mpr121_get_touch_info), MP_ROM_PTR(&badge_mpr121_get_touch_info_obj)}, +#endif // I2C_MPR121_ADDR + // E-Ink {MP_ROM_QSTR(MP_QSTR_eink_init), MP_ROM_PTR(&badge_eink_init_obj)}, {MP_ROM_QSTR(MP_QSTR_eink_deep_sleep), MP_ROM_PTR(&badge_eink_deep_sleep_obj)}, From 9a5f961b1ad81ed05c810c908a209db53514d671 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 15:29:32 +0200 Subject: [PATCH 241/403] New launcher --- esp32/modules/launcher.py | 241 +++++++++++++++++++++++--------------- 1 file changed, 147 insertions(+), 94 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 0dbe174f1..82db21d49 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,27 +1,95 @@ -import ugfx, badge, sys, uos as os, appglue, version, easydraw, virtualtimers, tasks.powermanagement as pm +import ugfx, badge, sys, uos as os, appglue, version, easydraw, virtualtimers, tasks.powermanagement as pm, dialogs -def populate_it(): - global options - options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) +# Application list - try: - apps = os.listdir('lib') - except OSError: - apps = [] +apps = [] - options.add_item('installer') - options.add_item('ota_update') +def add_app(app,title,category): + global apps + info = {"file":app,"title":title,"category":category} + apps.append(info) +def populate_apps(): + global apps + apps = [] + try: + userApps = os.listdir('lib') + except OSError: + userApps = [] + for app in userApps: + title = app + category = "" + if app=="resources": + category = "hidden" + add_app(app,title,category) + add_app("installer","Installer","system") + add_app("setup","Set nickname","system") + add_app("update","Update apps","system") + add_app("ota_update","Update firmware","system") + +# List as shown on screen +currentListTitles = [] +currentListTargets = [] + +def populate_category(category="",system=True): + global apps + global currentListTitles + global currentListTargets + currentListTitles = [] + currentListTargets = [] for app in apps: - if not app=="resources": - options.add_item(app) + if category=="" or category==app["category"] or (system and app["category"]=="system"): + currentListTitles.append(app["title"]) + currentListTargets.append(app) - options.add_item('setup') +def populate_options(): + global options + options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) + global currentListTitles + for title in currentListTitles: + options.add_item(title) + +# Uninstaller + +def uninstall(): + global options + selected = options.selected_index() + options.destroy() + + global currentListTitles + global currentListTargets + + easydraw.msg("Removing "+currentListTitles[selected]+"...", "Uninstalling...",True) + + if currentListTargets[selected]["category"] == "system": + dialogs.notice("You can not uninstall system apps, sorry!","Can not uninstall '"+currentListTitles[selected]+"'") + start() + return + + def perform_uninstall(ok): + if ok: + print("UNINSTALLING") + install_path = get_install_path() + for rm_file in os.listdir("%s/%s" % (install_path, selected)): + easydraw.msg("Deleting '"+rm_file+"'...") + os.remove("%s/%s/%s" % (install_path, selected, rm_file)) + os.rmdir("%s/%s" % (install_path, selected)) + else: + print("CANCELED") + start() + + uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) + +# Run app -def run_it(): - selected = options.selected_text() +def run(): + global options + selected = options.selected_index() options.destroy() - appglue.start_app(selected) + global currentListTargets + appglue.start_app(currentListTargets[selected]["file"]) + +# Path def expandhome(s): if "~/" in s: @@ -29,10 +97,6 @@ def expandhome(s): s = s.replace("~/", h + "/") return s -def gohome(pressed): - if(pressed): - appglue.home() - def get_install_path(): global install_path if install_path is None: @@ -41,67 +105,12 @@ def get_install_path(): install_path = expandhome(install_path) return install_path -def uninstall_it(): - selected = options.selected_text() - if selected == 'installer': - return - if selected == 'ota_update': - return - options.destroy() - - def perform_uninstall(ok): - if ok: - easydraw.msg(selected,"Uninstalling...",True) - install_path = get_install_path() - for rm_file in os.listdir("%s/%s" % (install_path, selected)): - os.remove("%s/%s/%s" % (install_path, selected, rm_file)) - os.rmdir("%s/%s" % (install_path, selected)) - badge.eink_busy_wait() - appglue.start_app('launcher') - - import dialogs - uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) - - -ugfx.input_init() -ugfx.set_lut(ugfx.LUT_FASTER) -ugfx.clear(ugfx.BLACK) -ugfx.flush() -ugfx.clear(ugfx.WHITE) -ugfx.flush() - -ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) - -#the line under the text -str_len = ugfx.get_string_width("Hacking","PermanentMarker22") -line_begin = 148 + int((148-str_len)/2) -line_end = str_len+line_begin -ugfx.line(line_begin, 46, line_end, 46, ugfx.BLACK) - -#the cursor past the text -cursor_pos = line_end+5 -ugfx.line(cursor_pos, 22, cursor_pos, 44, ugfx.BLACK) - -# Instructions -ugfx.line(148, 78, 296, 78, ugfx.BLACK) -ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) -ugfx.string_box(148,78,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) -ugfx.string_box(148,92,148,18, " SELECT: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) -ugfx.line(148, 110, 296, 110, ugfx.BLACK) -ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) - -# ugfx.flush() -options = None -install_path = None - -populate_it() +# Actions def input_a(pressed): pm.feed() if pressed: - run_it() + run() def input_b(pressed): pm.feed() @@ -111,29 +120,73 @@ def input_b(pressed): def input_select(pressed): pm.feed() if pressed: - uninstall_it() + uninstall() def input_other(pressed): pm.feed() if pressed: ugfx.flush() -ugfx.input_attach(ugfx.BTN_A, input_a) -ugfx.input_attach(ugfx.BTN_B, input_b) -ugfx.input_attach(ugfx.BTN_SELECT, input_select) -ugfx.input_attach(ugfx.JOY_UP, input_other) -ugfx.input_attach(ugfx.JOY_DOWN, input_other) -ugfx.input_attach(ugfx.JOY_LEFT, input_other) -ugfx.input_attach(ugfx.JOY_RIGHT, input_other) -ugfx.input_attach(ugfx.BTN_START, input_other) - -ugfx.flush(ugfx.LUT_FULL) - +# Power management def pm_cb(dummy): appglue.home() -# Power management -virtualtimers.activate(1000) # Start scheduler with 1 second ticks -pm.set_timeout(5*60*1000) # Set timeout to 5 minutes -pm.callback(pm_cb) # Go to splash instead of sleep -pm.feed() # Feed the power management task, starts the countdown... +def init_power_management(): + virtualtimers.activate(1000) # Start scheduler with 1 second ticks + pm.set_timeout(5*60*1000) # Set timeout to 5 minutes + pm.callback(pm_cb) # Go to splash instead of sleep + pm.feed() # Feed the power management task, starts the countdown... + +# Main application +def start(): + ugfx.input_init() + ugfx.set_lut(ugfx.LUT_FASTER) + ugfx.clear(ugfx.BLACK) + ugfx.flush() + ugfx.clear(ugfx.WHITE) + ugfx.flush() + + ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) + ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + + #the line under the text + str_len = ugfx.get_string_width("Hacking","PermanentMarker22") + line_begin = 148 + int((148-str_len)/2) + line_end = str_len+line_begin + ugfx.line(line_begin, 46, line_end, 46, ugfx.BLACK) + + #the cursor past the text + cursor_pos = line_end+5 + ugfx.line(cursor_pos, 22, cursor_pos, 44, ugfx.BLACK) + + # Instructions + ugfx.line(148, 78, 296, 78, ugfx.BLACK) + ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.string_box(148,78,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) + ugfx.string_box(148,92,148,18, " SELECT: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.line(148, 110, 296, 110, ugfx.BLACK) + ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + + global options + global install_path + options = None + install_path = None + + ugfx.input_attach(ugfx.BTN_A, input_a) + ugfx.input_attach(ugfx.BTN_B, input_b) + ugfx.input_attach(ugfx.BTN_SELECT, input_select) + ugfx.input_attach(ugfx.JOY_UP, input_other) + ugfx.input_attach(ugfx.JOY_DOWN, input_other) + ugfx.input_attach(ugfx.JOY_LEFT, input_other) + ugfx.input_attach(ugfx.JOY_RIGHT, input_other) + ugfx.input_attach(ugfx.BTN_START, input_other) + + populate_apps() + populate_category() + populate_options() + + ugfx.flush(ugfx.LUT_FULL) + +start() +init_power_management() From 88a7d9185a95713d162b75338ab9235578f6b712 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 15:29:32 +0200 Subject: [PATCH 242/403] New launcher --- esp32/modules/launcher.py | 241 +++++++++++++++++++++++--------------- 1 file changed, 147 insertions(+), 94 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 0dbe174f1..82db21d49 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,27 +1,95 @@ -import ugfx, badge, sys, uos as os, appglue, version, easydraw, virtualtimers, tasks.powermanagement as pm +import ugfx, badge, sys, uos as os, appglue, version, easydraw, virtualtimers, tasks.powermanagement as pm, dialogs -def populate_it(): - global options - options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) +# Application list - try: - apps = os.listdir('lib') - except OSError: - apps = [] +apps = [] - options.add_item('installer') - options.add_item('ota_update') +def add_app(app,title,category): + global apps + info = {"file":app,"title":title,"category":category} + apps.append(info) +def populate_apps(): + global apps + apps = [] + try: + userApps = os.listdir('lib') + except OSError: + userApps = [] + for app in userApps: + title = app + category = "" + if app=="resources": + category = "hidden" + add_app(app,title,category) + add_app("installer","Installer","system") + add_app("setup","Set nickname","system") + add_app("update","Update apps","system") + add_app("ota_update","Update firmware","system") + +# List as shown on screen +currentListTitles = [] +currentListTargets = [] + +def populate_category(category="",system=True): + global apps + global currentListTitles + global currentListTargets + currentListTitles = [] + currentListTargets = [] for app in apps: - if not app=="resources": - options.add_item(app) + if category=="" or category==app["category"] or (system and app["category"]=="system"): + currentListTitles.append(app["title"]) + currentListTargets.append(app) - options.add_item('setup') +def populate_options(): + global options + options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height()) + global currentListTitles + for title in currentListTitles: + options.add_item(title) + +# Uninstaller + +def uninstall(): + global options + selected = options.selected_index() + options.destroy() + + global currentListTitles + global currentListTargets + + easydraw.msg("Removing "+currentListTitles[selected]+"...", "Uninstalling...",True) + + if currentListTargets[selected]["category"] == "system": + dialogs.notice("You can not uninstall system apps, sorry!","Can not uninstall '"+currentListTitles[selected]+"'") + start() + return + + def perform_uninstall(ok): + if ok: + print("UNINSTALLING") + install_path = get_install_path() + for rm_file in os.listdir("%s/%s" % (install_path, selected)): + easydraw.msg("Deleting '"+rm_file+"'...") + os.remove("%s/%s/%s" % (install_path, selected, rm_file)) + os.rmdir("%s/%s" % (install_path, selected)) + else: + print("CANCELED") + start() + + uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) + +# Run app -def run_it(): - selected = options.selected_text() +def run(): + global options + selected = options.selected_index() options.destroy() - appglue.start_app(selected) + global currentListTargets + appglue.start_app(currentListTargets[selected]["file"]) + +# Path def expandhome(s): if "~/" in s: @@ -29,10 +97,6 @@ def expandhome(s): s = s.replace("~/", h + "/") return s -def gohome(pressed): - if(pressed): - appglue.home() - def get_install_path(): global install_path if install_path is None: @@ -41,67 +105,12 @@ def get_install_path(): install_path = expandhome(install_path) return install_path -def uninstall_it(): - selected = options.selected_text() - if selected == 'installer': - return - if selected == 'ota_update': - return - options.destroy() - - def perform_uninstall(ok): - if ok: - easydraw.msg(selected,"Uninstalling...",True) - install_path = get_install_path() - for rm_file in os.listdir("%s/%s" % (install_path, selected)): - os.remove("%s/%s/%s" % (install_path, selected, rm_file)) - os.rmdir("%s/%s" % (install_path, selected)) - badge.eink_busy_wait() - appglue.start_app('launcher') - - import dialogs - uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) - - -ugfx.input_init() -ugfx.set_lut(ugfx.LUT_FASTER) -ugfx.clear(ugfx.BLACK) -ugfx.flush() -ugfx.clear(ugfx.WHITE) -ugfx.flush() - -ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) -ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) - -#the line under the text -str_len = ugfx.get_string_width("Hacking","PermanentMarker22") -line_begin = 148 + int((148-str_len)/2) -line_end = str_len+line_begin -ugfx.line(line_begin, 46, line_end, 46, ugfx.BLACK) - -#the cursor past the text -cursor_pos = line_end+5 -ugfx.line(cursor_pos, 22, cursor_pos, 44, ugfx.BLACK) - -# Instructions -ugfx.line(148, 78, 296, 78, ugfx.BLACK) -ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) -ugfx.string_box(148,78,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) -ugfx.string_box(148,92,148,18, " SELECT: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) -ugfx.line(148, 110, 296, 110, ugfx.BLACK) -ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) - -# ugfx.flush() -options = None -install_path = None - -populate_it() +# Actions def input_a(pressed): pm.feed() if pressed: - run_it() + run() def input_b(pressed): pm.feed() @@ -111,29 +120,73 @@ def input_b(pressed): def input_select(pressed): pm.feed() if pressed: - uninstall_it() + uninstall() def input_other(pressed): pm.feed() if pressed: ugfx.flush() -ugfx.input_attach(ugfx.BTN_A, input_a) -ugfx.input_attach(ugfx.BTN_B, input_b) -ugfx.input_attach(ugfx.BTN_SELECT, input_select) -ugfx.input_attach(ugfx.JOY_UP, input_other) -ugfx.input_attach(ugfx.JOY_DOWN, input_other) -ugfx.input_attach(ugfx.JOY_LEFT, input_other) -ugfx.input_attach(ugfx.JOY_RIGHT, input_other) -ugfx.input_attach(ugfx.BTN_START, input_other) - -ugfx.flush(ugfx.LUT_FULL) - +# Power management def pm_cb(dummy): appglue.home() -# Power management -virtualtimers.activate(1000) # Start scheduler with 1 second ticks -pm.set_timeout(5*60*1000) # Set timeout to 5 minutes -pm.callback(pm_cb) # Go to splash instead of sleep -pm.feed() # Feed the power management task, starts the countdown... +def init_power_management(): + virtualtimers.activate(1000) # Start scheduler with 1 second ticks + pm.set_timeout(5*60*1000) # Set timeout to 5 minutes + pm.callback(pm_cb) # Go to splash instead of sleep + pm.feed() # Feed the power management task, starts the countdown... + +# Main application +def start(): + ugfx.input_init() + ugfx.set_lut(ugfx.LUT_FASTER) + ugfx.clear(ugfx.BLACK) + ugfx.flush() + ugfx.clear(ugfx.WHITE) + ugfx.flush() + + ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) + ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + + #the line under the text + str_len = ugfx.get_string_width("Hacking","PermanentMarker22") + line_begin = 148 + int((148-str_len)/2) + line_end = str_len+line_begin + ugfx.line(line_begin, 46, line_end, 46, ugfx.BLACK) + + #the cursor past the text + cursor_pos = line_end+5 + ugfx.line(cursor_pos, 22, cursor_pos, 44, ugfx.BLACK) + + # Instructions + ugfx.line(148, 78, 296, 78, ugfx.BLACK) + ugfx.string_box(148,78,148,18, " A: Run", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.string_box(148,78,148,18, " B: Return to home", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyRight) + ugfx.string_box(148,92,148,18, " SELECT: Uninstall", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + ugfx.line(148, 110, 296, 110, ugfx.BLACK) + ugfx.string_box(148,110,148,18, " " + version.name, "Roboto_Regular12", ugfx.BLACK, ugfx.justifyLeft) + + global options + global install_path + options = None + install_path = None + + ugfx.input_attach(ugfx.BTN_A, input_a) + ugfx.input_attach(ugfx.BTN_B, input_b) + ugfx.input_attach(ugfx.BTN_SELECT, input_select) + ugfx.input_attach(ugfx.JOY_UP, input_other) + ugfx.input_attach(ugfx.JOY_DOWN, input_other) + ugfx.input_attach(ugfx.JOY_LEFT, input_other) + ugfx.input_attach(ugfx.JOY_RIGHT, input_other) + ugfx.input_attach(ugfx.BTN_START, input_other) + + populate_apps() + populate_category() + populate_options() + + ugfx.flush(ugfx.LUT_FULL) + +start() +init_power_management() From f73ac0ef7fbf256b31608ebf637705b32f1c36aa Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Thu, 3 Aug 2017 15:45:46 +0200 Subject: [PATCH 243/403] do not re-install the gpio-isr-service. it's already installed. --- esp32/machine_pin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/machine_pin.c b/esp32/machine_pin.c index d62d6c1cc..b70bcf1a7 100644 --- a/esp32/machine_pin.c +++ b/esp32/machine_pin.c @@ -92,7 +92,7 @@ STATIC const machine_pin_obj_t machine_pin_obj[] = { STATIC const machine_pin_irq_obj_t machine_pin_irq_object[]; void machine_pins_init(void) { - static bool did_install = false; + static bool did_install = true; // already done in badge_base.c if (!did_install) { gpio_install_isr_service(0); did_install = true; From 8386e2271129180172aed137da247c46fb9ad93e Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Thu, 3 Aug 2017 16:06:01 +0200 Subject: [PATCH 244/403] add simple wrapper for low-level bpp flash data --- esp32/Makefile | 1 + esp32/modbpp.c | 105 +++++++++++++++++++++++++++++++++++++++++++ esp32/modbpp.h | 2 + esp32/mpconfigport.h | 2 + 4 files changed, 110 insertions(+) create mode 100644 esp32/modbpp.c create mode 100644 esp32/modbpp.h diff --git a/esp32/Makefile b/esp32/Makefile index 2d9bfb6ce..a63348d51 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -162,6 +162,7 @@ SRC_C = \ modnetwork.c \ modsocket.c \ modesp.c \ + modbpp.c \ modbadge.c \ modugfx.c \ moduhashlib.c \ diff --git a/esp32/modbpp.c b/esp32/modbpp.c new file mode 100644 index 000000000..8e7811e8c --- /dev/null +++ b/esp32/modbpp.c @@ -0,0 +1,105 @@ +#include +#include +#include "esp_spi_flash.h" +#include "wear_levelling.h" + +#include "drivers/dht/dht.h" +#include "modesp.h" +#include "py/mperrno.h" +#include "py/mphal.h" +#include "py/runtime.h" + +STATIC wl_handle_t fs_handle = WL_INVALID_HANDLE; +STATIC size_t wl_sect_size = 4096; + +STATIC const esp_partition_t *fs_part = NULL; + +static void bpp_flash_init(void) { + if (fs_handle != WL_INVALID_HANDLE) + return; + + if (fs_part == NULL) { + fs_part = esp_partition_find_first(0x20, 0x17, "remfs"); + if (fs_part == NULL) { + printf("Bpp partition not found.\n"); + mp_raise_OSError(MP_EIO); + } + } + + esp_err_t res = wl_mount(fs_part, &fs_handle); + if (res != ESP_OK) { + printf("Failed to initialize wear-leveling on bpp partition.\n"); + mp_raise_OSError(MP_EIO); + } + + wl_sect_size = wl_sector_size(fs_handle); +} + +STATIC mp_obj_t bpp_flash_read(mp_obj_t offset_in, mp_obj_t buf_in) { + bpp_flash_init(); + mp_int_t offset = mp_obj_get_int(offset_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + + esp_err_t res = wl_read(fs_handle, offset, bufinfo.buf, bufinfo.len); + if (res != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(bpp_flash_read_obj, bpp_flash_read); + +STATIC mp_obj_t bpp_flash_write(mp_obj_t offset_in, mp_obj_t buf_in) { + bpp_flash_init(); + mp_int_t offset = mp_obj_get_int(offset_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + + esp_err_t res = wl_write(fs_handle, offset, bufinfo.buf, bufinfo.len); + if (res != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(bpp_flash_write_obj, bpp_flash_write); + +STATIC mp_obj_t bpp_flash_erase(mp_obj_t sector_in) { + bpp_flash_init(); + mp_int_t sector = mp_obj_get_int(sector_in); + + esp_err_t res = wl_erase_range(fs_handle, sector * wl_sect_size, wl_sect_size); + if (res != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bpp_flash_erase_obj, bpp_flash_erase); + +STATIC mp_obj_t bpp_flash_size(void) { + bpp_flash_init(); + return mp_obj_new_int_from_uint(fs_part->size); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(bpp_flash_size_obj, bpp_flash_size); + +STATIC mp_obj_t bpp_flash_sec_size() { + bpp_flash_init(); + return mp_obj_new_int_from_uint(wl_sect_size); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(bpp_flash_sec_size_obj, bpp_flash_sec_size); + + +STATIC const mp_rom_map_elem_t bpp_module_globals_table[] = { + {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bpp)}, + + { MP_ROM_QSTR(MP_QSTR_flash_read), MP_ROM_PTR(&bpp_flash_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_write), MP_ROM_PTR(&bpp_flash_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_erase), MP_ROM_PTR(&bpp_flash_erase_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_size), MP_ROM_PTR(&bpp_flash_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_sec_size), MP_ROM_PTR(&bpp_flash_sec_size_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(bpp_module_globals, bpp_module_globals_table); + +const mp_obj_module_t bpp_module = { + .base = {&mp_type_module}, .globals = (mp_obj_dict_t *)&bpp_module_globals, +}; diff --git a/esp32/modbpp.h b/esp32/modbpp.h new file mode 100644 index 000000000..ec29539c7 --- /dev/null +++ b/esp32/modbpp.h @@ -0,0 +1,2 @@ +#include "esprtcmem.h" +#include "esp_spi_flash.h" diff --git a/esp32/mpconfigport.h b/esp32/mpconfigport.h index 5b85a832f..85c97b45d 100644 --- a/esp32/mpconfigport.h +++ b/esp32/mpconfigport.h @@ -177,6 +177,7 @@ extern const struct _mp_obj_module_t mp_module_usocket; extern const struct _mp_obj_module_t mp_module_machine; extern const struct _mp_obj_module_t mp_module_network; extern const struct _mp_obj_module_t badge_module; +extern const struct _mp_obj_module_t bpp_module; extern const struct _mp_obj_module_t ugfx_module; extern const struct _mp_obj_module_t mp_module_onewire; @@ -188,6 +189,7 @@ extern const struct _mp_obj_module_t mp_module_onewire; { MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&mp_module_network }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_badge), (mp_obj_t)&badge_module }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_bpp), (mp_obj_t)&bpp_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_ugfx), (mp_obj_t)&ugfx_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&mp_module_onewire }, \ From 6b225f0d3b43b0025db9eaf8b9a02670111f107d Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 16:27:52 +0200 Subject: [PATCH 245/403] Now everything should work --- esp32/modules/launcher.py | 50 ++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 82db21d49..62d5732a9 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -1,4 +1,4 @@ -import ugfx, badge, sys, uos as os, appglue, version, easydraw, virtualtimers, tasks.powermanagement as pm, dialogs +import ugfx, badge, sys, uos as os, appglue, version, easydraw, virtualtimers, tasks.powermanagement as pm, dialogs, time, ujson, sys # Application list @@ -17,10 +17,11 @@ def populate_apps(): except OSError: userApps = [] for app in userApps: - title = app - category = "" + [title,category] = read_info(app) + if app=="resources": category = "hidden" + add_app(app,title,category) add_app("installer","Installer","system") add_app("setup","Set nickname","system") @@ -38,7 +39,7 @@ def populate_category(category="",system=True): currentListTitles = [] currentListTargets = [] for app in apps: - if category=="" or category==app["category"] or (system and app["category"]=="system"): + if (category=="" or category==app["category"] or (system and app["category"]=="system")) and (not app["category"]=="hidden"): currentListTitles.append(app["title"]) currentListTargets.append(app) @@ -48,7 +49,23 @@ def populate_options(): global currentListTitles for title in currentListTitles: options.add_item(title) - + +# Read app info +def read_info(app): + try: + install_path = get_install_path() + info_file = "%s/%s/app.json" % (install_path, app) + print("Reading "+info_file+"...") + fd = open(info_file) + information = ujson.loads(fd.read()) + title = information["title"] + category = information["category"] + return [title,category] + except BaseException as e: + print("[ERROR] Can not read info for app "+app) + sys.print_exception(e) + return [app,""] + # Uninstaller def uninstall(): @@ -58,27 +75,28 @@ def uninstall(): global currentListTitles global currentListTargets - - easydraw.msg("Removing "+currentListTitles[selected]+"...", "Uninstalling...",True) - + if currentListTargets[selected]["category"] == "system": - dialogs.notice("You can not uninstall system apps, sorry!","Can not uninstall '"+currentListTitles[selected]+"'") + #dialogs.notice("System apps can not be removed!","Can not uninstall '"+currentListTitles[selected]+"'") + easydraw.msg("System apps can not be removed!","Error",True) + time.sleep(2) start() return def perform_uninstall(ok): + global install_path if ok: - print("UNINSTALLING") + easydraw.msg("Removing "+currentListTitles[selected]+"...", "Still Uninstalling Anyway...",True) install_path = get_install_path() - for rm_file in os.listdir("%s/%s" % (install_path, selected)): + for rm_file in os.listdir("%s/%s" % (install_path, currentListTargets[selected]["file"])): easydraw.msg("Deleting '"+rm_file+"'...") - os.remove("%s/%s/%s" % (install_path, selected, rm_file)) - os.rmdir("%s/%s" % (install_path, selected)) - else: - print("CANCELED") + os.remove("%s/%s/%s" % (install_path, currentListTargets[selected]["file"], rm_file)) + easydraw.msg("Deleting folder...") + os.rmdir("%s/%s" % (install_path, currentListTargets[selected]["file"])) + easydraw.msg("Uninstall completed!") start() - uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall) + uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % currentListTitles[selected], cb=perform_uninstall) # Run app From f1f394dc7888a389e3ed0f8238093c707b517659 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 16:43:14 +0200 Subject: [PATCH 246/403] Use existing metadata.json instead of app.json --- esp32/modules/launcher.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 62d5732a9..0226a8484 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -4,8 +4,16 @@ apps = [] -def add_app(app,title,category): +def add_app(app,information): global apps + try: + title = information["name"] + except: + title = app + try: + category = information["category"] + except: + category = "" info = {"file":app,"title":title,"category":category} apps.append(info) @@ -17,16 +25,11 @@ def populate_apps(): except OSError: userApps = [] for app in userApps: - [title,category] = read_info(app) - - if app=="resources": - category = "hidden" - - add_app(app,title,category) - add_app("installer","Installer","system") - add_app("setup","Set nickname","system") - add_app("update","Update apps","system") - add_app("ota_update","Update firmware","system") + add_app(app,read_metadata(app)) + add_app("installer",{"name":"Installer", "category":"system"}) + add_app("setup",{"name":"Set nickname", "category":"system"}) + add_app("update",{"name":"Update apps", "category":"system"}) + add_app("ota_update",{"name":"Update firmware", "category":"system"}) # List as shown on screen currentListTitles = [] @@ -50,20 +53,19 @@ def populate_options(): for title in currentListTitles: options.add_item(title) -# Read app info -def read_info(app): +# Read app metadata +def read_metadata(app): try: install_path = get_install_path() - info_file = "%s/%s/app.json" % (install_path, app) + info_file = "%s/%s/metadata.json" % (install_path, app) print("Reading "+info_file+"...") fd = open(info_file) information = ujson.loads(fd.read()) - title = information["title"] - category = information["category"] - return [title,category] + return information except BaseException as e: - print("[ERROR] Can not read info for app "+app) + print("[ERROR] Can not read metadata for app "+app) sys.print_exception(e) + information = {"name":app,"description":"","category":"", "author":"","revision":0} return [app,""] # Uninstaller From 0bf0e2b61cd5d6df342d55b656d48ffb6e9d9a05 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Thu, 3 Aug 2017 17:06:08 +0200 Subject: [PATCH 247/403] this works more stable.. --- esp32/modbadge.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 8b72cbc5a..155ce1eaa 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -215,6 +215,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); // Mpr121 (badge_mpr121.h) #ifdef I2C_MPR121_ADDR +#define store_dict_int(dict, field, contents) mp_obj_dict_store(dict, mp_obj_new_str(field, strlen(field), false), mp_obj_new_int(contents)); STATIC mp_obj_t badge_mpr121_get_touch_info_(void) { struct badge_mpr121_touch_info info; esp_err_t err = badge_mpr121_get_touch_info(&info); @@ -225,11 +226,14 @@ STATIC mp_obj_t badge_mpr121_get_touch_info_(void) { mp_obj_t list_items[8]; int i; for (i=0; i<8; i++) { - list_items[i] = mp_obj_new_dict(4); - mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_data), mp_obj_new_int(info.data[i])); - mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_baseline), mp_obj_new_int(info.baseline[i])); - mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_touch), mp_obj_new_int(info.touch[i])); - mp_obj_dict_store(list_items[i], MP_OBJ_NEW_QSTR(MP_QSTR_release), mp_obj_new_int(info.release[i])); + list_items[i] = mp_obj_new_dict(0); + + mp_obj_dict_t *dict = MP_OBJ_TO_PTR(list_items[i]); + + store_dict_int(dict, "data", info.data[i]); + store_dict_int(dict, "baseline", info.baseline[i]); + store_dict_int(dict, "touch", info.touch[i]); + store_dict_int(dict, "release", info.release[i]); } mp_obj_t list = mp_obj_new_list(8, list_items); return list; From 23829c1eeffd1885c8e458b3c3799d674d5a6517 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 17:41:50 +0200 Subject: [PATCH 248/403] Now with bugs fixed and post ota update script --- esp32/modules/create.py | 42 +++++++++++++++++++++++++++++++++++++++ esp32/modules/inisetup.py | 22 ++------------------ esp32/modules/post_ota.py | 15 ++++++++++++++ esp32/modules/shell.py | 2 ++ esp32/modules/splash.py | 3 +++ 5 files changed, 64 insertions(+), 20 deletions(-) create mode 100644 esp32/modules/create.py create mode 100644 esp32/modules/post_ota.py create mode 100644 esp32/modules/shell.py diff --git a/esp32/modules/create.py b/esp32/modules/create.py new file mode 100644 index 000000000..f4c72b2e6 --- /dev/null +++ b/esp32/modules/create.py @@ -0,0 +1,42 @@ +import uos + +def boot(): + print("Updating 'boot.py'...") + with open("/boot.py", "w") as f: + f.write("""\ +# This file is executed on every boot (including wake-boot from deepsleep) +import badge, machine, esp, ugfx, sys +badge.init() +ugfx.init() +esp.rtcmem_write(0,0) +esp.rtcmem_write(1,0) +splash = badge.nvs_get_str('boot','splash','splash') +if machine.reset_cause() != machine.DEEPSLEEP_RESET: + print('[BOOT] Cold boot') +else: + print("[BOOT] Wake from sleep") + load_me = esp.rtcmem_read_string() + if load_me: + splash = load_me + print("starting %s" % load_me) + esp.rtcmem_write_string("") +try: + if not splash=="shell": + __import__(splash) + else: + ugfx.clear(ugfx.WHITE) + ugfx.flush(ugfx.LUT_FULL) +except BaseException as e: + sys.print_exception(e) + import easydraw + easydraw.msg("A fatal error occured!","Still Crashing Anyway", True) + easydraw.msg("") + easydraw.msg("Guru meditation:") + easydraw.msg(str(e)) + easydraw.msg("") + easydraw.msg("Rebooting in 5 seconds...") + import time + time.sleep(5) + import appglue + appglue.home() + """) diff --git a/esp32/modules/inisetup.py b/esp32/modules/inisetup.py index 3cdd0bbb7..354c094d1 100644 --- a/esp32/modules/inisetup.py +++ b/esp32/modules/inisetup.py @@ -3,24 +3,6 @@ def setup(): print("Performing initial setup") vfs = uos.VfsNative(True) - with open("/boot.py", "w") as f: - f.write("""\ -# This file is executed on every boot (including wake-boot from deepsleep) -import badge, machine, esp, ugfx -badge.init() -ugfx.init() -esp.rtcmem_write(0,0) -esp.rtcmem_write(1,0) -splash = badge.nvs_get_str('badge','boot.splash','splash') -if machine.reset_cause() != machine.DEEPSLEEP_RESET: - print('[BOOT.PY] Cold boot') -else: - print("[BOOT.PY] Wake from sleep") - load_me = esp.rtcmem_read_string() - if load_me: - splash = load_me - print("starting %s" % load_me) - esp.rtcmem_write_string("") -__import__(splash) -""") + import create + create.boot() return vfs diff --git a/esp32/modules/post_ota.py b/esp32/modules/post_ota.py new file mode 100644 index 000000000..64a95da34 --- /dev/null +++ b/esp32/modules/post_ota.py @@ -0,0 +1,15 @@ +import badge, easydraw + +def u0to1(): + import create + create.boot() + easydraw.msg("Applied patch 1") + +# Read current patch level +lvl = badge.nvs_get_u8('ota', 'fixlvl', 0) + +if lvl<1: + easydraw.msg("Running post OTA scripts...","Still updating anyways...",) + u0to1() + easydraw.msg("Post OTA update completed") + badge.nvs_set_u8('ota', 'fixlvl', 1) diff --git a/esp32/modules/shell.py b/esp32/modules/shell.py new file mode 100644 index 000000000..54eafe26a --- /dev/null +++ b/esp32/modules/shell.py @@ -0,0 +1,2 @@ +import appglue +appglue.start_app("shell") diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index fbc53b8d7..fdf10581b 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -123,6 +123,9 @@ def onSleep(idleTime): splash_input_init() splash_about_countdown_reset() +# post ota script +import post_ota + setupState = badge.nvs_get_u8('badge', 'setup.state', 0) if setupState == 0: #First boot print("[SPLASH] First boot (start setup)...") From 235f8004d312fec6071336979240dd46e3ac14b8 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 17:42:56 +0200 Subject: [PATCH 249/403] Add time --- esp32/modules/tasks/otacheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/tasks/otacheck.py b/esp32/modules/tasks/otacheck.py index 4b4e9ff60..7d963ac82 100644 --- a/esp32/modules/tasks/otacheck.py +++ b/esp32/modules/tasks/otacheck.py @@ -4,7 +4,7 @@ # License: MIT # Authors: Renze Nicolai -import easywifi, easydraw, badge +import easywifi, easydraw, badge, time def download_info(): import urequests as requests From 23f99a4fd0b572501865d54d1c7963322bd1c4b3 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Thu, 3 Aug 2017 17:45:45 +0200 Subject: [PATCH 250/403] add wrapper around badge_eink_display() method --- esp32/modbadge.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 155ce1eaa..5e90766f5 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -339,6 +339,33 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_eink_png_obj, badge_eink_png); /* END OF PNG READER TEST */ +/* Raw frame display */ +STATIC mp_obj_t badge_eink_display_raw(mp_obj_t obj_img, mp_obj_t obj_flags) +{ + bool is_bytes = MP_OBJ_IS_TYPE(obj_img, &mp_type_bytes); + + if (!is_bytes) { + mp_raise_msg(&mp_type_AttributeError, "First argument should be a bytestring"); + } + + // convert the input buffer into a byte array + mp_uint_t len; + uint8_t *buffer = (uint8_t *)mp_obj_str_get_data(obj_img, &len); + + int flags = mp_obj_get_int(obj_flags); + int expect_len = (flags & DISPLAY_FLAG_8BITPIXEL) ? BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT : BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT/8; + if (len != expect_len) { + mp_raise_msg(&mp_type_AttributeError, "First argument has wrong length"); + } + + // display the image directly + badge_eink_display(buffer, flags); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(badge_eink_display_raw_obj, badge_eink_display_raw); + + // Power (badge_power.h) STATIC mp_obj_t badge_power_init_() { @@ -614,6 +641,7 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_eink_busy_wait), MP_ROM_PTR(&badge_eink_busy_wait_obj)}, {MP_ROM_QSTR(MP_QSTR_eink_png), MP_ROM_PTR(&badge_eink_png_obj)}, + {MP_ROM_QSTR(MP_QSTR_eink_display_raw), MP_ROM_PTR(&badge_eink_display_raw_obj)}, /* {MP_ROM_QSTR(MP_QSTR_display_picture), MP_ROM_PTR(&badge_display_picture_obj)}, From 4dd77d615042385939ff559c2e7bd887f942395e Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 18:03:11 +0200 Subject: [PATCH 251/403] Change warning message --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index fdf10581b..66b709b51 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -174,5 +174,5 @@ def onSleep(idleTime): print("----") print("WARNING: POWER MANAGEMENT ACTIVE") -print("TO USE REPL START LAUNCHER") +print("To use shell type 'import shell' within 5 seconds.") print("----") From d2359f71d397c8233897fbfc38a93848039ad9db Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Thu, 3 Aug 2017 18:56:56 +0200 Subject: [PATCH 252/403] Fixed bugs --- esp32/modules/splash.py | 4 ++-- esp32/modules/tasks/services.py | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index fbc53b8d7..ec1d75427 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -1,5 +1,5 @@ # File: splash.py -# Version: 5 +# Version: 6 # Description: Homescreen for SHA2017 badge # License: MIT # Authors: Renze Nicolai @@ -109,7 +109,7 @@ def splash_input_init(): def onSleep(idleTime): draw(False, True) - services.force_draw() + services.force_draw(True) draw(True, True) ### PROGRAM diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index a5beb282a..642e8f4dc 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -1,5 +1,5 @@ # File: services.py -# Version: 4 +# Version: 5 # API version: 2 # Description: Background services for SHA2017 badge # License: MIT @@ -111,10 +111,7 @@ def setup(drawCb=None): print("[SERVICES] Loop requested but not defined in service "+app) if drawEnabled and drawCb: - try: - drawCallbacks.append(srv.draw) - except: - print("[SERVICES] Draw requested but not defined in service "+app) + drawCallbacks.append(srv) # Add the script to the global service list services.append(srv) @@ -137,9 +134,9 @@ def draw_task(): deleted = [] for i in range(0, len(drawCallbacks)): - cb = drawCallbacks[i] rqi = 0 try: + cb = drawCallbacks[i].draw [rqi, space_used] = cb(y) y = y - space_used except BaseException as e: @@ -155,6 +152,7 @@ def draw_task(): deleted.append(cb) for i in range(0,len(deleted)): + dcb = deleted[i] print("[DEBUG] Deleted draw callback: ",dcb) drawCallbacks = list(dcb for dcb in drawCallbacks if dcb!=deleted[i]) @@ -177,12 +175,19 @@ def draw_task(): drawCallback(True) # Complete draw return retVal -def force_draw(): +def force_draw(goingToSleep=False): global drawCallbacks if len(drawCallbacks)>0: y = ugfx.height() - for cb in drawCallbacks: + for srv in drawCallbacks: try: + if not goingToSleep: + cb = srv.draw + else: + try: + cb = srv.draw_going_to_sleep + except: + cb = srv.draw [rqi, space_used] = cb(y) y = y - space_used except BaseException as e: From b8b085c90f31e4f40daebfdca918faae5b15adfc Mon Sep 17 00:00:00 2001 From: Gavan Date: Fri, 4 Aug 2017 23:54:42 +0100 Subject: [PATCH 253/403] When no services want to specify a wakeup time, the wakeup time was being set to -1 before checking if the wakeup time was too short. Move that after the check to avoid a frequent redraw while the badge isn't in deep sleep. --- esp32/modules/tasks/services.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index 642e8f4dc..fafea4f69 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -158,15 +158,15 @@ def draw_task(): badge.eink_busy_wait() - if requestedInterval>=99999999: - print("[SERVICES] No draw interval returned.") - requestedInterval = -1 - if requestedInterval<1000: #Draw at most once a second print("[SERVICES] Can't draw more than once a second!") requestedInterval = 1000 + if requestedInterval>=99999999: + print("[SERVICES] No draw interval returned.") + requestedInterval = -1 + retVal = 0 if len(drawCallbacks)>0 and requestedInterval>=0: From d914aeddfa092276a7f79191075fe2498f57fe10 Mon Sep 17 00:00:00 2001 From: Gavan Date: Sat, 5 Aug 2017 00:24:57 +0100 Subject: [PATCH 254/403] Add a new optional argument to the draw() function in a service, which is True if the badge is going to sleep, and False otherwise. A service can detect its presence by setting a different value as a default. --- esp32/modules/tasks/services.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index fafea4f69..50c327439 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -137,7 +137,10 @@ def draw_task(): rqi = 0 try: cb = drawCallbacks[i].draw - [rqi, space_used] = cb(y) + try: + [rqi, space_used] = cb(y, False) + except: + [rqi, space_used] = cb(y) y = y - space_used except BaseException as e: print("[SERVICES] Exception in service draw:") @@ -188,7 +191,10 @@ def force_draw(goingToSleep=False): cb = srv.draw_going_to_sleep except: cb = srv.draw - [rqi, space_used] = cb(y) + try: + [rqi, space_used] = cb(y, True) + except: + [rqi, space_used] = cb(y) y = y - space_used except BaseException as e: print("[SERVICES] Exception in service draw: ") From e498c67b8f89492812b85f0b33e56ab65e1e19c3 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Sat, 5 Aug 2017 01:55:07 +0200 Subject: [PATCH 255/403] Wilde Weldoener --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 607287526..b2835698d 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 4 -name = "Olijke Opruimers" +build = 5 +name = "Wilde Weldoener" From 5afc342608f3d23082f3df792e4df668bc7ead82 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 5 Aug 2017 12:59:27 +0200 Subject: [PATCH 256/403] add experimental temperature sensor and hall sensor. This calls the esp-idf's internal temprature_sens_read() and hall_sens_read() methods. --- esp32/modesp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/esp32/modesp.c b/esp32/modesp.c index 133e3a10b..9c8f122d8 100644 --- a/esp32/modesp.c +++ b/esp32/modesp.c @@ -49,6 +49,21 @@ #include "sdmmc_cmd.h" #endif +/* esp.temperature_sens_read() */ +extern int temprature_sens_read(); +STATIC mp_obj_t esp_temperature_sens_read() { + return mp_obj_new_int_from_uint(temprature_sens_read()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_temperature_sens_read_obj, esp_temperature_sens_read); + +/* esp.hall_sens_read() */ +extern int hall_sens_read(); +STATIC mp_obj_t esp_hall_sens_read() { + return mp_obj_new_int_from_uint(hall_sens_read()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_hall_sens_read_obj, esp_hall_sens_read); + + STATIC wl_handle_t fs_handle = WL_INVALID_HANDLE; STATIC size_t wl_sect_size = 4096; @@ -361,6 +376,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_sdcard_sect_size_obj, esp_sdcard_sect_size) STATIC const mp_rom_map_elem_t esp_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_esp)}, + { MP_ROM_QSTR(MP_QSTR_temperature_sens_read), MP_ROM_PTR(&esp_temperature_sens_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_hall_sens_read), MP_ROM_PTR(&esp_hall_sens_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_read), MP_ROM_PTR(&esp_flash_read_obj) }, { MP_ROM_QSTR(MP_QSTR_flash_write), MP_ROM_PTR(&esp_flash_write_obj) }, { MP_ROM_QSTR(MP_QSTR_flash_erase), MP_ROM_PTR(&esp_flash_erase_obj) }, From 301d3aa7bbaac0c85f1d49cfff11a436aac4bcdf Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Sat, 5 Aug 2017 13:29:08 +0200 Subject: [PATCH 257/403] Add make flash to makefile --- esp32/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esp32/Makefile b/esp32/Makefile index 2d9bfb6ce..b93884712 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -732,6 +732,10 @@ deploy: $(BUILD)/firmware.bin $(ECHO) "Writing $^ to the board" $(Q)$(ESPTOOL) --chip esp32 --port $(PORT) --baud $(BAUD) write_flash -z --flash_mode $(FLASH_MODE) --flash_freq $(FLASH_FREQ) 0x1000 $^ +flash: $(BUILD)/firmware.bin + $(ECHO) "Writing $^ to the board" + $(Q)$(ESPTOOL) --port $(PORT) --baud $(BAUD) write_flash 0x10000 build/application.bin + erase: $(ECHO) "Erasing flash" $(Q)$(ESPTOOL) --chip esp32 --port $(PORT) --baud $(BAUD) erase_flash From 8ecb1a166f633a82702a14830d92f6fbb32bf106 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Sat, 5 Aug 2017 13:45:46 +0200 Subject: [PATCH 258/403] change lipo bat indicator voltages --- esp32/modules/easydraw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index e5ddb47a1..e3b5613f4 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -40,8 +40,8 @@ def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): ugfx.string_box(0,y,296,38, nick, font, color, ugfx.justifyCenter) def battery(vUsb, vBatt, charging): - vMin = badge.nvs_get_u16('batt', 'vmin', 3700) # mV - vMax = badge.nvs_get_u16('batt', 'vmax', 4200) # mV + vMin = badge.nvs_get_u16('batt', 'vmin', 3500) # mV + vMax = badge.nvs_get_u16('batt', 'vmax', 4100) # mV if charging and vUsb>4000: try: badge.eink_png(0,0,'/lib/resources/chrg.png') From f0b1db431c526bcdebe0ec1574f3991fa41519d6 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Sat, 5 Aug 2017 13:52:43 +0200 Subject: [PATCH 259/403] De maffe maniak --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index b2835698d..547957456 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 5 -name = "Wilde Weldoener" +build = 6 +name = "Maffe Maniak" From 5de477b9f7a9166d6291c4d2effcd1be1581bcc0 Mon Sep 17 00:00:00 2001 From: Paul Honig Date: Sat, 5 Aug 2017 14:25:36 +0200 Subject: [PATCH 260/403] Make Jan Henk again. --- esp32/modules/easydraw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index e5ddb47a1..7f8f5db2d 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -36,7 +36,7 @@ def msg(message, title = 'Still Loading Anyway...', reset = False): ugfx.flush(ugfx.LUT_FASTER) def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): - nick = badge.nvs_get_str("owner", "name", 'Jan de Boer') + nick = badge.nvs_get_str("owner", "name", 'Henk de Vries') ugfx.string_box(0,y,296,38, nick, font, color, ugfx.justifyCenter) def battery(vUsb, vBatt, charging): From d2ec1accc4c2a1053df5d1cb66ee1c0ab0df6544 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 5 Aug 2017 16:14:04 +0200 Subject: [PATCH 261/403] fix big-endian packing to 8 bytes --- py/binary.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/py/binary.c b/py/binary.c index 4a999b9aa..e51b0ef05 100644 --- a/py/binary.c +++ b/py/binary.c @@ -302,8 +302,14 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte ** val = mp_obj_get_int(val_in); // zero/sign extend if needed if (BYTES_PER_WORD < 8 && size > sizeof(val)) { - int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00; - memset(p + sizeof(val), c, size - sizeof(val)); + if (struct_type == '>') { + int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00; + memset(p, c, size - sizeof(val)); + p += size - sizeof(val); + } else { + int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00; + memset(p + sizeof(val), c, size - sizeof(val)); + } } } } From ca37a8d56ace7beb8bf8642d896cb20762fbf861 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 5 Aug 2017 16:17:46 +0200 Subject: [PATCH 262/403] move int c one line up. it's the same for both big endian and little endian --- py/binary.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py/binary.c b/py/binary.c index e51b0ef05..8bedc42aa 100644 --- a/py/binary.c +++ b/py/binary.c @@ -302,12 +302,11 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte ** val = mp_obj_get_int(val_in); // zero/sign extend if needed if (BYTES_PER_WORD < 8 && size > sizeof(val)) { + int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00; if (struct_type == '>') { - int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00; memset(p, c, size - sizeof(val)); p += size - sizeof(val); } else { - int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00; memset(p + sizeof(val), c, size - sizeof(val)); } } From 5626620d05bf616f3e06a4280819330bc6d098d1 Mon Sep 17 00:00:00 2001 From: basvs Date: Sat, 5 Aug 2017 17:11:52 +0200 Subject: [PATCH 263/403] Revert "Upy use powerdown mgr" --- esp32/main.c | 43 +++++-------------------------------------- esp32/modmachine.c | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 41 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 0ec224b08..4ed1f673b 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -57,7 +57,6 @@ #include "badge_first_run.h" #include #include -#include "powerdown.h" // MicroPython runs as a task under FreeRTOS #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1) @@ -141,36 +140,6 @@ void do_bpp_bgnd() { esp_restart(); } -//PowerDownManager callback. If all objects that call into the powerdown manager are OK to sleep, -//it will calculate the time it can sleep and the mode to wake up in. -void do_deep_sleep(int delayMs, void *arg, PowerMode mode) { - PowerMode currMode=(PowerMode)arg; - delayMs-=8000; //to compensate for startup delay - if (delayMs<0) delayMs=0; - if (currMode==mode && delayMs<5000) return; //not worth sleeping - - printf("Sleeping for %d ms...\n", delayMs); - - //Shutdown anything running - if (currMode==POWER_MODE_BPP) { - bpp_shutdown(); - } - - //Select wake mode - uint8_t rtcmodebit=0; - if (mode==POWER_MODE_BPP) rtcmodebit=2; - if (mode==POWER_MODE_UPY) rtcmodebit=0; - esp_rtcmem_write(0, rtcmodebit); - esp_rtcmem_write(1, ~rtcmodebit); - - // TODO the wake on touch should be in badge_input_init - esp_deep_sleep_enable_ext0_wakeup(GPIO_NUM_25 , 0); - // FIXME don't use hardcoded GPIO_NUM_25 - esp_deep_sleep_enable_timer_wakeup(delayMs*1000); - esp_deep_sleep_start(); -} - - void app_main(void) { badge_check_first_run(); badge_base_init(); @@ -191,22 +160,20 @@ void app_main(void) { badge_init(); if (badge_input_button_state == 0) { printf("Starting bpp.\n"); - powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_BPP, POWER_MODE_BPP, true); do_bpp_bgnd(); } else { - printf("Touch wake after bpp.\n"); - powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY, false); - xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, - &mp_task_stack[0], &mp_task_tcb, 0); - } + printf("Touch wake after bpp.\n"); + xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, + &mp_task_stack[0], &mp_task_tcb, 0); + } break; #endif + case 3: badge_first_run(); } } else { - powerDownMgrInit(do_deep_sleep, (void*)POWER_MODE_UPY, POWER_MODE_UPY, false); xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 0); } diff --git a/esp32/modmachine.c b/esp32/modmachine.c index 2f83765c5..09a1dbc7c 100644 --- a/esp32/modmachine.c +++ b/esp32/modmachine.c @@ -45,7 +45,6 @@ #include "extmod/machine_spi.h" #include "modmachine.h" #include "machine_rtc.h" -#include "powerdown.h" #if MICROPY_PY_MACHINE @@ -90,9 +89,25 @@ STATIC mp_obj_t machine_deepsleep(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_int_t expiry = args[ARG_sleep_ms].u_int; - //Let powerdown manager handle the actual power down stuff - powerCanSleepFor((int)machine_init, expiry); + if (expiry != 0) { + esp_deep_sleep_enable_timer_wakeup(expiry * 1000); + } + + if (machine_rtc_config.ext0_pin != -1) { + esp_deep_sleep_enable_ext0_wakeup(machine_rtc_config.ext0_pin, machine_rtc_config.ext0_level ? 1 : 0); + } + + if (machine_rtc_config.ext1_pins != 0) { + esp_deep_sleep_enable_ext1_wakeup( + machine_rtc_config.ext1_pins, + machine_rtc_config.ext1_level ? ESP_EXT1_WAKEUP_ANY_HIGH : ESP_EXT1_WAKEUP_ALL_LOW); + } + + if (machine_rtc_config.wake_on_touch) { + esp_deep_sleep_enable_touchpad_wakeup(); + } + esp_deep_sleep_start(); return mp_const_none; } From 6d641841e3733e9051b704026bef5e8039626122 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 5 Aug 2017 19:07:59 +0200 Subject: [PATCH 264/403] Use 'with open() as f:' instead of 'f = open()' This automatically closes the file when leaving the code block. (fix for 'too many open files' problem) --- esp32/modules/_boot.py | 4 +++- esp32/modules/launcher.py | 6 +++--- esp32/modules/tasks/resourcescheck.py | 4 ++-- esp32/modules/tasks/services.py | 10 +++++----- esp32/modules/tasks/sponsorscheck.py | 8 ++++---- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/esp32/modules/_boot.py b/esp32/modules/_boot.py index 3213d27f9..867e70c6c 100644 --- a/esp32/modules/_boot.py +++ b/esp32/modules/_boot.py @@ -3,7 +3,9 @@ try: badge.mount_root() uos.mount(uos.VfsNative(None), '/') - open("/boot.py", "r") + with open("/boot.py", "r") as f: + f.close() + except OSError: import inisetup vfs = inisetup.setup() diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 0226a8484..aeaf2b953 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -59,9 +59,9 @@ def read_metadata(app): install_path = get_install_path() info_file = "%s/%s/metadata.json" % (install_path, app) print("Reading "+info_file+"...") - fd = open(info_file) - information = ujson.loads(fd.read()) - return information + with open(info_file) as f: + information = f.read() + return ujson.loads(information) except BaseException as e: print("[ERROR] Can not read metadata for app "+app) sys.print_exception(e) diff --git a/esp32/modules/tasks/resourcescheck.py b/esp32/modules/tasks/resourcescheck.py index f930e6e1d..111df1c93 100644 --- a/esp32/modules/tasks/resourcescheck.py +++ b/esp32/modules/tasks/resourcescheck.py @@ -18,8 +18,8 @@ def install(): def check(): needToInstall = True try: - fp = open("/lib/resources/version", "r") - version = int(fp.read(99)) + with open("/lib/resources/version", "r") as f: + version = int(f.read(99)) print("[RESOURCES] Current version: "+str(version)) if version>=2: needToInstall = False diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index 50c327439..0b0ee0b90 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -34,17 +34,17 @@ def setup(drawCb=None): print("APP: "+app) try: #Try to open and read the json description - fd = open('/lib/'+app+'/service.json') - description = ujson.loads(fd.read()) - fd.close() + with open('/lib/'+app+'/service.json') as f: + description = f.read() + description = ujson.loads(description) except: print("[SERVICES] No description found for "+app) continue #Or skip the app try: #Try to open the service itself - fd = open('/lib/'+app+'/service.py') - fd.close() + with open('/lib/'+app+'/service.py') as f: + f.close() except: print("[SERVICES] No script found for "+app) continue #Or skip the app diff --git a/esp32/modules/tasks/sponsorscheck.py b/esp32/modules/tasks/sponsorscheck.py index 5d2824407..5844b88f6 100644 --- a/esp32/modules/tasks/sponsorscheck.py +++ b/esp32/modules/tasks/sponsorscheck.py @@ -21,8 +21,8 @@ def show(force=False): needToInstall = True version = 0 try: - fp = open("/lib/sponsors/version", "r") - version = int(fp.read(99)) + with open("/lib/sponsors/version", "r") as f: + version = int(f.read(99)) print("[SPONSORS] Current version: "+str(version)) except: print("[SPONSORS] Not installed!") @@ -31,8 +31,8 @@ def show(force=False): if needToInstall: install() try: - fp = open("/lib/sponsors/version", "r") - version = int(fp.read(99)) + with open("/lib/sponsors/version", "r") as f: + version = int(f.read(99)) # Now we know for sure that a version of the sponsors app has been installed badge.nvs_set_u8('sponsors', 'shown', 1) appglue.start_app("sponsors") From 37b7f1d35410b8242cab40550f5a59f9bd166ec6 Mon Sep 17 00:00:00 2001 From: Gavan Date: Sat, 5 Aug 2017 18:12:00 +0100 Subject: [PATCH 265/403] Use a timeout on fetching data, and handle failures gracefully. Prevents a crash in the installer when the wifi connection is flaky. --- esp32/modules/installer.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 37fe85179..20a907cf1 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -1,4 +1,4 @@ -import ugfx, badge, network, gc, time, urequests, appglue +import ugfx, badge, network, gc, time, urequests, appglue, sys # SHA2017 Badge installer # V2 Thomas Roos @@ -71,10 +71,19 @@ def list_apps(slug): ugfx.flush(ugfx.LUT_FULL) try: - f = urequests.get("https://badge.sha2017.org/eggs/category/%s/json" % slug) - packages = f.json() - finally: - f.close() + f = urequests.get("https://badge.sha2017.org/eggs/category/%s/json" % slug, timeout=30) + try: + packages = f.json() + finally: + f.close() + except BaseException as e: + print("[Installer] Failed to download list of eggs:") + sys.print_exception(e) + text.text("Download failed") + ugfx.flush(ugfx.LUT_FULL) + list_categories() + gc.collect() + return for package in packages: options.add_item("%s rev. %s" % (package["name"], package["revision"])) @@ -87,6 +96,7 @@ def list_apps(slug): ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app('') if pushed else False) show_description(True) + ugfx.flush(ugfx.LUT_FULL) gc.collect() def start_categories(pushed): @@ -145,7 +155,7 @@ def list_categories(): ugfx.input_init() draw_msg('Getting categories') try: - f = urequests.get("https://badge.sha2017.org/eggs/categories/json") + f = urequests.get("https://badge.sha2017.org/eggs/categories/json", timeout=30) categories = f.json() except: draw_msg('Failed!') From 07a96465fe3b3f12f8867fdcb28d3627171dee6f Mon Sep 17 00:00:00 2001 From: Gavan Date: Sat, 5 Aug 2017 19:19:55 +0100 Subject: [PATCH 266/403] Erase the otadata partition when flashing firmware, so that we can be sure that the right firmware will be used. --- esp32/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/esp32/Makefile b/esp32/Makefile index ad50015a7..239447ef0 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -735,6 +735,7 @@ deploy: $(BUILD)/firmware.bin flash: $(BUILD)/firmware.bin $(ECHO) "Writing $^ to the board" + $(Q)$(ESPTOOL) --port $(PORT) --baud $(BAUD) erase_region 0xd000 0x2000 $(Q)$(ESPTOOL) --port $(PORT) --baud $(BAUD) write_flash 0x10000 build/application.bin erase: From 826ac45a1fea5d19ddf1634a0beca212a0c23575 Mon Sep 17 00:00:00 2001 From: Gavan Date: Sat, 5 Aug 2017 22:31:57 +0100 Subject: [PATCH 267/403] If a package fails to install, report this to the user. If the reason is that the latest version is already installed, report that separately. --- esp32/modules/installer.py | 17 +++++++++++++++-- esp32/modules/woezel.py | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 37fe85179..b38363924 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -118,12 +118,25 @@ def install_app(active): ugfx.string(100,55, packages[index]["name"],"PermanentMarker22",ugfx.WHITE) ugfx.flush() + latest = False import woezel selected_app = packages[index]["slug"] - woezel.install(selected_app) + try: + woezel.install(selected_app) + except woezel.LatestInstalledError: + latest = True + except: + ugfx.string(160,85,"Failed","Roboto_BlackItalic24",ugfx.WHITE) + ugfx.flush() + time.sleep(4) + list_categories() + return ugfx.clear(ugfx.WHITE) - ugfx.string(40,25,"Installed:","Roboto_BlackItalic24",ugfx.BLACK) + if latest: + ugfx.string(40,25,"Already installed:","Roboto_BlackItalic24",ugfx.BLACK) + else: + ugfx.string(40,25,"Installed:","Roboto_BlackItalic24",ugfx.BLACK) ugfx.string(100,55, packages[index]["name"],"PermanentMarker22",ugfx.BLACK) ugfx.string(0, 115, "[ A: START | B: BACK ]", "Roboto_Regular12", ugfx.BLACK) diff --git a/esp32/modules/woezel.py b/esp32/modules/woezel.py index 7d5e91e5b..17e144c5a 100644 --- a/esp32/modules/woezel.py +++ b/esp32/modules/woezel.py @@ -266,6 +266,7 @@ def install(to_install, install_path=None, force_reinstall=False): print("Error installing '{}': {}, packages may be partially installed".format( pkg_spec, e), file=sys.stderr) + raise e def display_pkg(packages): for package in packages: From 4aac2ef264721524d0614fddf2e93a21a72612de Mon Sep 17 00:00:00 2001 From: Gavan Date: Sat, 5 Aug 2017 22:44:37 +0100 Subject: [PATCH 268/403] Remove extraneous flush --- esp32/modules/installer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/esp32/modules/installer.py b/esp32/modules/installer.py index 20a907cf1..cc1ca5571 100644 --- a/esp32/modules/installer.py +++ b/esp32/modules/installer.py @@ -96,7 +96,6 @@ def list_apps(slug): ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app('') if pushed else False) show_description(True) - ugfx.flush(ugfx.LUT_FULL) gc.collect() def start_categories(pushed): From 0315564ac984350f38f683d6a315fac246fd312c Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 5 Aug 2017 23:51:20 +0200 Subject: [PATCH 269/403] fix max open file descriptors in woezel use 'with open(...) as f:' instead of 'f = open(...)' --- esp32/modules/woezel.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/esp32/modules/woezel.py b/esp32/modules/woezel.py index 7d5e91e5b..3cf81c170 100644 --- a/esp32/modules/woezel.py +++ b/esp32/modules/woezel.py @@ -193,11 +193,11 @@ def install_pkg(pkg_spec, install_path, force_reinstall): verf = "%s%s/version" % (install_path, pkg_spec) if already_installed: try: - fver = open(verf, "r") + with open(verf, "r") as fver: + old_ver = fver.read() except: print("No version file found") else: - old_ver = fver.read(); if old_ver == latest_ver: if not force_reinstall: raise LatestInstalledError("Latest version installed") @@ -205,7 +205,6 @@ def install_pkg(pkg_spec, install_path, force_reinstall): print("Removing previous rev. %s" % old_ver) for rm_file in os.listdir("%s%s" % (install_path, pkg_spec)): os.remove("%s%s/%s" % (install_path, pkg_spec, rm_file)) - fver.close() packages = data["releases"][latest_ver] del data gc.collect() @@ -222,9 +221,8 @@ def install_pkg(pkg_spec, install_path, force_reinstall): f1.close() del f3 del f2 - fver = open(verf, "w") - fver.write(latest_ver) - fver.close() + with open(verf, "w") as fver: + fver.write(latest_ver) del fver gc.collect() return meta From b50fd016e26bbf2f3475ffe306adbbb4944dbf0a Mon Sep 17 00:00:00 2001 From: Gavan Date: Sat, 5 Aug 2017 22:53:44 +0100 Subject: [PATCH 270/403] Whitespace fix --- esp32/modules/woezel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/woezel.py b/esp32/modules/woezel.py index 17e144c5a..de92c4c21 100644 --- a/esp32/modules/woezel.py +++ b/esp32/modules/woezel.py @@ -266,7 +266,7 @@ def install(to_install, install_path=None, force_reinstall=False): print("Error installing '{}': {}, packages may be partially installed".format( pkg_spec, e), file=sys.stderr) - raise e + raise e def display_pkg(packages): for package in packages: From 482cec084efdb83ab592a572cbfa4e72304da898 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 6 Aug 2017 00:02:59 +0200 Subject: [PATCH 271/403] Suppress vfs_native_file open file error --- extmod/vfs_native_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/vfs_native_file.c b/extmod/vfs_native_file.c index 4a2e1b8b3..bc7fdb0e3 100644 --- a/extmod/vfs_native_file.c +++ b/extmod/vfs_native_file.c @@ -185,7 +185,7 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar assert(vfs != NULL); int fd = open(fname, mode_x | mode_rw, 0644); if (fd == -1) { - ESP_LOGE(TAG, "open('%s', '%s'): error %d", fname, mode_s_orig, errno); + ESP_LOGI(TAG, "open('%s', '%s'): error %d", fname, mode_s_orig, errno); m_del_obj(pyb_file_obj_t, o); mp_raise_OSError(errno); } From 5a9b0c496926c6cf88eba9d065d592c22459063a Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 6 Aug 2017 00:40:14 +0200 Subject: [PATCH 272/403] fix update all; update next egg if update failed. --- esp32/modules/update.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/esp32/modules/update.py b/esp32/modules/update.py index 668833afa..4d489a3d4 100644 --- a/esp32/modules/update.py +++ b/esp32/modules/update.py @@ -19,8 +19,11 @@ def stop(): for app in apps: easydraw.msg("Updating '"+app+"'...") - woezel.install(app) - easydraw.msg("Done!") - + try: + woezel.install(app) + easydraw.msg("Done!") + except: + print("failed update. Already newest version?") + easydraw.msg("All your apps are now up-to-date!") stop() From d6b6ad99c1338c3191191c6ab0d3d670e35ccf1f Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 6 Aug 2017 13:32:02 +0200 Subject: [PATCH 273/403] update esp-idf git hash --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index 239447ef0..e49fafd5f 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := d230dbccf4af26c732b748571b89178556dc20c5 +ESPIDF_SUPHASH := f13b5966d82ccb7c907d7ea1fa7eaf22335c104b ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) From 50e4b759a49190468254772ffed73790f7868740 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 6 Aug 2017 13:58:06 +0200 Subject: [PATCH 274/403] Read PNG files directly from byte-string. --- esp32/modbadge.c | 47 ++++++++++++++++++++++++++++++++++++++--------- esp32/modbadge.h | 1 + 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 5e90766f5..37f261ff3 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -299,24 +299,49 @@ STATIC mp_obj_t badge_eink_png(mp_obj_t obj_x, mp_obj_t obj_y, mp_obj_t obj_file { int x = mp_obj_get_int(obj_x); int y = mp_obj_get_int(obj_y); - const char* filename = mp_obj_str_get_str(obj_filename); if (x >= BADGE_EINK_WIDTH || y >= BADGE_EINK_HEIGHT) { return mp_const_none; } - struct lib_file_reader *fr = lib_file_new(filename, 1024); - if (fr == NULL) - { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "Could not open file '%s'!",filename)); - return mp_const_none; + lib_reader_read_t reader; + void * reader_p; + + bool is_bytes = MP_OBJ_IS_TYPE(obj_filename, &mp_type_bytes); + + if (is_bytes) { + size_t len; + const uint8_t* png_data = (const uint8_t *) mp_obj_str_get_data(obj_filename, &len); + struct lib_mem_reader *mr = lib_mem_new(png_data, len); + if (mr == NULL) + { + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "out of memory!")); + return mp_const_none; + } + reader = (lib_reader_read_t) &lib_mem_read; + reader_p = mr; + + } else { + const char* filename = mp_obj_str_get_str(obj_filename); + struct lib_file_reader *fr = lib_file_new(filename, 1024); + if (fr == NULL) + { + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "Could not open file '%s'!",filename)); + return mp_const_none; + } + reader = (lib_reader_read_t) &lib_file_read; + reader_p = fr; } - struct lib_png_reader *pr = lib_png_new((lib_reader_read_t) &lib_file_read, fr); + struct lib_png_reader *pr = lib_png_new(reader, reader_p); if (pr == NULL) { - lib_file_destroy(fr); + if (is_bytes) { + lib_mem_destroy(reader_p); + } else { + lib_file_destroy(reader_p); + } nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "out of memory.")); return mp_const_none; } @@ -325,7 +350,11 @@ STATIC mp_obj_t badge_eink_png(mp_obj_t obj_x, mp_obj_t obj_y, mp_obj_t obj_file uint32_t dst_min_y = y < 0 ? -y : 0; int res = lib_png_load_image(pr, &badge_eink_fb[y * BADGE_EINK_WIDTH + x], dst_min_x, dst_min_y, BADGE_EINK_WIDTH - x, BADGE_EINK_HEIGHT - y, BADGE_EINK_WIDTH); lib_png_destroy(pr); - lib_file_destroy(fr); + if (is_bytes) { + lib_mem_destroy(reader_p); + } else { + lib_file_destroy(reader_p); + } if (res < 0) { diff --git a/esp32/modbadge.h b/esp32/modbadge.h index e677df1df..4cb746fb0 100644 --- a/esp32/modbadge.h +++ b/esp32/modbadge.h @@ -13,6 +13,7 @@ #include "badge_vibrator.h" #include "badge_nvs.h" +#include "mem_reader.h" #include "file_reader.h" #include "png_reader.h" From 6ba80503d0fe813bd823c5cfca28d0374baf056c Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Sun, 6 Aug 2017 14:04:01 +0200 Subject: [PATCH 275/403] soft reboot in raw REPL mode skips boot.py (for ampy, pyboard) --- esp32/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 4ed1f673b..3dc0102ad 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -94,8 +94,10 @@ void mp_task(void *pvParameter) { machine_pins_init(); // run boot-up scripts - pyexec_frozen_module("_boot.py"); - pyexec_file("boot.py"); + if (pyexec_mode_kind != PYEXEC_MODE_RAW_REPL) { + pyexec_frozen_module("_boot.py"); + pyexec_file("boot.py"); + } // if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) { // pyexec_file("main.py"); // } From 4dc7c5649b0be88e542b4f7ec050a1d6e00d436c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 6 Aug 2017 15:42:37 +0300 Subject: [PATCH 276/403] py/mkrules.mk: Show frozen modules sizes together with executable size. This works for Unix and similar ports so far. --- py/mkrules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index 860074caa..de2c92a3f 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -135,7 +135,7 @@ $(PROG): $(OBJ) ifndef DEBUG $(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG) endif - $(Q)$(SIZE) $(PROG) + $(Q)$(SIZE) $$(find $(BUILD)/build -name "frozen*.o") $(PROG) clean: clean-prog clean-prog: From c0a80d29fcccba3ffba6eceb56eceb33572aaabd Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 6 Aug 2017 20:06:45 +0200 Subject: [PATCH 277/403] emergency fix --- esp32/main.c | 2 +- esp32/modules/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 3dc0102ad..92a3df82b 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -94,8 +94,8 @@ void mp_task(void *pvParameter) { machine_pins_init(); // run boot-up scripts + pyexec_frozen_module("_boot.py"); if (pyexec_mode_kind != PYEXEC_MODE_RAW_REPL) { - pyexec_frozen_module("_boot.py"); pyexec_file("boot.py"); } // if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) { diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 547957456..2723cef78 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 6 +build = 7 name = "Maffe Maniak" From 02d3da610530e9719f4c4b594bd2ac2ea17f6ee5 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 00:07:47 +0200 Subject: [PATCH 278/403] push sponsors app --- esp32/modules/post_ota.py | 10 ++++++++++ esp32/modules/tasks/sponsorscheck.py | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/esp32/modules/post_ota.py b/esp32/modules/post_ota.py index 64a95da34..a8a9ba41d 100644 --- a/esp32/modules/post_ota.py +++ b/esp32/modules/post_ota.py @@ -5,6 +5,10 @@ def u0to1(): create.boot() easydraw.msg("Applied patch 1") +def u1to2(): + badge.nvs_set_u8('sponsors', 'shown', 0) + easydraw.msg("Applied patch 2") + # Read current patch level lvl = badge.nvs_get_u8('ota', 'fixlvl', 0) @@ -13,3 +17,9 @@ def u0to1(): u0to1() easydraw.msg("Post OTA update completed") badge.nvs_set_u8('ota', 'fixlvl', 1) + +if lvl<2: + easydraw.msg("Running post OTA scripts...","Still updating anyways...",) + u1to2() + easydraw.msg("Post OTA update completed") + badge.nvs_set_u8('ota', 'fixlvl', 2) diff --git a/esp32/modules/tasks/sponsorscheck.py b/esp32/modules/tasks/sponsorscheck.py index 5844b88f6..1aebd6bd1 100644 --- a/esp32/modules/tasks/sponsorscheck.py +++ b/esp32/modules/tasks/sponsorscheck.py @@ -26,11 +26,11 @@ def show(force=False): print("[SPONSORS] Current version: "+str(version)) except: print("[SPONSORS] Not installed!") - if version>=14: - needToInstall = False - if needToInstall: - install() try: + if version>=16: + needToInstall = False + if needToInstall: + install() with open("/lib/sponsors/version", "r") as f: version = int(f.read(99)) # Now we know for sure that a version of the sponsors app has been installed From 13489726a9b3f9ce9dcd2ff9c3086279db7704fe Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 00:14:07 +0200 Subject: [PATCH 279/403] increment build id --- esp32/modules/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 2723cef78..f82fdf5f8 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 7 +build = 8 name = "Maffe Maniak" From 2ad714a23a4201e7e720567ce5d9d14c0f87d768 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 01:15:24 +0200 Subject: [PATCH 280/403] Add safe-mode variable --- esp32/main.c | 13 +++++++++++++ esp32/modbadge.c | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/esp32/main.c b/esp32/main.c index 92a3df82b..cfb900dd4 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -35,6 +35,7 @@ #include "esp_system.h" #include "esp_task.h" #include "soc/cpu.h" +#include "rom/rtc.h" #include "sha2017_ota.h" #include "esprtcmem.h" @@ -56,6 +57,7 @@ #include "badge_base.h" #include "badge_first_run.h" #include +#include #include // MicroPython runs as a task under FreeRTOS @@ -64,11 +66,15 @@ #define MP_TASK_STACK_LEN (MP_TASK_STACK_SIZE / sizeof(StackType_t)) #define MP_TASK_HEAP_SIZE (88 * 1024) +//define BUTTON_SAFE_MODE ((1 << BADGE_BUTTON_A) || (1 << BADGE_BUTTON_B)) +#define BUTTON_SAFE_MODE ((1 << BADGE_BUTTON_START)) + STATIC StaticTask_t mp_task_tcb; STATIC StackType_t mp_task_stack[MP_TASK_STACK_LEN] __attribute__((aligned (8))); STATIC uint8_t mp_task_heap[MP_TASK_HEAP_SIZE]; extern uint32_t reset_cause; +extern bool in_safe_mode; void mp_task(void *pvParameter) { volatile uint32_t sp = (uint32_t)get_sp(); @@ -176,6 +182,13 @@ void app_main(void) { } } else { + uint32_t reset_cause = rtc_get_reset_reason(0); + if (reset_cause != DEEPSLEEP_RESET) { + badge_init(); + if ((badge_input_button_state & BUTTON_SAFE_MODE) == BUTTON_SAFE_MODE) { + in_safe_mode = true; + } + } xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_task_stack[0], &mp_task_tcb, 0); } diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 37f261ff3..7a9485e8e 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -242,6 +242,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_mpr121_get_touch_info_obj, badge_mpr121_g #endif // I2C_MPR121_ADDR +bool in_safe_mode = false; +STATIC mp_obj_t badge_safe_mode() { + return mp_obj_new_bool(in_safe_mode); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_safe_mode_obj, badge_safe_mode); // E-Ink (badge_eink.h) STATIC mp_obj_t badge_eink_init_() { @@ -682,6 +687,8 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_unmount_sdcard), (mp_obj_t)&badge_unmount_sdcard_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_mount_bpp), (mp_obj_t)&badge_mount_bpp_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_safe_mode), (mp_obj_t)&badge_safe_mode_obj}, + }; STATIC MP_DEFINE_CONST_DICT(badge_module_globals, badge_module_globals_table); From af1194865f65376de45003f7219c41430ba1cd2a Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 01:22:53 +0200 Subject: [PATCH 281/403] move in_safe_mode flag to rtc-mem --- esp32/modbadge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 7a9485e8e..3e336909a 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -242,7 +242,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_mpr121_get_touch_info_obj, badge_mpr121_g #endif // I2C_MPR121_ADDR -bool in_safe_mode = false; +bool RTC_DATA_ATTR in_safe_mode = false; STATIC mp_obj_t badge_safe_mode() { return mp_obj_new_bool(in_safe_mode); } From 53699ccbd4962d6b3c0580863a8ae264c6a74026 Mon Sep 17 00:00:00 2001 From: Gavan Date: Mon, 7 Aug 2017 00:27:15 +0100 Subject: [PATCH 282/403] Move boot.py out of the filesystem and into the firmware. Then use badge.safe_mode() to force the use of the default splash, disable services and disable sleeping. This should allow a user to uninstall any malicious applications without needing to plug the badge into a computer with USB. --- esp32/main.c | 2 +- esp32/modules/_boot.py | 11 ++--------- esp32/modules/{create.py => boot.py} | 12 ++++-------- esp32/modules/inisetup.py | 8 -------- esp32/modules/launcher.py | 11 +++++++++-- esp32/modules/splash.py | 19 ++++++++++++++----- esp32/modules/tasks/powermanagement.py | 2 +- 7 files changed, 31 insertions(+), 34 deletions(-) rename esp32/modules/{create.py => boot.py} (84%) delete mode 100644 esp32/modules/inisetup.py diff --git a/esp32/main.c b/esp32/main.c index cfb900dd4..0bca17f05 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -102,7 +102,7 @@ void mp_task(void *pvParameter) { // run boot-up scripts pyexec_frozen_module("_boot.py"); if (pyexec_mode_kind != PYEXEC_MODE_RAW_REPL) { - pyexec_file("boot.py"); + pyexec_frozen_module("boot.py"); } // if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) { // pyexec_file("main.py"); diff --git a/esp32/modules/_boot.py b/esp32/modules/_boot.py index 867e70c6c..f92b22543 100644 --- a/esp32/modules/_boot.py +++ b/esp32/modules/_boot.py @@ -1,13 +1,6 @@ import badge, gc, uos -try: - badge.mount_root() - uos.mount(uos.VfsNative(None), '/') - with open("/boot.py", "r") as f: - f.close() - -except OSError: - import inisetup - vfs = inisetup.setup() +badge.mount_root() +uos.mount(uos.VfsNative(None), '/') gc.collect() diff --git a/esp32/modules/create.py b/esp32/modules/boot.py similarity index 84% rename from esp32/modules/create.py rename to esp32/modules/boot.py index f4c72b2e6..ae606c6b4 100644 --- a/esp32/modules/create.py +++ b/esp32/modules/boot.py @@ -1,16 +1,13 @@ -import uos - -def boot(): - print("Updating 'boot.py'...") - with open("/boot.py", "w") as f: - f.write("""\ # This file is executed on every boot (including wake-boot from deepsleep) import badge, machine, esp, ugfx, sys badge.init() ugfx.init() esp.rtcmem_write(0,0) esp.rtcmem_write(1,0) -splash = badge.nvs_get_str('boot','splash','splash') +if badge.safe_mode(): + splash = 'splash' +else: + splash = badge.nvs_get_str('boot','splash','splash') if machine.reset_cause() != machine.DEEPSLEEP_RESET: print('[BOOT] Cold boot') else: @@ -39,4 +36,3 @@ def boot(): time.sleep(5) import appglue appglue.home() - """) diff --git a/esp32/modules/inisetup.py b/esp32/modules/inisetup.py deleted file mode 100644 index 354c094d1..000000000 --- a/esp32/modules/inisetup.py +++ /dev/null @@ -1,8 +0,0 @@ -import uos - -def setup(): - print("Performing initial setup") - vfs = uos.VfsNative(True) - import create - create.boot() - return vfs diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index aeaf2b953..547c405e7 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -166,9 +166,16 @@ def start(): ugfx.clear(ugfx.WHITE) ugfx.flush() - ugfx.string_box(148,0,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + if badge.safe_mode(): + still = "SAFE" + anyway = "Mode" + else: + still = "STILL" + anyway = "Anyway" + + ugfx.string_box(148,0,148,26, still, "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) ugfx.string_box(148,23,148,23, "Hacking", "PermanentMarker22", ugfx.BLACK, ugfx.justifyCenter) - ugfx.string_box(148,48,148,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) + ugfx.string_box(148,48,148,26, anyway, "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) #the line under the text str_len = ugfx.get_string_width("Hacking","PermanentMarker22") diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 44fec3321..33ad47f62 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -35,10 +35,18 @@ def draw(mode, goingToSleep=False): info2 = 'Press select to start OTA update' else: info2 = '' - l = ugfx.get_string_width(info1,"Roboto_Regular12") - ugfx.string(296-l, 0, info1, "Roboto_Regular12",ugfx.BLACK) - l = ugfx.get_string_width(info2,"Roboto_Regular12") - ugfx.string(296-l, 12, info2, "Roboto_Regular12",ugfx.BLACK) + + def disp_string_right(y, s): + l = ugfx.get_string_width(s,"Roboto_Regular12") + ugfx.string(296-l, y, s, "Roboto_Regular12",ugfx.BLACK) + + disp_string_right(0, info1) + disp_string_right(12, info2) + + if badge.safe_mode(): + disp_string_right(92, "Safe Mode - services disabled") + disp_string_right(104, "Sleep disabled - will drain battery quickly") + disp_string_right(116, "Press Reset button to exit") easydraw.nickname() @@ -156,7 +164,8 @@ def onSleep(idleTime): if not easywifi.failure(): spoc.show(False) # Check sponsors -services.setup(draw) # Start services +if not badge.safe_mode(): + services.setup(draw) # Start services draw(False) services.force_draw() diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index 92d27b263..a230fc13d 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -18,7 +18,7 @@ def pm_task(): idleTime = virtualtimers.idle_time() print("[Power management] Next task wants to run in "+str(idleTime)+" ms.") - if idleTime>30000: + if idleTime>30000 and not badge.safe_mode(): global onSleepCallback if not onSleepCallback==None: print("[Power management] Running onSleepCallback...") From f1616b6c1c2886336c0c190119a1bddf7aa8aee9 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 01:39:13 +0200 Subject: [PATCH 283/403] update version --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index f82fdf5f8..d3dfe265f 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 8 -name = "Maffe Maniak" +build = 9 +name = "Sinistere Site" From 3f8f88a6fab2f687d723eab50cee3eeb6dfefaa8 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 12:32:01 +0200 Subject: [PATCH 284/403] filter imports in safe mode --- esp32/main.c | 38 ++++++++++++++++++++++++++++++++++++++ esp32/mpconfigport.h | 3 +-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 0bca17f05..575ca750a 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -76,6 +76,44 @@ STATIC uint8_t mp_task_heap[MP_TASK_HEAP_SIZE]; extern uint32_t reset_cause; extern bool in_safe_mode; +static const char *import_blacklist[] = { + "/lib/json", + "/lib/os", + "/lib/socket", + "/lib/struct", + "/lib/time", +}; + +mp_import_stat_t +mp_import_stat(const char *path) { + if (in_safe_mode) { + // be more strict in which modules we would like to load + if (strncmp(path, "/lib/", 5) != 0) { + return MP_IMPORT_STAT_NO_EXIST; + } + + /* check blacklist */ + int i; + for (i=0; i Date: Mon, 7 Aug 2017 12:46:46 +0200 Subject: [PATCH 285/403] remove create; no longer needed --- esp32/modules/post_ota.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/esp32/modules/post_ota.py b/esp32/modules/post_ota.py index a8a9ba41d..857bc6902 100644 --- a/esp32/modules/post_ota.py +++ b/esp32/modules/post_ota.py @@ -1,8 +1,6 @@ import badge, easydraw def u0to1(): - import create - create.boot() easydraw.msg("Applied patch 1") def u1to2(): From 64be374fad3b0ab0772988e651a49fcb58f1373f Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 13:12:48 +0200 Subject: [PATCH 286/403] update event time and room --- esp32/modules/badge_event_reminder.py | 2 +- esp32/modules/tasks/badgeeventreminder.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/esp32/modules/badge_event_reminder.py b/esp32/modules/badge_event_reminder.py index 41a439cdd..05a1e1dfb 100644 --- a/esp32/modules/badge_event_reminder.py +++ b/esp32/modules/badge_event_reminder.py @@ -11,7 +11,7 @@ def exit(p): ugfx.string(0, 25+13*2, "some nice numbers and an overview of what all", "Roboto_Regular12", ugfx.BLACK) ugfx.string(0, 25+13*3, "of you are doing with it.", "Roboto_Regular12", ugfx.BLACK) -ugfx.string(0, 25+13*5, "The events starts now, in room 'No'!", "Roboto_Regular12", ugfx.BLACK) +ugfx.string(0, 25+13*5, "The events starts now, in room 'Pa'!", "Roboto_Regular12", ugfx.BLACK) ugfx.string(0, ugfx.height()-13, "Press any key to close reminder.", "Roboto_Regular12", ugfx.BLACK) ugfx.set_lut(ugfx.LUT_FULL) ugfx.flush() diff --git a/esp32/modules/tasks/badgeeventreminder.py b/esp32/modules/tasks/badgeeventreminder.py index 00500ab66..67bf498e9 100644 --- a/esp32/modules/tasks/badgeeventreminder.py +++ b/esp32/modules/tasks/badgeeventreminder.py @@ -6,7 +6,8 @@ import virtualtimers, time, appglue, badge -whenToTrigger = 1502196900 - 600 +# Tue Aug 8 13:30:00 2017 (CEST) +whenToTrigger = 1502191800 - 600 def ber_task(): global whenToTrigger From 648bf35b930d51c51c81cc3d45958ee074b65922 Mon Sep 17 00:00:00 2001 From: Christian Carlowitz Date: Mon, 7 Aug 2017 13:13:40 +0200 Subject: [PATCH 287/403] added free-as-in-freedom simplealternative module for ugfx (freedomgfx) --- esp32/Makefile | 2 + esp32/modfreedomgfx.c | 272 ++++++++++ esp32/modfreedomgfx.h | 37 ++ esp32/modfreedomgfx_eink.c | 49 ++ esp32/modfreedomgfx_eink.h | 37 ++ esp32/mpconfigport.h | 2 + share/fonts/Lat2-Terminus12x6.inc | 833 ++++++++++++++++++++++++++++++ unix/Makefile | 2 + unix/modfreedomgfx.c | 1 + unix/modfreedomgfx.h | 1 + unix/modfreedomgfx_sdl.c | 94 ++++ unix/modfreedomgfx_sdl.h | 37 ++ unix/mpconfigport.h | 2 + 13 files changed, 1369 insertions(+) create mode 100644 esp32/modfreedomgfx.c create mode 100644 esp32/modfreedomgfx.h create mode 100644 esp32/modfreedomgfx_eink.c create mode 100644 esp32/modfreedomgfx_eink.h create mode 100644 share/fonts/Lat2-Terminus12x6.inc create mode 120000 unix/modfreedomgfx.c create mode 120000 unix/modfreedomgfx.h create mode 100644 unix/modfreedomgfx_sdl.c create mode 100644 unix/modfreedomgfx_sdl.h diff --git a/esp32/Makefile b/esp32/Makefile index e49fafd5f..e97a21959 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -165,6 +165,8 @@ SRC_C = \ modbpp.c \ modbadge.c \ modugfx.c \ + modfreedomgfx.c \ + modfreedomgfx_eink.c \ moduhashlib.c \ machine_rtc.c \ machine_hw_spi.c \ diff --git a/esp32/modfreedomgfx.c b/esp32/modfreedomgfx.c new file mode 100644 index 000000000..12b8e7b96 --- /dev/null +++ b/esp32/modfreedomgfx.c @@ -0,0 +1,272 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * SHA2017 Badge Firmware https://wiki.sha2017.org/w/Projects:Badge/MicroPython + * + * Based on work by EMF for their TiLDA MK3 badge + * https://github.com/emfcamp/micropython/tree/tilda-master/stmhal + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Paul Sokolovsky + * Copyright (c) 2016 Damien P. George + * Copyright (c) 2017 Anne Jan Brouwer + * Copyright (c) 2017 Christian Carlowitz + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include +#include +#include + +#include "modfreedomgfx.h" + +#include +#include +#include + +#include "py/mperrno.h" +#include "py/mphal.h" +#include "py/runtime.h" + +#ifdef UNIX +#include "modfreedomgfx_sdl.h" +#else +#include "modfreedomgfx_eink.h" +#endif + +#define imgSize ((BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT)/8) +uint8_t img[imgSize]; + +#define PXb(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)/8] &= ~(1<<(((x)+(y)*BADGE_EINK_WIDTH)%8)) +#define PXw(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)/8] |= (1<<(((x)+(y)*BADGE_EINK_WIDTH)%8)) +#define ABS(x) (((x)<0)?-(x):(x)) + +static void gfx_input_poll(uint32_t btn); + +STATIC mp_obj_t gfx_init(void) { + for(int i = 0; i < imgSize; i++) + img[i] = 0xff; + freedomgfxInit(); + freedomgfxDraw(img); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(gfx_init_obj, gfx_init); + +STATIC mp_obj_t gfx_deinit(void) { + freedomgfxDeinit(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(gfx_deinit_obj, gfx_deinit); + +STATIC mp_obj_t gfx_poll(void) { + uint32_t evt = freedomgfxPoll(); + gfx_input_poll(evt); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(gfx_poll_obj, gfx_poll); + +STATIC mp_obj_t gfx_line(mp_uint_t n_args, const mp_obj_t *args) { + int x0 = mp_obj_get_int(args[0]); + int y0 = mp_obj_get_int(args[1]); + int x1 = mp_obj_get_int(args[2]); + int y1 = mp_obj_get_int(args[3]); + int col = mp_obj_get_int(args[4]); + + PXb(x0,y0); + + // algorithm: https://de.wikipedia.org/wiki/Bresenham-Algorithmus + int dx = ABS(x1-x0); + int sx = x0 dy) + { + err += dy; + x0 += sx; + } + if (err2 < dx) + { + err += dx; + y0 += sy; + } + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_line_obj, 5, 5, gfx_line); + +STATIC mp_obj_t gfx_area(mp_uint_t n_args, const mp_obj_t *args) { + int x0 = mp_obj_get_int(args[0]); + int y0 = mp_obj_get_int(args[1]); + int a = mp_obj_get_int(args[2]); + int b = mp_obj_get_int(args[3]); + int col = mp_obj_get_int(args[4]); + + printf("x0=%d,y0=%d\n", x0, y0); + for(int i = 0; i < a; i++) + { + for(int j = 0; j < b; j++) + { + if(col == 0) + PXb(x0+i,y0+j); + else + PXw(x0+i,y0+j); + } + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_area_obj, 5, 5, gfx_area); + + +static uint8_t tm12x6_font[] = { +#include "../share/fonts/Lat2-Terminus12x6.inc" +}; + +STATIC mp_obj_t gfx_string(mp_uint_t n_args, const mp_obj_t *args) { + mp_uint_t len; + const unsigned char *data = (const unsigned char*) mp_obj_str_get_data(args[2], &len); + int x0 = mp_obj_get_int(args[0]); + int y0 = mp_obj_get_int(args[1]); + int col = mp_obj_get_int(args[4]); + + uint8_t* font = tm12x6_font; + int clen = ((int*)font)[5]; + int cheight = ((int*)font)[6]; + int cwidth = ((int*)font)[7]; + + int xoffs = 0; + while(*data != 0) + { + for(int i = 0; i < cheight; i++) + { + for(int j = 0; j < cwidth; j++) // TODO: only works for single byte rows + { + if( font[4*8+(int)(*data)*clen+i] & (1<<(7-j))) + { + if(col == 0) + PXb(x0+j+xoffs,y0+i); + else + PXw(x0+j+xoffs,y0+i); + } + } + } + data++; + xoffs += cwidth; + + if(*data == '\n') + { + xoffs = 0; + y0 += cheight; + data++; + } + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_string_obj, 5, 5, gfx_string); + + +STATIC mp_obj_t gfx_flush(mp_uint_t n_args, const mp_obj_t *args) { + freedomgfxDraw(img); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_flush_obj, 0, 1, gfx_flush); + + +// callback system + +STATIC uint8_t button_init_done = 0; +STATIC mp_obj_t button_callbacks[1+BADGE_BUTTONS]; + +static void gfx_input_poll(uint32_t btn) +{ + if(button_init_done && btn > 0 && btn <= BADGE_BUTTONS) + { + if(button_callbacks[btn] != mp_const_none) + mp_sched_schedule(button_callbacks[btn], mp_obj_new_bool(0)); + } +} + +STATIC mp_obj_t gfx_input_init(mp_uint_t n_args, const mp_obj_t *args) { + for(size_t i = 0; i <= BADGE_BUTTONS; i++){ + button_callbacks[i] = mp_const_none; + } + button_init_done = 1; + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_input_init_obj, 0, 1, gfx_input_init); + +STATIC mp_obj_t gfx_input_attach(mp_uint_t n_args, const mp_obj_t *args) { + uint8_t button = mp_obj_get_int(args[0]); + button_callbacks[button] = args[1]; + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_input_attach_obj, 2, 2, gfx_input_attach); + + +// Module globals + +STATIC const mp_rom_map_elem_t freedomgfx_module_globals_table[] = { + {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_freedomgfx)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_init), (mp_obj_t)&gfx_init_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&gfx_deinit_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_poll), (mp_obj_t)&gfx_poll_obj}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_line), (mp_obj_t)&gfx_line_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_area), (mp_obj_t)&gfx_area_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_string), (mp_obj_t)&gfx_string_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_flush), (mp_obj_t)&gfx_flush_obj}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_input_init), (mp_obj_t)&gfx_input_init_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_input_attach), (mp_obj_t)&gfx_input_attach_obj}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_BLACK), MP_OBJ_NEW_SMALL_INT(0)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_WHITE), MP_OBJ_NEW_SMALL_INT(1)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_JOY_UP), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_UP)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_JOY_DOWN), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_DOWN)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_JOY_LEFT), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_LEFT)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_JOY_RIGHT), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_RIGHT)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BTN_A), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_A)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BTN_B), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_B)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BTN_SELECT), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_SELECT)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BTN_START), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_START)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BTN_FLASH), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_FLASH)}, + +}; + +STATIC MP_DEFINE_CONST_DICT(freedomgfx_module_globals, freedomgfx_module_globals_table); + +const mp_obj_module_t freedomgfx_module = { + .base = {&mp_type_module}, .globals = (mp_obj_dict_t *)&freedomgfx_module_globals, +}; + diff --git a/esp32/modfreedomgfx.h b/esp32/modfreedomgfx.h new file mode 100644 index 000000000..ab0efb75e --- /dev/null +++ b/esp32/modfreedomgfx.h @@ -0,0 +1,37 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2017 Christian Carlowitz + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mperrno.h" +#include "py/mphal.h" +#include "py/runtime.h" + +#include "py/nlr.h" +#include "py/runtime.h" + + + +extern const mp_obj_type_t ugfx_type; diff --git a/esp32/modfreedomgfx_eink.c b/esp32/modfreedomgfx_eink.c new file mode 100644 index 000000000..f712f37fe --- /dev/null +++ b/esp32/modfreedomgfx_eink.c @@ -0,0 +1,49 @@ +/* + * This file is part of the SHA2017 Micro Python fork + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Christian Carlowitz + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "modfreedomgfx_eink.h" +#include + +void freedomgfxInit(void) +{ + // +} + +void freedomgfxDeinit(void) +{ + // +} + +uint32_t freedomgfxPoll(void) +{ + uint32_t btn = badge_input_get_event(0); + return btn; +} + +void freedomgfxDraw(uint8_t* img) +{ + badge_eink_display(img, DISPLAY_FLAG_FULL_UPDATE); +} diff --git a/esp32/modfreedomgfx_eink.h b/esp32/modfreedomgfx_eink.h new file mode 100644 index 000000000..db1827eaf --- /dev/null +++ b/esp32/modfreedomgfx_eink.h @@ -0,0 +1,37 @@ +/* + * This file is part of the SHA2017 Micro Python fork + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Christian Carlowitz + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef UNIX_MODFREEDOMGFX_SDL_H_ +#define UNIX_MODFREEDOMGFX_SDL_H_ + +#include + +void freedomgfxInit(void); +void freedomgfxDeinit(void); +uint32_t freedomgfxPoll(void); +void freedomgfxDraw(uint8_t* img); + +#endif /* UNIX_MODFREEDOMGFX_SDL_H_ */ diff --git a/esp32/mpconfigport.h b/esp32/mpconfigport.h index 85c97b45d..dca336c66 100644 --- a/esp32/mpconfigport.h +++ b/esp32/mpconfigport.h @@ -179,6 +179,7 @@ extern const struct _mp_obj_module_t mp_module_network; extern const struct _mp_obj_module_t badge_module; extern const struct _mp_obj_module_t bpp_module; extern const struct _mp_obj_module_t ugfx_module; +extern const struct _mp_obj_module_t freedomgfx_module; extern const struct _mp_obj_module_t mp_module_onewire; #define MICROPY_PORT_BUILTIN_MODULES \ @@ -191,6 +192,7 @@ extern const struct _mp_obj_module_t mp_module_onewire; { MP_OBJ_NEW_QSTR(MP_QSTR_badge), (mp_obj_t)&badge_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_bpp), (mp_obj_t)&bpp_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_ugfx), (mp_obj_t)&ugfx_module }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_freedomgfx), (mp_obj_t)&freedomgfx_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&mp_module_onewire }, \ #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ diff --git a/share/fonts/Lat2-Terminus12x6.inc b/share/fonts/Lat2-Terminus12x6.inc new file mode 100644 index 000000000..577ca1aa0 --- /dev/null +++ b/share/fonts/Lat2-Terminus12x6.inc @@ -0,0 +1,833 @@ +// Copying and distribution of this file, with or without modification, +// are permitted in any medium without royalty provided the copyright +// notice and this notice are preserved. This file is offered as-is, +// without any warranty. + + 0x72, 0xb5, 0x4a, 0x86, /* Magic */ + 0x00, 0x00, 0x00, 0x00, /* Version */ + 0x20, 0x00, 0x00, 0x00, /* Header size */ + 0x01, 0x00, 0x00, 0x00, /* Flags */ + 0x00, 0x01, 0x00, 0x00, /* No. of chars */ + 0x0c, 0x00, 0x00, 0x00, /* Char length */ + 0x0c, 0x00, 0x00, 0x00, /* Char width */ + 0x06, 0x00, 0x00, 0x00, /* Char height */ + 0x00, 0x00, 0x00, 0x48, 0x30, 0x48, 0x48, 0x30, + 0x48, 0x00, 0x00, 0x00, /* 0 */ + 0x00, 0x00, 0x20, 0x20, 0x20, 0x00, 0x00, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 1 */ + 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 2 */ + 0x00, 0x00, 0x78, 0x84, 0xb4, 0xa4, 0xa4, 0xb4, + 0x84, 0x78, 0x00, 0x00, /* 3 */ + 0x00, 0x00, 0x00, 0x20, 0x70, 0xf8, 0x70, 0x20, + 0x00, 0x00, 0x00, 0x00, /* 4 */ + 0x00, 0x00, 0x78, 0x84, 0xb4, 0xac, 0xb4, 0xac, + 0x84, 0x78, 0x00, 0x00, /* 5 */ + 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 6 */ + 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x78, 0x30, + 0x00, 0x00, 0x00, 0x00, /* 7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x20, 0x20, 0x40, /* 8 */ + 0x10, 0x20, 0x70, 0x88, 0x88, 0x88, 0xf8, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 9 */ + 0x20, 0x50, 0x70, 0x88, 0x88, 0x88, 0xf8, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 10 */ + 0x50, 0x50, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 11 */ + 0x10, 0x20, 0x70, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 12 */ + 0x20, 0x50, 0x70, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 13 */ + 0x10, 0x20, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 14 */ + 0x20, 0x50, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 15 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x50, 0x20, 0x50, + 0x88, 0x00, 0x00, 0x00, /* 16 */ + 0x10, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 17 */ + 0x10, 0x20, 0x88, 0x88, 0x50, 0x50, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 18 */ + 0x00, 0x00, 0x10, 0x20, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x08, 0x70, /* 19 */ + 0x00, 0x00, 0x78, 0xa8, 0xa8, 0xa8, 0x68, 0x28, + 0x28, 0x28, 0x00, 0x00, /* 20 */ + 0x00, 0x30, 0x48, 0x20, 0x50, 0x48, 0x28, 0x10, + 0x48, 0x30, 0x00, 0x00, /* 21 */ + 0x50, 0x20, 0x70, 0x88, 0x88, 0x88, 0xf8, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 22 */ + 0x00, 0x00, 0x50, 0x20, 0x70, 0x08, 0x78, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 23 */ + 0x00, 0x00, 0x20, 0x70, 0xf8, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 24 */ + 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0xf8, + 0x70, 0x20, 0x00, 0x00, /* 25 */ + 0x00, 0x00, 0x00, 0x10, 0x18, 0xfc, 0x18, 0x10, + 0x00, 0x00, 0x00, 0x00, /* 26 */ + 0x00, 0x00, 0x00, 0x20, 0x60, 0xfc, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, /* 27 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0xf8, 0x88, + 0x88, 0x88, 0x10, 0x0c, /* 28 */ + 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x78, 0x88, + 0x88, 0x78, 0x10, 0x0c, /* 29 */ + 0x10, 0x20, 0x70, 0x88, 0x80, 0x80, 0x80, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 30 */ + 0x00, 0x00, 0x10, 0x20, 0x70, 0x88, 0x80, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 31 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 32 */ + 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x00, 0x00, /* 33 */ + 0x00, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 34 */ + 0x00, 0x00, 0x50, 0x50, 0xf8, 0x50, 0x50, 0xf8, + 0x50, 0x50, 0x00, 0x00, /* 35 */ + 0x00, 0x00, 0x20, 0x70, 0xa8, 0xa0, 0x70, 0x28, + 0xa8, 0x70, 0x20, 0x00, /* 36 */ + 0x00, 0x00, 0x48, 0xa8, 0x50, 0x10, 0x20, 0x28, + 0x54, 0x48, 0x00, 0x00, /* 37 */ + 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x68, 0x90, + 0x90, 0x68, 0x00, 0x00, /* 38 */ + 0x00, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 39 */ + 0x00, 0x00, 0x10, 0x20, 0x40, 0x40, 0x40, 0x40, + 0x20, 0x10, 0x00, 0x00, /* 40 */ + 0x00, 0x00, 0x40, 0x20, 0x10, 0x10, 0x10, 0x10, + 0x20, 0x40, 0x00, 0x00, /* 41 */ + 0x00, 0x00, 0x00, 0x00, 0x50, 0x20, 0xf8, 0x20, + 0x50, 0x00, 0x00, 0x00, /* 42 */ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0xf8, 0x20, + 0x20, 0x00, 0x00, 0x00, /* 43 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x20, 0x40, 0x00, /* 44 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 45 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x20, 0x00, 0x00, /* 46 */ + 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, + 0x40, 0x40, 0x00, 0x00, /* 47 */ + 0x00, 0x00, 0x70, 0x88, 0x98, 0xa8, 0xc8, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 48 */ + 0x00, 0x00, 0x20, 0x60, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 49 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x10, 0x20, 0x40, + 0x80, 0xf8, 0x00, 0x00, /* 50 */ + 0x00, 0x00, 0x70, 0x88, 0x08, 0x30, 0x08, 0x08, + 0x88, 0x70, 0x00, 0x00, /* 51 */ + 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x88, 0xf8, + 0x08, 0x08, 0x00, 0x00, /* 52 */ + 0x00, 0x00, 0xf8, 0x80, 0x80, 0xf0, 0x08, 0x08, + 0x88, 0x70, 0x00, 0x00, /* 53 */ + 0x00, 0x00, 0x70, 0x80, 0x80, 0xf0, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 54 */ + 0x00, 0x00, 0xf8, 0x08, 0x08, 0x10, 0x10, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 55 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x70, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 56 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x78, 0x08, + 0x08, 0x70, 0x00, 0x00, /* 57 */ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, + 0x20, 0x20, 0x00, 0x00, /* 58 */ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, + 0x20, 0x20, 0x40, 0x00, /* 59 */ + 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, + 0x10, 0x08, 0x00, 0x00, /* 60 */ + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, + 0x00, 0x00, 0x00, 0x00, /* 61 */ + 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x10, + 0x20, 0x40, 0x00, 0x00, /* 62 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x10, 0x20, 0x00, + 0x20, 0x20, 0x00, 0x00, /* 63 */ + 0x00, 0x00, 0x70, 0x88, 0x98, 0xa8, 0xa8, 0x98, + 0x80, 0x78, 0x00, 0x00, /* 64 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0xf8, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 65 */ + 0x00, 0x00, 0xf0, 0x88, 0x88, 0xf0, 0x88, 0x88, + 0x88, 0xf0, 0x00, 0x00, /* 66 */ + 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, 0x80, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 67 */ + 0x00, 0x00, 0xe0, 0x90, 0x88, 0x88, 0x88, 0x88, + 0x90, 0xe0, 0x00, 0x00, /* 68 */ + 0x00, 0x00, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 69 */ + 0x00, 0x00, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, + 0x80, 0x80, 0x00, 0x00, /* 70 */ + 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, 0xb8, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 71 */ + 0x00, 0x00, 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 72 */ + 0x00, 0x00, 0x70, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 73 */ + 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x90, + 0x90, 0x60, 0x00, 0x00, /* 74 */ + 0x00, 0x00, 0x88, 0x90, 0xa0, 0xc0, 0xc0, 0xa0, + 0x90, 0x88, 0x00, 0x00, /* 75 */ + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 76 */ + 0x00, 0x00, 0x88, 0xd8, 0xa8, 0xa8, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 77 */ + 0x00, 0x00, 0x88, 0x88, 0xc8, 0xa8, 0x98, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 78 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 79 */ + 0x00, 0x00, 0xf0, 0x88, 0x88, 0x88, 0xf0, 0x80, + 0x80, 0x80, 0x00, 0x00, /* 80 */ + 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, + 0xa8, 0x70, 0x08, 0x00, /* 81 */ + 0x00, 0x00, 0xf0, 0x88, 0x88, 0x88, 0xf0, 0xa0, + 0x90, 0x88, 0x00, 0x00, /* 82 */ + 0x00, 0x00, 0x70, 0x88, 0x80, 0x70, 0x08, 0x08, + 0x88, 0x70, 0x00, 0x00, /* 83 */ + 0x00, 0x00, 0xf8, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 84 */ + 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 85 */ + 0x00, 0x00, 0x88, 0x88, 0x88, 0x50, 0x50, 0x50, + 0x20, 0x20, 0x00, 0x00, /* 86 */ + 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0xa8, 0xa8, + 0xd8, 0x88, 0x00, 0x00, /* 87 */ + 0x00, 0x00, 0x88, 0x88, 0x50, 0x20, 0x20, 0x50, + 0x88, 0x88, 0x00, 0x00, /* 88 */ + 0x00, 0x00, 0x88, 0x88, 0x50, 0x50, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 89 */ + 0x00, 0x00, 0xf8, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 90 */ + 0x00, 0x00, 0x70, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x70, 0x00, 0x00, /* 91 */ + 0x00, 0x00, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, + 0x08, 0x08, 0x00, 0x00, /* 92 */ + 0x00, 0x00, 0x70, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x70, 0x00, 0x00, /* 93 */ + 0x00, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 94 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf8, 0x00, /* 95 */ + 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 96 */ + 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x78, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 97 */ + 0x00, 0x00, 0x80, 0x80, 0xf0, 0x88, 0x88, 0x88, + 0x88, 0xf0, 0x00, 0x00, /* 98 */ + 0x00, 0x00, 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 99 */ + 0x00, 0x00, 0x08, 0x08, 0x78, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 100 */ + 0x00, 0x00, 0x00, 0x00, 0x70, 0x88, 0xf8, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 101 */ + 0x00, 0x00, 0x18, 0x20, 0x70, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 102 */ + 0x00, 0x00, 0x00, 0x00, 0x78, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x08, 0x70, /* 103 */ + 0x00, 0x00, 0x80, 0x80, 0xf0, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 104 */ + 0x00, 0x20, 0x20, 0x00, 0x60, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 105 */ + 0x00, 0x08, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x48, 0x30, /* 106 */ + 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x60, + 0x50, 0x48, 0x00, 0x00, /* 107 */ + 0x00, 0x00, 0x60, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 108 */ + 0x00, 0x00, 0x00, 0x00, 0xf0, 0xa8, 0xa8, 0xa8, + 0xa8, 0xa8, 0x00, 0x00, /* 109 */ + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 110 */ + 0x00, 0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 111 */ + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x88, 0x88, 0x88, + 0x88, 0xf0, 0x80, 0x80, /* 112 */ + 0x00, 0x00, 0x00, 0x00, 0x78, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x08, 0x08, /* 113 */ + 0x00, 0x00, 0x00, 0x00, 0xb8, 0xc0, 0x80, 0x80, + 0x80, 0x80, 0x00, 0x00, /* 114 */ + 0x00, 0x00, 0x00, 0x00, 0x78, 0x80, 0x70, 0x08, + 0x08, 0xf0, 0x00, 0x00, /* 115 */ + 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x20, + 0x20, 0x18, 0x00, 0x00, /* 116 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 117 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x50, 0x50, + 0x20, 0x20, 0x00, 0x00, /* 118 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0xa8, 0xa8, + 0xa8, 0x70, 0x00, 0x00, /* 119 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x50, 0x20, 0x20, + 0x50, 0x88, 0x00, 0x00, /* 120 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x08, 0x70, /* 121 */ + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x10, 0x20, 0x40, + 0x80, 0xf8, 0x00, 0x00, /* 122 */ + 0x00, 0x00, 0x18, 0x20, 0x20, 0x40, 0x20, 0x20, + 0x20, 0x18, 0x00, 0x00, /* 123 */ + 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 124 */ + 0x00, 0x00, 0x60, 0x10, 0x10, 0x08, 0x10, 0x10, + 0x10, 0x60, 0x00, 0x00, /* 125 */ + 0x00, 0x48, 0xa8, 0x90, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 126 */ + 0x50, 0x20, 0x70, 0x88, 0x80, 0x80, 0x80, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 127 */ + 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, 0x80, 0x80, + 0x88, 0x70, 0x20, 0x40, /* 128 */ + 0x00, 0x00, 0x50, 0x50, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 129 */ + 0x00, 0x00, 0x10, 0x20, 0x70, 0x88, 0xf8, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 130 */ + 0x00, 0x00, 0x20, 0x50, 0x70, 0x08, 0x78, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 131 */ + 0x00, 0x00, 0x50, 0x50, 0x70, 0x08, 0x78, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 132 */ + 0x00, 0x00, 0x40, 0x20, 0x70, 0x08, 0x78, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 133 */ + 0x00, 0x00, 0x50, 0x20, 0x70, 0x88, 0x80, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 134 */ + 0x00, 0x00, 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, + 0x88, 0x70, 0x20, 0x40, /* 135 */ + 0x50, 0x20, 0x70, 0x48, 0x44, 0x44, 0x44, 0x44, + 0x48, 0x70, 0x00, 0x00, /* 136 */ + 0x00, 0x00, 0x50, 0x50, 0x70, 0x88, 0xf8, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 137 */ + 0x00, 0x00, 0x40, 0x20, 0x70, 0x88, 0xf8, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 138 */ + 0x50, 0x20, 0x08, 0x08, 0x78, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 139 */ + 0x00, 0x00, 0x20, 0x50, 0x60, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 140 */ + 0x00, 0x00, 0x60, 0x50, 0x48, 0xe8, 0x48, 0x48, + 0x50, 0x60, 0x00, 0x00, /* 141 */ + 0x50, 0x50, 0x70, 0x88, 0x88, 0x88, 0xf8, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 142 */ + 0x00, 0x00, 0x08, 0x3c, 0x08, 0x78, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 143 */ + 0x10, 0x20, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 144 */ + 0x00, 0x00, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, + 0x80, 0xf8, 0x10, 0x0c, /* 145 */ + 0x00, 0x00, 0x00, 0x00, 0x70, 0x88, 0xf8, 0x80, + 0x88, 0x70, 0x20, 0x18, /* 146 */ + 0x00, 0x00, 0x20, 0x50, 0x70, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 147 */ + 0x00, 0x00, 0x50, 0x50, 0x70, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 148 */ + 0x50, 0x20, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 149 */ + 0x00, 0x00, 0x50, 0x20, 0x70, 0x88, 0xf8, 0x80, + 0x88, 0x70, 0x00, 0x00, /* 150 */ + 0x20, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 151 */ + 0x10, 0x20, 0x60, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 152 */ + 0x50, 0x50, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 153 */ + 0x50, 0x50, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 154 */ + 0x50, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 155 */ + 0x00, 0x00, 0x30, 0x48, 0x40, 0xf0, 0x40, 0x40, + 0x48, 0xf8, 0x00, 0x00, /* 156 */ + 0x50, 0x20, 0x60, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 157 */ + 0x00, 0x00, 0x40, 0x40, 0x40, 0x60, 0xc0, 0x40, + 0x40, 0x7c, 0x00, 0x00, /* 158 */ + 0x00, 0x00, 0x60, 0x20, 0x20, 0x30, 0x60, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 159 */ + 0x00, 0x00, 0x10, 0x20, 0x70, 0x08, 0x78, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 160 */ + 0x00, 0x00, 0x10, 0x20, 0x60, 0x20, 0x20, 0x20, + 0x20, 0x70, 0x00, 0x00, /* 161 */ + 0x00, 0x00, 0x10, 0x20, 0x70, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 162 */ + 0x00, 0x00, 0x10, 0x20, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 163 */ + 0x00, 0x00, 0x28, 0x50, 0xf0, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 164 */ + 0x28, 0x50, 0x88, 0x88, 0xc8, 0xa8, 0x98, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 165 */ + 0x10, 0x20, 0x88, 0x88, 0xc8, 0xa8, 0x98, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 166 */ + 0x00, 0x00, 0x10, 0x20, 0xf0, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 167 */ + 0x00, 0x00, 0x20, 0x20, 0x00, 0x20, 0x40, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 168 */ + 0x50, 0x20, 0x88, 0x88, 0xc8, 0xa8, 0x98, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 169 */ + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0x08, 0x08, + 0x00, 0x00, 0x00, 0x00, /* 170 */ + 0x00, 0x00, 0x50, 0x20, 0xf0, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 171 */ + 0x28, 0x50, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 172 */ + 0x00, 0x00, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 173 */ + 0x00, 0x00, 0x00, 0x14, 0x28, 0x50, 0xa0, 0x50, + 0x28, 0x14, 0x00, 0x00, /* 174 */ + 0x00, 0x00, 0x00, 0xa0, 0x50, 0x28, 0x14, 0x28, + 0x50, 0xa0, 0x00, 0x00, /* 175 */ + 0x90, 0x24, 0x90, 0x24, 0x90, 0x24, 0x90, 0x24, + 0x90, 0x24, 0x90, 0x24, /* 176 */ + 0xa8, 0x54, 0xa8, 0x54, 0xa8, 0x54, 0xa8, 0x54, + 0xa8, 0x54, 0xa8, 0x54, /* 177 */ + 0x00, 0x00, 0x28, 0x50, 0x70, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 178 */ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 179 */ + 0x20, 0x20, 0x20, 0x20, 0x20, 0xe0, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 180 */ + 0x10, 0x20, 0xf0, 0x88, 0x88, 0x88, 0xf0, 0xa0, + 0x90, 0x88, 0x00, 0x00, /* 181 */ + 0x00, 0x00, 0x10, 0x20, 0xb8, 0xc0, 0x80, 0x80, + 0x80, 0x80, 0x00, 0x00, /* 182 */ + 0x50, 0x20, 0xf0, 0x88, 0x88, 0x88, 0xf0, 0xa0, + 0x90, 0x88, 0x00, 0x00, /* 183 */ + 0x00, 0x00, 0x50, 0x20, 0xb8, 0xc0, 0x80, 0x80, + 0x80, 0x80, 0x00, 0x00, /* 184 */ + 0x10, 0x20, 0x70, 0x88, 0x80, 0x70, 0x08, 0x08, + 0x88, 0x70, 0x00, 0x00, /* 185 */ + 0x00, 0x00, 0x10, 0x20, 0x78, 0x80, 0x70, 0x08, + 0x08, 0xf0, 0x00, 0x00, /* 186 */ + 0x00, 0x00, 0x70, 0x88, 0x80, 0x70, 0x08, 0x08, + 0x88, 0x70, 0x20, 0x40, /* 187 */ + 0x00, 0x00, 0x00, 0x00, 0x78, 0x80, 0x70, 0x08, + 0x08, 0xf0, 0x20, 0x40, /* 188 */ + 0x50, 0x20, 0x70, 0x88, 0x80, 0x70, 0x08, 0x08, + 0x88, 0x70, 0x00, 0x00, /* 189 */ + 0x00, 0x00, 0x50, 0x20, 0x78, 0x80, 0x70, 0x08, + 0x08, 0xf0, 0x00, 0x00, /* 190 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 191 */ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 192 */ + 0x20, 0x20, 0x20, 0x20, 0x20, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 193 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 194 */ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 195 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 196 */ + 0x20, 0x20, 0x20, 0x20, 0x20, 0xfc, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 197 */ + 0x00, 0x00, 0xf8, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x30, 0x10, 0x20, /* 198 */ + 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x20, + 0x20, 0x18, 0x10, 0x20, /* 199 */ + 0x50, 0x20, 0xf8, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 200 */ + 0x50, 0x20, 0x20, 0x20, 0x70, 0x20, 0x20, 0x20, + 0x20, 0x18, 0x00, 0x00, /* 201 */ + 0x20, 0x50, 0xa8, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 202 */ + 0x00, 0x00, 0x20, 0x50, 0xa8, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 203 */ + 0x28, 0x50, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x70, 0x00, 0x00, /* 204 */ + 0x00, 0x00, 0x28, 0x50, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x78, 0x00, 0x00, /* 205 */ + 0x50, 0x50, 0x50, 0x50, 0xdc, 0x00, 0xdc, 0x50, + 0x50, 0x50, 0x50, 0x50, /* 206 */ + 0x10, 0x20, 0xf8, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 207 */ + 0x00, 0x00, 0x10, 0x20, 0xf8, 0x10, 0x20, 0x40, + 0x80, 0xf8, 0x00, 0x00, /* 208 */ + 0x20, 0x20, 0xf8, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 209 */ + 0x00, 0x00, 0x20, 0x20, 0xf8, 0x10, 0x20, 0x40, + 0x80, 0xf8, 0x00, 0x00, /* 210 */ + 0x50, 0x20, 0xf8, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 211 */ + 0x00, 0x00, 0x50, 0x20, 0xf8, 0x10, 0x20, 0x40, + 0x80, 0xf8, 0x00, 0x00, /* 212 */ + 0x00, 0x00, 0x70, 0x88, 0x80, 0x70, 0x08, 0x08, + 0x88, 0x70, 0x20, 0x40, /* 213 */ + 0x00, 0x00, 0x00, 0x00, 0x78, 0x80, 0x70, 0x08, + 0x08, 0xf0, 0x20, 0x40, /* 214 */ + 0x00, 0x00, 0xf8, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x30, 0x10, 0x20, /* 215 */ + 0x20, 0x20, 0x20, 0x20, 0xfc, 0x20, 0xfc, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 216 */ + 0x20, 0x20, 0x20, 0x20, 0x20, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 217 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, /* 218 */ + 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, + 0xfc, 0xfc, 0xfc, 0xfc, /* 219 */ + 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x20, + 0x20, 0x18, 0x10, 0x20, /* 220 */ + 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 221 */ + 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 222 */ + 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 223 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x10, 0x0c, /* 224 */ + 0x00, 0x00, 0xe0, 0x90, 0x90, 0xf0, 0x88, 0x88, + 0xc8, 0xb0, 0x00, 0x00, /* 225 */ + 0x28, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 226 */ + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 227 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 228 */ + 0x00, 0x10, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 229 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, + 0x98, 0xe8, 0x80, 0x80, /* 230 */ + 0x00, 0x20, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 231 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x20, 0x40, 0x00, /* 232 */ + 0x00, 0x28, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 233 */ + 0x00, 0x50, 0x50, 0xa0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 234 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x50, 0x50, 0xa0, 0x00, /* 235 */ + 0x00, 0x00, 0x20, 0x70, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, /* 236 */ + 0x00, 0x00, 0x20, 0x70, 0x20, 0x20, 0x20, 0x20, + 0x70, 0x20, 0x00, 0x00, /* 237 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0xa8, 0x00, 0x00, /* 238 */ + 0x00, 0x00, 0x44, 0xa8, 0x50, 0x20, 0x40, 0xa8, + 0x54, 0x28, 0x00, 0x00, /* 239 */ + 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, + 0x10, 0x08, 0x00, 0x00, /* 240 */ + 0x00, 0x00, 0x00, 0x20, 0x20, 0xf8, 0x20, 0x20, + 0x00, 0xf8, 0x00, 0x00, /* 241 */ + 0x00, 0x40, 0x20, 0x10, 0x08, 0x10, 0x20, 0x40, + 0x00, 0xf8, 0x00, 0x00, /* 242 */ + 0x00, 0x10, 0x20, 0x40, 0x80, 0x40, 0x20, 0x10, + 0x00, 0xf8, 0x00, 0x00, /* 243 */ + 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x10, + 0x20, 0x40, 0x00, 0x00, /* 244 */ + 0x00, 0x00, 0x00, 0x38, 0x44, 0xf0, 0x40, 0xf0, + 0x44, 0x38, 0x00, 0x00, /* 245 */ + 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0xf8, 0x00, + 0x20, 0x20, 0x00, 0x00, /* 246 */ + 0x00, 0x00, 0x00, 0x00, 0x68, 0xb0, 0x00, 0x68, + 0xb0, 0x00, 0x00, 0x00, /* 247 */ + 0x00, 0x20, 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 248 */ + 0x00, 0x00, 0xf4, 0x5c, 0x54, 0x54, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 249 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, + 0x00, 0x00, 0x00, 0x00, /* 250 */ + 0x00, 0x00, 0x00, 0x08, 0xf8, 0x20, 0x40, 0xf8, + 0x80, 0x00, 0x00, 0x00, /* 251 */ + 0x00, 0x00, 0x94, 0x94, 0xd0, 0xf0, 0xf0, 0xb4, + 0x90, 0x94, 0x00, 0x00, /* 252 */ + 0x40, 0x20, 0x70, 0x88, 0x88, 0x88, 0xf8, 0x88, + 0x88, 0x88, 0x00, 0x00, /* 253 */ + 0x00, 0x00, 0x00, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x00, 0x00, 0x00, 0x00, /* 254 */ + 0x40, 0x20, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, + 0x80, 0xf8, 0x00, 0x00, /* 255 */ + 0xc2, 0xa4, 0xff, + 0xc2, 0xa6, 0xff, + 0xc2, 0xa8, 0xff, + 0xc2, 0xa9, 0xff, + 0xe2, 0x99, 0xa6, 0xe2, 0x97, 0x88, 0xef, + 0xbf, 0xbd, 0xff, + 0xc2, 0xae, 0xff, + 0xc2, 0xb4, 0xff, + 0xe2, 0x80, 0xa2, 0xe2, 0x97, 0x8f, 0xff, + 0xc2, 0xb8, 0xff, + 0xc3, 0x81, 0xff, + 0xc3, 0x82, 0xff, + 0xc3, 0x8b, 0xd0, 0x81, 0xff, + 0xc3, 0x8d, 0xff, + 0xc3, 0x8e, 0xff, + 0xc3, 0x93, 0xff, + 0xc3, 0x94, 0xff, + 0xc3, 0x97, 0xff, + 0xc3, 0x9a, 0xff, + 0xc3, 0x9d, 0xff, + 0xc3, 0xbd, 0xff, + 0xc2, 0xb6, 0xff, + 0xc2, 0xa7, 0xff, + 0xc4, 0x82, 0xd3, 0x90, 0xff, + 0xc4, 0x83, 0xd3, 0x91, 0xff, + 0xe2, 0x86, 0x91, 0xe2, 0x96, 0xb2, 0xe2, + 0x96, 0xb4, 0xff, + 0xe2, 0x86, 0x93, 0xe2, 0x96, 0xbc, 0xe2, + 0x96, 0xbe, 0xff, + 0xe2, 0x86, 0x92, 0xe2, 0x96, 0xb6, 0xe2, + 0x96, 0xb8, 0xff, + 0xe2, 0x86, 0x90, 0xe2, 0x97, 0x80, 0xe2, + 0x97, 0x82, 0xff, + 0xc4, 0x84, 0xff, + 0xc4, 0x85, 0xff, + 0xc4, 0x86, 0xff, + 0xc4, 0x87, 0xff, + 0x20, 0xc2, 0xa0, 0xe2, 0x80, 0x80, 0xe2, + 0x80, 0x81, 0xe2, 0x80, 0x82, 0xe2, 0x80, 0x83, + 0xe2, 0x80, 0x84, 0xe2, 0x80, 0x85, 0xe2, 0x80, + 0x86, 0xe2, 0x80, 0x87, 0xe2, 0x80, 0x88, 0xe2, + 0x80, 0x89, 0xe2, 0x80, 0x8a, 0xff, + 0x21, 0xff, + 0x22, 0xff, + 0x23, 0xff, + 0x24, 0xff, + 0x25, 0xe2, 0x8a, 0x95, 0xff, + 0x26, 0xff, + 0x27, 0xff, + 0x28, 0xff, + 0x29, 0xff, + 0x2a, 0xe2, 0x8a, 0x9b, 0xff, + 0x2b, 0xff, + 0x2c, 0xff, + 0x2d, 0xe2, 0x80, 0x92, 0xe2, 0x80, 0x93, + 0xe2, 0x88, 0x92, 0xc2, 0xad, 0xe2, 0x80, 0x90, + 0xe2, 0x80, 0x91, 0xe2, 0x8a, 0x96, 0xff, + 0x2e, 0xe2, 0x8a, 0x99, 0xff, + 0x2f, 0xe2, 0x8a, 0x98, 0xff, + 0x30, 0xe2, 0x93, 0xaa, 0xff, + 0x31, 0xe2, 0x91, 0xa0, 0xff, + 0x32, 0xe2, 0x91, 0xa1, 0xff, + 0x33, 0xe2, 0x91, 0xa2, 0xff, + 0x34, 0xe2, 0x91, 0xa3, 0xff, + 0x35, 0xe2, 0x91, 0xa4, 0xff, + 0x36, 0xe2, 0x91, 0xa5, 0xff, + 0x37, 0xe2, 0x91, 0xa6, 0xff, + 0x38, 0xe2, 0x91, 0xa7, 0xff, + 0x39, 0xe2, 0x91, 0xa8, 0xff, + 0x3a, 0xff, + 0x3b, 0xff, + 0x3c, 0xff, + 0x3d, 0xe2, 0x8a, 0x9c, 0xff, + 0x3e, 0xff, + 0x3f, 0xff, + 0x40, 0xff, + 0x41, 0xd0, 0x90, 0xce, 0x91, 0xe2, 0x92, + 0xb6, 0xff, + 0x42, 0xd0, 0x92, 0xce, 0x92, 0xe2, 0x92, + 0xb7, 0xff, + 0x43, 0xd0, 0xa1, 0xe2, 0x92, 0xb8, 0xff, + 0x44, 0xe2, 0x92, 0xb9, 0xff, + 0x45, 0xd0, 0x95, 0xce, 0x95, 0xe2, 0x92, + 0xba, 0xff, + 0x46, 0xe2, 0x92, 0xbb, 0xff, + 0x47, 0xe2, 0x92, 0xbc, 0xff, + 0x48, 0xd0, 0x9d, 0xce, 0x97, 0xe2, 0x92, + 0xbd, 0xff, + 0x49, 0xd0, 0x86, 0xce, 0x99, 0xe2, 0x92, + 0xbe, 0xff, + 0x4a, 0xd0, 0x88, 0xe2, 0x92, 0xbf, 0xff, + 0x4b, 0xd0, 0x9a, 0xce, 0x9a, 0xe2, 0x84, + 0xaa, 0xe2, 0x93, 0x80, 0xff, + 0x4c, 0xe2, 0x93, 0x81, 0xff, + 0x4d, 0xd0, 0x9c, 0xce, 0x9c, 0xe2, 0x93, + 0x82, 0xff, + 0x4e, 0xce, 0x9d, 0xe2, 0x93, 0x83, 0xff, + 0x4f, 0xd0, 0x9e, 0xce, 0x9f, 0xe2, 0x93, + 0x84, 0xff, + 0x50, 0xd0, 0xa0, 0xce, 0xa1, 0xe2, 0x93, + 0x85, 0xff, + 0x51, 0xe2, 0x93, 0x86, 0xff, + 0x52, 0xe2, 0x93, 0x87, 0xff, + 0x53, 0xd0, 0x85, 0xe2, 0x93, 0x88, 0xff, + 0x54, 0xd0, 0xa2, 0xce, 0xa4, 0xe2, 0x93, + 0x89, 0xff, + 0x55, 0xe2, 0x93, 0x8a, 0xff, + 0x56, 0xe2, 0x93, 0x8b, 0xff, + 0x57, 0xe2, 0x93, 0x8c, 0xff, + 0x58, 0xd0, 0xa5, 0xce, 0xa7, 0xe2, 0x93, + 0x8d, 0xff, + 0x59, 0xd2, 0xae, 0xe2, 0x93, 0x8e, 0xff, + 0x5a, 0xce, 0x96, 0xe2, 0x93, 0x8f, 0xff, + 0x5b, 0xff, + 0x5c, 0xff, + 0x5d, 0xff, + 0x5e, 0xff, + 0x5f, 0xff, + 0x60, 0xff, + 0x61, 0xd0, 0xb0, 0xe2, 0x93, 0x90, 0xff, + 0x62, 0xe2, 0x93, 0x91, 0xff, + 0x63, 0xd1, 0x81, 0xe2, 0x93, 0x92, 0xff, + 0x64, 0xe2, 0x93, 0x93, 0xff, + 0x65, 0xd0, 0xb5, 0xe2, 0x93, 0x94, 0xff, + 0x66, 0xe2, 0x93, 0x95, 0xff, + 0x67, 0xe2, 0x93, 0x96, 0xff, + 0x68, 0xe2, 0x93, 0x97, 0xff, + 0x69, 0xd1, 0x96, 0xe2, 0x93, 0x98, 0xff, + 0x6a, 0xd1, 0x98, 0xe2, 0x93, 0x99, 0xff, + 0x6b, 0xe2, 0x93, 0x9a, 0xff, + 0x6c, 0xe2, 0x93, 0x9b, 0xff, + 0x6d, 0xe2, 0x93, 0x9c, 0xff, + 0x6e, 0xe2, 0x93, 0x9d, 0xff, + 0x6f, 0xd0, 0xbe, 0xe2, 0x93, 0x9e, 0xff, + 0x70, 0xd1, 0x80, 0xe2, 0x93, 0x9f, 0xff, + 0x71, 0xe2, 0x93, 0xa0, 0xff, + 0x72, 0xe2, 0x93, 0xa1, 0xff, + 0x73, 0xd1, 0x95, 0x73, 0xe2, 0x93, 0xa2, + 0xff, + 0x74, 0xe2, 0x93, 0xa3, 0xff, + 0x75, 0xe2, 0x93, 0xa4, 0xff, + 0x76, 0xe2, 0x93, 0xa5, 0xff, + 0x77, 0xe2, 0x93, 0xa6, 0xff, + 0x78, 0xd1, 0x85, 0xe2, 0x93, 0xa7, 0xff, + 0x79, 0xd1, 0x83, 0xe2, 0x93, 0xa8, 0xff, + 0x7a, 0xe2, 0x93, 0xa9, 0xff, + 0x7b, 0xff, + 0x7c, 0xff, + 0x7d, 0xff, + 0x7e, 0xff, + 0xc4, 0x8c, 0xff, + 0xc3, 0x87, 0xff, + 0xc3, 0xbc, 0xff, + 0xc3, 0xa9, 0xff, + 0xc3, 0xa2, 0xff, + 0xc3, 0xa4, 0xff, + 0xc3, 0xa0, 0xff, + 0xc4, 0x8d, 0xff, + 0xc3, 0xa7, 0xff, + 0xc4, 0x8e, 0xff, + 0xc3, 0xab, 0xd1, 0x91, 0xff, + 0xc3, 0xa8, 0xff, + 0xc4, 0x8f, 0xff, + 0xc3, 0xae, 0xff, + 0xc3, 0x90, 0xc4, 0x90, 0xff, + 0xc3, 0x84, 0xff, + 0xc4, 0x91, 0xff, + 0xc3, 0x89, 0xff, + 0xc4, 0x98, 0xff, + 0xc4, 0x99, 0xff, + 0xc3, 0xb4, 0xff, + 0xc3, 0xb6, 0xff, + 0xc4, 0x9a, 0xff, + 0xc4, 0x9b, 0xff, + 0xc4, 0xb9, 0xff, + 0xc4, 0xba, 0xff, + 0xc3, 0x96, 0xff, + 0xc3, 0x9c, 0xff, + 0xc4, 0xbd, 0xff, + 0xc2, 0xa3, 0xff, + 0xc4, 0xbe, 0xff, + 0xc5, 0x81, 0xff, + 0xc5, 0x82, 0xff, + 0xc3, 0xa1, 0xff, + 0xc3, 0xad, 0xff, + 0xc3, 0xb3, 0xff, + 0xc3, 0xba, 0xff, + 0xc3, 0xb1, 0xff, + 0xc3, 0x91, 0xff, + 0xc5, 0x83, 0xff, + 0xc5, 0x84, 0xff, + 0xc2, 0xbf, 0xff, + 0xc5, 0x87, 0xff, + 0xc2, 0xac, 0xff, + 0xc5, 0x88, 0xff, + 0xc5, 0x90, 0xff, + 0xc2, 0xa1, 0xff, + 0xc2, 0xab, 0xe2, 0x89, 0xaa, 0xff, + 0xc2, 0xbb, 0xe2, 0x89, 0xab, 0xff, + 0xe2, 0x96, 0x91, 0xff, + 0xe2, 0x96, 0x92, 0xff, + 0xc5, 0x91, 0xff, + 0xe2, 0x94, 0x82, 0xe2, 0x94, 0x83, 0xe2, + 0x95, 0xbf, 0xe2, 0x95, 0xbd, 0xe2, 0x95, 0xbb, + 0xe2, 0x95, 0xb7, 0xe2, 0x95, 0xb9, 0xe2, 0x95, + 0xb5, 0xff, + 0xe2, 0x94, 0xa4, 0xe2, 0x94, 0xab, 0xe2, + 0x94, 0xaa, 0xe2, 0x94, 0xa9, 0xe2, 0x94, 0xa8, + 0xe2, 0x94, 0xa7, 0xe2, 0x94, 0xa6, 0xe2, 0x94, + 0xa5, 0xff, + 0xc5, 0x94, 0xff, + 0xc5, 0x95, 0xff, + 0xc5, 0x98, 0xff, + 0xc5, 0x99, 0xff, + 0xc5, 0x9a, 0xff, + 0xc5, 0x9b, 0xff, + 0xc5, 0x9e, 0xff, + 0xc5, 0x9f, 0xff, + 0xc5, 0xa0, 0xff, + 0xc5, 0xa1, 0xff, + 0xe2, 0x94, 0x90, 0xe2, 0x94, 0x93, 0xe2, + 0x94, 0x92, 0xe2, 0x94, 0x91, 0xff, + 0xe2, 0x94, 0x94, 0xe2, 0x94, 0x97, 0xe2, + 0x94, 0x96, 0xe2, 0x94, 0x95, 0xff, + 0xe2, 0x94, 0xb4, 0xe2, 0x94, 0xbb, 0xe2, + 0x94, 0xba, 0xe2, 0x94, 0xb9, 0xe2, 0x94, 0xb8, + 0xe2, 0x94, 0xb7, 0xe2, 0x94, 0xb6, 0xe2, 0x94, + 0xb5, 0xff, + 0xe2, 0x94, 0xac, 0xe2, 0x94, 0xb3, 0xe2, + 0x94, 0xb2, 0xe2, 0x94, 0xb1, 0xe2, 0x94, 0xb0, + 0xe2, 0x94, 0xaf, 0xe2, 0x94, 0xae, 0xe2, 0x94, + 0xad, 0xff, + 0xe2, 0x94, 0x9c, 0xe2, 0x94, 0xa3, 0xe2, + 0x94, 0xa2, 0xe2, 0x94, 0xa1, 0xe2, 0x94, 0xa0, + 0xe2, 0x94, 0x9f, 0xe2, 0x94, 0x9e, 0xe2, 0x94, + 0x9d, 0xff, + 0xe2, 0x94, 0x80, 0xe2, 0x94, 0x81, 0xe2, + 0x95, 0xbe, 0xe2, 0x95, 0xbc, 0xe2, 0x95, 0xba, + 0xe2, 0x95, 0xb6, 0xe2, 0x95, 0xb8, 0xe2, 0x95, + 0xb4, 0xff, + 0xe2, 0x94, 0xbc, 0xe2, 0x95, 0x8b, 0xe2, + 0x95, 0x8a, 0xe2, 0x95, 0x89, 0xe2, 0x95, 0x88, + 0xe2, 0x95, 0x87, 0xe2, 0x95, 0x86, 0xe2, 0x95, + 0x85, 0xe2, 0x95, 0x84, 0xe2, 0x95, 0x83, 0xe2, + 0x95, 0x82, 0xe2, 0x95, 0x81, 0xe2, 0x95, 0x80, + 0xe2, 0x94, 0xbf, 0xe2, 0x94, 0xbe, 0xe2, 0x94, + 0xbd, 0xff, + 0xc5, 0xa2, 0xff, + 0xc5, 0xa3, 0xff, + 0xc5, 0xa4, 0xff, + 0xc5, 0xa5, 0xff, + 0xc5, 0xae, 0xff, + 0xc5, 0xaf, 0xff, + 0xc5, 0xb0, 0xff, + 0xc5, 0xb1, 0xff, + 0xe2, 0x95, 0xac, 0xff, + 0xc5, 0xb9, 0xff, + 0xc5, 0xba, 0xff, + 0xc5, 0xbb, 0xff, + 0xc5, 0xbc, 0xff, + 0xc5, 0xbd, 0xff, + 0xc5, 0xbe, 0xff, + 0xc8, 0x98, 0xff, + 0xc8, 0x99, 0xff, + 0xc8, 0x9a, 0xff, + 0xe2, 0x95, 0xaa, 0xff, + 0xe2, 0x94, 0x98, 0xe2, 0x94, 0x9b, 0xe2, + 0x94, 0x9a, 0xe2, 0x94, 0x99, 0xff, + 0xe2, 0x94, 0x8c, 0xe2, 0x94, 0x8f, 0xe2, + 0x94, 0x8e, 0xe2, 0x94, 0x8d, 0xff, + 0xe2, 0x96, 0x88, 0xff, + 0xc8, 0x9b, 0xff, + 0xcb, 0x87, 0xff, + 0xcb, 0x98, 0xff, + 0xcb, 0x99, 0xff, + 0xcb, 0x9b, 0xff, + 0xc3, 0x9f, 0xff, + 0xcb, 0x9d, 0xff, + 0xcf, 0x80, 0xff, + 0xe2, 0x80, 0x94, 0xe2, 0x80, 0x95, 0xff, + 0xe2, 0x80, 0x98, 0xff, + 0xc2, 0xb5, 0xce, 0xbc, 0xff, + 0xe2, 0x80, 0x99, 0xff, + 0xe2, 0x80, 0x9a, 0xff, + 0xe2, 0x80, 0x9c, 0xff, + 0xe2, 0x80, 0x9d, 0xff, + 0xe2, 0x80, 0x9e, 0xff, + 0xe2, 0x80, 0xa0, 0xff, + 0xe2, 0x80, 0xa1, 0xff, + 0xe2, 0x80, 0xa6, 0xff, + 0xe2, 0x80, 0xb0, 0xff, + 0xe2, 0x80, 0xb9, 0xff, + 0xc2, 0xb1, 0xff, + 0xe2, 0x89, 0xa5, 0xff, + 0xe2, 0x89, 0xa4, 0xff, + 0xe2, 0x80, 0xba, 0xff, + 0xe2, 0x82, 0xac, 0xff, + 0xc3, 0xb7, 0xff, + 0xe2, 0x89, 0x88, 0xff, + 0xc2, 0xb0, 0xff, + 0xe2, 0x84, 0xa2, 0xff, + 0xc2, 0xb7, 0xff, + 0xe2, 0x89, 0xa0, 0xff, + 0xe2, 0x84, 0x96, 0xff, + 0xc3, 0x80, 0xff, + 0xe2, 0x96, 0xa0, 0xe2, 0x96, 0xae, 0xff, + 0xc3, 0x88, 0xff, + diff --git a/unix/Makefile b/unix/Makefile index 7d2002315..88e1c30a7 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -162,6 +162,8 @@ SRC_C = \ ugfx_styles.c \ rom/tjpgd.c \ modugfx.c \ + modfreedomgfx.c \ + modfreedomgfx_sdl.c \ modnetwork.c \ modbadge.c \ ../../ugfx/drivers/multiple/SDL/gdisp_lld_SDL.c \ diff --git a/unix/modfreedomgfx.c b/unix/modfreedomgfx.c new file mode 120000 index 000000000..aaa14873d --- /dev/null +++ b/unix/modfreedomgfx.c @@ -0,0 +1 @@ +../esp32/modfreedomgfx.c \ No newline at end of file diff --git a/unix/modfreedomgfx.h b/unix/modfreedomgfx.h new file mode 120000 index 000000000..7f4fd1ff5 --- /dev/null +++ b/unix/modfreedomgfx.h @@ -0,0 +1 @@ +../esp32/modfreedomgfx.h \ No newline at end of file diff --git a/unix/modfreedomgfx_sdl.c b/unix/modfreedomgfx_sdl.c new file mode 100644 index 000000000..1b2c30049 --- /dev/null +++ b/unix/modfreedomgfx_sdl.c @@ -0,0 +1,94 @@ +/* + * This file is part of the SHA2017 Micro Python fork + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Christian Carlowitz + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "modfreedomgfx_sdl.h" +#include +#include +#include +#include + +SDL_Window* win; +SDL_Renderer* ren; +SDL_Texture* tex; + +void freedomgfxInit(void) +{ + SDL_Init(SDL_INIT_VIDEO); + win = SDL_CreateWindow("Freedom GFX", 100, 100, BADGE_EINK_WIDTH, BADGE_EINK_HEIGHT, SDL_WINDOW_SHOWN); + ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); + tex = SDL_CreateTexture(ren, SDL_PIXELFORMAT_RGB332, SDL_TEXTUREACCESS_STREAMING, BADGE_EINK_WIDTH, BADGE_EINK_HEIGHT); +} + +void freedomgfxDeinit(void) +{ + SDL_DestroyRenderer(ren); + SDL_DestroyWindow(win); + SDL_Quit(); +} + +uint32_t freedomgfxPoll(void) +{ + SDL_Event evt; + if(SDL_PollEvent(&evt)) + { + if(evt.type == SDL_KEYDOWN) + { + switch(evt.key.keysym.sym) + { + case 'a': + return BADGE_BUTTON_A; + case 'b': + return BADGE_BUTTON_B; + case 's': + return BADGE_BUTTON_START; + case 'S': + return BADGE_BUTTON_SELECT; + case SDLK_UP: + return BADGE_BUTTON_UP; + case SDLK_DOWN: + return BADGE_BUTTON_DOWN; + case SDLK_LEFT: + return BADGE_BUTTON_LEFT; + case SDLK_RIGHT: + return BADGE_BUTTON_RIGHT; + } + } + } + return 0; +} + +void freedomgfxDraw(uint8_t* img) +{ + uint8_t* px; + int pitch; + SDL_LockTexture(tex,0,(void**)&px,&pitch); + for(int i = 0; i < BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT; i++) + px[i] = (img[i/8] & (1<<(i%8)))?0xff:0x00; + SDL_UnlockTexture(tex); + SDL_RenderCopy(ren,tex,0,0); + SDL_RenderPresent(ren); +} + diff --git a/unix/modfreedomgfx_sdl.h b/unix/modfreedomgfx_sdl.h new file mode 100644 index 000000000..db1827eaf --- /dev/null +++ b/unix/modfreedomgfx_sdl.h @@ -0,0 +1,37 @@ +/* + * This file is part of the SHA2017 Micro Python fork + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Christian Carlowitz + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef UNIX_MODFREEDOMGFX_SDL_H_ +#define UNIX_MODFREEDOMGFX_SDL_H_ + +#include + +void freedomgfxInit(void); +void freedomgfxDeinit(void); +uint32_t freedomgfxPoll(void); +void freedomgfxDraw(uint8_t* img); + +#endif /* UNIX_MODFREEDOMGFX_SDL_H_ */ diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 03f6646f2..a18a16e50 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -179,6 +179,7 @@ extern const struct _mp_obj_module_t mp_module_jni; extern const struct _mp_obj_module_t mock_esp_network_module; extern const struct _mp_obj_module_t mock_badge_module; extern const struct _mp_obj_module_t ugfx_module; +extern const struct _mp_obj_module_t freedomgfx_module; #if MICROPY_PY_UOS_VFS #define MICROPY_PY_UOS_VFS_DEF { MP_ROM_QSTR(MP_QSTR_uos_vfs), MP_ROM_PTR(&mp_module_uos_vfs) }, @@ -227,6 +228,7 @@ extern const struct _mp_obj_module_t ugfx_module; MICROPY_PY_USELECT_DEF \ MICROPY_PY_TERMIOS_DEF \ { MP_OBJ_NEW_QSTR(MP_QSTR_ugfx), (mp_obj_t)&ugfx_module }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_freedomgfx), (mp_obj_t)&freedomgfx_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&mock_esp_network_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_badge), (mp_obj_t)&mock_badge_module }, \ From 301c8bd88c99154cbf27e3e08a5dcd8536a32d02 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 13:35:49 +0200 Subject: [PATCH 288/403] rewrite set_orientation to use the ugfx_screen_flip for rotations >= 180 degrees --- esp32/modugfx.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/esp32/modugfx.c b/esp32/modugfx.c index cf8a417ff..8f08c9687 100644 --- a/esp32/modugfx.c +++ b/esp32/modugfx.c @@ -62,6 +62,7 @@ uint8_t target_lut; typedef struct _ugfx_obj_t { mp_obj_base_t base; } ugfx_obj_t; +extern bool ugfx_screen_flipped; static orientation_t get_orientation(int a){ if (a == 90) return GDISP_ROTATE_90; @@ -146,11 +147,19 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(ugfx_get_lut_obj, ugfx_get_lut); STATIC mp_obj_t ugfx_set_orientation(mp_uint_t n_args, const mp_obj_t *args) { if (n_args > 0){ int a = mp_obj_get_int(args[0]); + a %= 360; + if (a >= 180) { + ugfx_screen_flipped = true; + a -= 180; + } gdispSetOrientation(get_orientation(a)); - } - return mp_obj_new_int(gdispGetOrientation()); + int a = gdispGetOrientation(); + if (ugfx_screen_flipped) + a += 180; + a %= 360; + return mp_obj_new_int(a); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ugfx_set_orientation_obj, 0, 1, ugfx_set_orientation); From 66338d951381fea7a01d3039365922522456667d Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 6 Aug 2017 00:04:09 +0200 Subject: [PATCH 289/403] add option to stay awake on usb; suppress debug logging --- esp32/modules/splash.py | 1 - esp32/modules/tasks/powermanagement.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 33ad47f62..729fe7dca 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -174,7 +174,6 @@ def onSleep(idleTime): easywifi.disable() gc.collect() -virtualtimers.debug(True) virtualtimers.activate(25) pm.callback(onSleep) pm.feed() diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index a230fc13d..2c22b61cb 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -16,9 +16,9 @@ def pm_task(): global requestedStandbyTime idleTime = virtualtimers.idle_time() - print("[Power management] Next task wants to run in "+str(idleTime)+" ms.") - - if idleTime>30000 and not badge.safe_mode(): + #print("[Power management] Next task wants to run in "+str(idleTime)+" ms.") + + if idleTime > 30000 and not badge.safe_mode() and not ( badge.usb_volt_sense() > 4500 and badge.nvs_get_u8('badge', 'usb_stay_awake', 0) != 0 ): global onSleepCallback if not onSleepCallback==None: print("[Power management] Running onSleepCallback...") From c90853290bc4a159d7b833d262bdc85a1e274acc Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 13:53:05 +0200 Subject: [PATCH 290/403] improved boolean logic; added powermanagement.usb_attached() --- esp32/modules/easydraw.py | 6 +++--- esp32/modules/splash.py | 6 +++--- esp32/modules/tasks/powermanagement.py | 5 ++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/esp32/modules/easydraw.py b/esp32/modules/easydraw.py index 8e159bff4..13917b2e8 100644 --- a/esp32/modules/easydraw.py +++ b/esp32/modules/easydraw.py @@ -39,15 +39,15 @@ def nickname(y = 25, font = "PermanentMarker36", color = ugfx.BLACK): nick = badge.nvs_get_str("owner", "name", 'Henk de Vries') ugfx.string_box(0,y,296,38, nick, font, color, ugfx.justifyCenter) -def battery(vUsb, vBatt, charging): +def battery(on_usb, vBatt, charging): vMin = badge.nvs_get_u16('batt', 'vmin', 3500) # mV vMax = badge.nvs_get_u16('batt', 'vmax', 4100) # mV - if charging and vUsb>4000: + if charging and on_usb: try: badge.eink_png(0,0,'/lib/resources/chrg.png') except: ugfx.string(0, 0, "CHRG",'Roboto_Regular12',ugfx.BLACK) - elif vUsb>4000: + elif on_usb: try: badge.eink_png(0,0,'/lib/resources/usb.png') except: diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 729fe7dca..f85067c2f 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -50,12 +50,12 @@ def disp_string_right(y, s): easydraw.nickname() - vUsb = badge.usb_volt_sense() + on_usb = pm.usb_attached() vBatt = badge.battery_volt_sense() vBatt += vDrop charging = badge.battery_charge_status() - easydraw.battery(vUsb, vBatt, charging) + easydraw.battery(on_usb, vBatt, charging) if vBatt>500: ugfx.string(52, 0, str(round(vBatt/1000, 1)) + 'v','Roboto_Regular12',ugfx.BLACK) @@ -123,7 +123,7 @@ def onSleep(idleTime): ### PROGRAM # Calibrate battery voltage drop -if badge.battery_charge_status() == False and badge.usb_volt_sense() > 4500 and badge.battery_volt_sense() > 2500: +if badge.battery_charge_status() == False and pm.usb_attached() and badge.battery_volt_sense() > 2500: badge.nvs_set_u16('splash', 'bat.volt.drop', 5200 - badge.battery_volt_sense()) # mV print('Set vDrop to: ' + str(4200 - badge.battery_volt_sense())) vDrop = badge.nvs_get_u16('splash', 'bat.volt.drop', 1000) - 1000 # mV diff --git a/esp32/modules/tasks/powermanagement.py b/esp32/modules/tasks/powermanagement.py index 2c22b61cb..a15548ac9 100644 --- a/esp32/modules/tasks/powermanagement.py +++ b/esp32/modules/tasks/powermanagement.py @@ -11,6 +11,9 @@ userResponseTime = badge.nvs_get_u16('splash', 'urt', 5000) +def usb_attached(): + return badge.usb_volt_sense() > 4500 + def pm_task(): ''' The power management task [internal function] ''' global requestedStandbyTime @@ -18,7 +21,7 @@ def pm_task(): idleTime = virtualtimers.idle_time() #print("[Power management] Next task wants to run in "+str(idleTime)+" ms.") - if idleTime > 30000 and not badge.safe_mode() and not ( badge.usb_volt_sense() > 4500 and badge.nvs_get_u8('badge', 'usb_stay_awake', 0) != 0 ): + if idleTime > 30000 and not badge.safe_mode() and not ( usb_attached() and badge.nvs_get_u8('badge', 'usb_stay_awake', 0) != 0 ): global onSleepCallback if not onSleepCallback==None: print("[Power management] Running onSleepCallback...") From a0756612f88bea132b76c81bab79199ef84a2f4a Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Mon, 7 Aug 2017 17:44:10 +0200 Subject: [PATCH 291/403] Introduce ugfx_screen_flipped in the emulator, too It's on the firmware in ./components/ugfx-glue/board_framebuffer.h since 301c8bd88c99154cbf27e3e08a5dcd8536a32d02 --- unix/modbadge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unix/modbadge.c b/unix/modbadge.c index d7fa25d7a..6d7d344bd 100644 --- a/unix/modbadge.c +++ b/unix/modbadge.c @@ -235,3 +235,5 @@ const mp_obj_module_t mock_badge_module = { .base = {&mp_type_module}, .globals = (mp_obj_dict_t *)&mock_badge_module_globals, }; + +bool ugfx_screen_flipped = false; From cd5b79caafde5ad7a6feb3f5ef0505396659c7dd Mon Sep 17 00:00:00 2001 From: Christian Carlowitz Date: Mon, 7 Aug 2017 18:37:11 +0200 Subject: [PATCH 292/403] removed unused header, use framebuffer for rendering in freedomgfx --- esp32/modfreedomgfx.c | 21 +++++++++++---------- esp32/modfreedomgfx.h | 37 ------------------------------------- esp32/modfreedomgfx_eink.c | 11 +++++++---- esp32/modfreedomgfx_eink.h | 4 ++-- unix/modfreedomgfx_sdl.c | 9 ++++++--- unix/modfreedomgfx_sdl.h | 4 ++-- 6 files changed, 28 insertions(+), 58 deletions(-) delete mode 100644 esp32/modfreedomgfx.h diff --git a/esp32/modfreedomgfx.c b/esp32/modfreedomgfx.c index 12b8e7b96..69c689200 100644 --- a/esp32/modfreedomgfx.c +++ b/esp32/modfreedomgfx.c @@ -37,36 +37,38 @@ #include #include -#include "modfreedomgfx.h" - #include #include #include + #include "py/mperrno.h" #include "py/mphal.h" #include "py/runtime.h" +#include "py/nlr.h" +#include "py/runtime.h" + #ifdef UNIX #include "modfreedomgfx_sdl.h" #else #include "modfreedomgfx_eink.h" #endif -#define imgSize ((BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT)/8) -uint8_t img[imgSize]; +#define imgSize (BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT) +static uint8_t* img = 0; -#define PXb(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)/8] &= ~(1<<(((x)+(y)*BADGE_EINK_WIDTH)%8)) -#define PXw(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)/8] |= (1<<(((x)+(y)*BADGE_EINK_WIDTH)%8)) +#define PXb(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)] = 0x00 +#define PXw(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)] = 0xff #define ABS(x) (((x)<0)?-(x):(x)) static void gfx_input_poll(uint32_t btn); STATIC mp_obj_t gfx_init(void) { + img = freedomgfxInit(); for(int i = 0; i < imgSize; i++) img[i] = 0xff; - freedomgfxInit(); - freedomgfxDraw(img); + freedomgfxDraw(); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(gfx_init_obj, gfx_init); @@ -129,7 +131,6 @@ STATIC mp_obj_t gfx_area(mp_uint_t n_args, const mp_obj_t *args) { int b = mp_obj_get_int(args[3]); int col = mp_obj_get_int(args[4]); - printf("x0=%d,y0=%d\n", x0, y0); for(int i = 0; i < a; i++) { for(int j = 0; j < b; j++) @@ -195,7 +196,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_string_obj, 5, 5, gfx_string); STATIC mp_obj_t gfx_flush(mp_uint_t n_args, const mp_obj_t *args) { - freedomgfxDraw(img); + freedomgfxDraw(); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_flush_obj, 0, 1, gfx_flush); diff --git a/esp32/modfreedomgfx.h b/esp32/modfreedomgfx.h deleted file mode 100644 index ab0efb75e..000000000 --- a/esp32/modfreedomgfx.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2017 Christian Carlowitz - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/mperrno.h" -#include "py/mphal.h" -#include "py/runtime.h" - -#include "py/nlr.h" -#include "py/runtime.h" - - - -extern const mp_obj_type_t ugfx_type; diff --git a/esp32/modfreedomgfx_eink.c b/esp32/modfreedomgfx_eink.c index f712f37fe..027d7ccb7 100644 --- a/esp32/modfreedomgfx_eink.c +++ b/esp32/modfreedomgfx_eink.c @@ -26,10 +26,13 @@ #include "modfreedomgfx_eink.h" #include +#include -void freedomgfxInit(void) + +uint8_t* freedomgfxInit(void) { - // + badge_eink_fb_init(); + return badge_eink_fb; } void freedomgfxDeinit(void) @@ -43,7 +46,7 @@ uint32_t freedomgfxPoll(void) return btn; } -void freedomgfxDraw(uint8_t* img) +void freedomgfxDraw() { - badge_eink_display(img, DISPLAY_FLAG_FULL_UPDATE); + badge_eink_display(badge_eink_fb, DISPLAY_FLAG_FULL_UPDATE | DISPLAY_FLAG_8BITPIXEL); } diff --git a/esp32/modfreedomgfx_eink.h b/esp32/modfreedomgfx_eink.h index db1827eaf..4ef8e8be6 100644 --- a/esp32/modfreedomgfx_eink.h +++ b/esp32/modfreedomgfx_eink.h @@ -29,9 +29,9 @@ #include -void freedomgfxInit(void); +uint8_t* freedomgfxInit(void); // returns buffer to draw to void freedomgfxDeinit(void); uint32_t freedomgfxPoll(void); -void freedomgfxDraw(uint8_t* img); +void freedomgfxDraw(); #endif /* UNIX_MODFREEDOMGFX_SDL_H_ */ diff --git a/unix/modfreedomgfx_sdl.c b/unix/modfreedomgfx_sdl.c index 1b2c30049..464027397 100644 --- a/unix/modfreedomgfx_sdl.c +++ b/unix/modfreedomgfx_sdl.c @@ -34,12 +34,15 @@ SDL_Window* win; SDL_Renderer* ren; SDL_Texture* tex; -void freedomgfxInit(void) +static uint8_t img[BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT]; + +uint8_t* freedomgfxInit(void) { SDL_Init(SDL_INIT_VIDEO); win = SDL_CreateWindow("Freedom GFX", 100, 100, BADGE_EINK_WIDTH, BADGE_EINK_HEIGHT, SDL_WINDOW_SHOWN); ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); tex = SDL_CreateTexture(ren, SDL_PIXELFORMAT_RGB332, SDL_TEXTUREACCESS_STREAMING, BADGE_EINK_WIDTH, BADGE_EINK_HEIGHT); + return img; } void freedomgfxDeinit(void) @@ -80,13 +83,13 @@ uint32_t freedomgfxPoll(void) return 0; } -void freedomgfxDraw(uint8_t* img) +void freedomgfxDraw() { uint8_t* px; int pitch; SDL_LockTexture(tex,0,(void**)&px,&pitch); for(int i = 0; i < BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT; i++) - px[i] = (img[i/8] & (1<<(i%8)))?0xff:0x00; + px[i] = img[i]; SDL_UnlockTexture(tex); SDL_RenderCopy(ren,tex,0,0); SDL_RenderPresent(ren); diff --git a/unix/modfreedomgfx_sdl.h b/unix/modfreedomgfx_sdl.h index db1827eaf..fb793c050 100644 --- a/unix/modfreedomgfx_sdl.h +++ b/unix/modfreedomgfx_sdl.h @@ -29,9 +29,9 @@ #include -void freedomgfxInit(void); +uint8_t* freedomgfxInit(void); void freedomgfxDeinit(void); uint32_t freedomgfxPoll(void); -void freedomgfxDraw(uint8_t* img); +void freedomgfxDraw(); #endif /* UNIX_MODFREEDOMGFX_SDL_H_ */ From 32f2030885975543fceb5085e4be5e3df90ec3a3 Mon Sep 17 00:00:00 2001 From: Christian Carlowitz Date: Mon, 7 Aug 2017 19:30:55 +0200 Subject: [PATCH 293/403] multiple small code quality improvements in freedomgfx --- esp32/modfreedomgfx.c | 38 ++++++++++++++------------------------ esp32/modfreedomgfx_eink.c | 9 ++++++++- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/esp32/modfreedomgfx.c b/esp32/modfreedomgfx.c index 69c689200..dbbcf3ce1 100644 --- a/esp32/modfreedomgfx.c +++ b/esp32/modfreedomgfx.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -58,16 +59,14 @@ #define imgSize (BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT) static uint8_t* img = 0; -#define PXb(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)] = 0x00 -#define PXw(x,y) img[((x)+(y)*BADGE_EINK_WIDTH)] = 0xff +#define PX(x,y,v) img[((x)+(y)*BADGE_EINK_WIDTH)] = (v) #define ABS(x) (((x)<0)?-(x):(x)) static void gfx_input_poll(uint32_t btn); STATIC mp_obj_t gfx_init(void) { img = freedomgfxInit(); - for(int i = 0; i < imgSize; i++) - img[i] = 0xff; + memset(img, 0xff, imgSize); freedomgfxDraw(); return mp_const_none; } @@ -93,7 +92,7 @@ STATIC mp_obj_t gfx_line(mp_uint_t n_args, const mp_obj_t *args) { int y1 = mp_obj_get_int(args[3]); int col = mp_obj_get_int(args[4]); - PXb(x0,y0); + PX(x0,y0,col); // algorithm: https://de.wikipedia.org/wiki/Bresenham-Algorithmus int dx = ABS(x1-x0); @@ -104,7 +103,7 @@ STATIC mp_obj_t gfx_line(mp_uint_t n_args, const mp_obj_t *args) { int err2; while(1){ - if(col == 0) PXb(x0,y0); else PXw(x0,y0); + PX(x0,y0,col); if ((x0 == x1) && (y0 == y1)) break; err2 = 2*err; @@ -134,12 +133,7 @@ STATIC mp_obj_t gfx_area(mp_uint_t n_args, const mp_obj_t *args) { for(int i = 0; i < a; i++) { for(int j = 0; j < b; j++) - { - if(col == 0) - PXb(x0+i,y0+j); - else - PXw(x0+i,y0+j); - } + PX(x0+i,y0+j,col); } return mp_const_none; @@ -171,12 +165,7 @@ STATIC mp_obj_t gfx_string(mp_uint_t n_args, const mp_obj_t *args) { for(int j = 0; j < cwidth; j++) // TODO: only works for single byte rows { if( font[4*8+(int)(*data)*clen+i] & (1<<(7-j))) - { - if(col == 0) - PXb(x0+j+xoffs,y0+i); - else - PXw(x0+j+xoffs,y0+i); - } + PX(x0+j+xoffs,y0+i,col); } } data++; @@ -204,7 +193,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_flush_obj, 0, 1, gfx_flush); // callback system -STATIC uint8_t button_init_done = 0; +STATIC bool button_init_done = false; STATIC mp_obj_t button_callbacks[1+BADGE_BUTTONS]; static void gfx_input_poll(uint32_t btn) @@ -220,14 +209,15 @@ STATIC mp_obj_t gfx_input_init(mp_uint_t n_args, const mp_obj_t *args) { for(size_t i = 0; i <= BADGE_BUTTONS; i++){ button_callbacks[i] = mp_const_none; } - button_init_done = 1; + button_init_done = true; return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_input_init_obj, 0, 1, gfx_input_init); STATIC mp_obj_t gfx_input_attach(mp_uint_t n_args, const mp_obj_t *args) { - uint8_t button = mp_obj_get_int(args[0]); - button_callbacks[button] = args[1]; + int button = mp_obj_get_int(args[0]); + if(button > 0 && button <= BADGE_BUTTONS) + button_callbacks[button] = args[1]; return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_input_attach_obj, 2, 2, gfx_input_attach); @@ -250,8 +240,8 @@ STATIC const mp_rom_map_elem_t freedomgfx_module_globals_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_input_init), (mp_obj_t)&gfx_input_init_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_input_attach), (mp_obj_t)&gfx_input_attach_obj}, - {MP_OBJ_NEW_QSTR(MP_QSTR_BLACK), MP_OBJ_NEW_SMALL_INT(0)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_WHITE), MP_OBJ_NEW_SMALL_INT(1)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BLACK), MP_OBJ_NEW_SMALL_INT(0x00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_WHITE), MP_OBJ_NEW_SMALL_INT(0xff)}, {MP_OBJ_NEW_QSTR(MP_QSTR_JOY_UP), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_UP)}, {MP_OBJ_NEW_QSTR(MP_QSTR_JOY_DOWN), MP_OBJ_NEW_SMALL_INT(BADGE_BUTTON_DOWN)}, diff --git a/esp32/modfreedomgfx_eink.c b/esp32/modfreedomgfx_eink.c index 027d7ccb7..0d9fcbcca 100644 --- a/esp32/modfreedomgfx_eink.c +++ b/esp32/modfreedomgfx_eink.c @@ -24,10 +24,14 @@ * THE SOFTWARE. */ +#include + #include "modfreedomgfx_eink.h" #include #include +#include +extern bool ugfx_screen_flipped; uint8_t* freedomgfxInit(void) { @@ -48,5 +52,8 @@ uint32_t freedomgfxPoll(void) void freedomgfxDraw() { - badge_eink_display(badge_eink_fb, DISPLAY_FLAG_FULL_UPDATE | DISPLAY_FLAG_8BITPIXEL); + badge_eink_flags_t flags = DISPLAY_FLAG_FULL_UPDATE | DISPLAY_FLAG_8BITPIXEL; + if(ugfx_screen_flipped) + flags |= DISPLAY_FLAG_ROTATE_180; + badge_eink_display(badge_eink_fb, flags); } From 642d9fd2a57af682d1c176087a1a2c9ca3469dcb Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 7 Aug 2017 21:36:57 +0300 Subject: [PATCH 294/403] zephyr/modusocket: Allow to use socketized net_context in upstream. Accesses recv_q, accept_q directly in net_context. --- zephyr/modusocket.c | 28 ++++++++++++++++++---------- zephyr/prj_base.conf | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index cec0eec7c..ebd516fa2 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -48,10 +48,12 @@ typedef struct _socket_obj_t { mp_obj_base_t base; struct net_context *ctx; + #ifndef CONFIG_NET_SOCKETS union { struct k_fifo recv_q; struct k_fifo accept_q; }; + #endif #define STATE_NEW 0 #define STATE_CONNECTING 1 @@ -62,6 +64,12 @@ typedef struct _socket_obj_t { STATIC const mp_obj_type_t socket_type; +#ifdef CONFIG_NET_SOCKETS +#define SOCK_FIELD(ptr, field) ((ptr)->ctx->field) +#else +#define SOCK_FIELD(ptr, field) ((ptr)->field) +#endif + // k_fifo extended API static inline void *_k_fifo_peek_head(struct k_fifo *fifo) @@ -171,10 +179,10 @@ static void sock_received_cb(struct net_context *context, struct net_pkt *pkt, i // if net_buf == NULL, EOF if (pkt == NULL) { - struct net_pkt *last_pkt = _k_fifo_peek_tail(&socket->recv_q); + struct net_pkt *last_pkt = _k_fifo_peek_tail(&SOCK_FIELD(socket, recv_q)); if (last_pkt == NULL) { socket->state = STATE_PEER_CLOSED; - k_fifo_cancel_wait(&socket->recv_q); + k_fifo_cancel_wait(&SOCK_FIELD(socket, recv_q)); DEBUG_printf("Marked socket %p as peer-closed\n", socket); } else { // We abuse "buf_sent" flag to store EOF flag @@ -191,7 +199,7 @@ static void sock_received_cb(struct net_context *context, struct net_pkt *pkt, i unsigned header_len = net_pkt_appdata(pkt) - pkt->frags->data; net_buf_pull(pkt->frags, header_len); - k_fifo_put(&socket->recv_q, pkt); + k_fifo_put(&SOCK_FIELD(socket, recv_q), pkt); } // Callback for incoming connections. @@ -200,13 +208,12 @@ static void sock_accepted_cb(struct net_context *new_ctx, struct sockaddr *addr, DEBUG_printf("accept cb: context: %p, status: %d, new ctx: %p\n", socket->ctx, status, new_ctx); DEBUG_printf("new_ctx ref_cnt: %d\n", new_ctx->refcount); - k_fifo_put(&socket->accept_q, new_ctx); + k_fifo_put(&SOCK_FIELD(socket, accept_q), new_ctx); } socket_obj_t *socket_new(void) { socket_obj_t *socket = m_new_obj_with_finaliser(socket_obj_t); socket->base.type = (mp_obj_t)&socket_type; - k_fifo_init(&socket->recv_q); socket->state = STATE_NEW; return socket; } @@ -250,6 +257,7 @@ STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t } RAISE_ERRNO(net_context_get(family, socktype, proto, &socket->ctx)); + k_fifo_init(&SOCK_FIELD(socket, recv_q)); return MP_OBJ_FROM_PTR(socket); } @@ -302,7 +310,7 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { socket_obj_t *socket = self_in; socket_check_closed(socket); - struct net_context *ctx = k_fifo_get(&socket->accept_q, K_FOREVER); + struct net_context *ctx = k_fifo_get(&SOCK_FIELD(socket, accept_q), K_FOREVER); // Was overwritten by fifo ctx->refcount = 1; @@ -375,7 +383,7 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * if (sock_type == SOCK_DGRAM) { - struct net_pkt *pkt = k_fifo_get(&socket->recv_q, K_FOREVER); + struct net_pkt *pkt = k_fifo_get(&SOCK_FIELD(socket, recv_q), K_FOREVER); recv_len = net_pkt_appdatalen(pkt); DEBUG_printf("recv: pkt=%p, appdatalen: %d\n", pkt, recv_len); @@ -395,8 +403,8 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * return 0; } - _k_fifo_wait_non_empty(&socket->recv_q, K_FOREVER); - struct net_pkt *pkt = _k_fifo_peek_head(&socket->recv_q); + _k_fifo_wait_non_empty(&SOCK_FIELD(socket, recv_q), K_FOREVER); + struct net_pkt *pkt = _k_fifo_peek_head(&SOCK_FIELD(socket, recv_q)); if (pkt == NULL) { DEBUG_printf("TCP recv: NULL return from fifo\n"); continue; @@ -426,7 +434,7 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * if (frag == NULL) { DEBUG_printf("Finished processing pkt %p\n", pkt); // Drop head packet from queue - k_fifo_get(&socket->recv_q, K_NO_WAIT); + k_fifo_get(&SOCK_FIELD(socket, recv_q), K_NO_WAIT); // If "sent" flag was set, it's last packet and we reached EOF if (net_pkt_sent(pkt)) { diff --git a/zephyr/prj_base.conf b/zephyr/prj_base.conf index 4346f20bf..50b195b2f 100644 --- a/zephyr/prj_base.conf +++ b/zephyr/prj_base.conf @@ -14,6 +14,7 @@ CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y CONFIG_NET_UDP=y CONFIG_NET_TCP=y +CONFIG_NET_SOCKETS=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_NBUF_RX_COUNT=5 From 6c55cdafa32e4db9e2aaf08b1ec597b4723721ea Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 7 Aug 2017 21:41:03 +0300 Subject: [PATCH 295/403] zephyr/modusocket: socket, close: Switch to native Zephyr socket calls. --- zephyr/modusocket.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index ebd516fa2..ff82ab67c 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -37,6 +37,9 @@ #include #include #include +#ifdef CONFIG_NET_SOCKETS +#include +#endif #define DEBUG_PRINT 0 #if DEBUG_PRINT // print debugging info @@ -103,6 +106,7 @@ static inline void _k_fifo_wait_non_empty(struct k_fifo *fifo, int32_t timeout) // Helper functions #define RAISE_ERRNO(x) { int _err = x; if (_err < 0) mp_raise_OSError(-_err); } +#define RAISE_SOCK_ERRNO(x) { if ((int)(x) == -1) mp_raise_OSError(errno); } STATIC void socket_check_closed(socket_obj_t *socket) { if (socket->ctx == NULL) { @@ -256,8 +260,13 @@ STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t } } + #ifdef CONFIG_NET_SOCKETS + socket->ctx = (void*)zsock_socket(family, socktype, proto); + RAISE_SOCK_ERRNO(socket->ctx); + #else RAISE_ERRNO(net_context_get(family, socktype, proto, &socket->ctx)); k_fifo_init(&SOCK_FIELD(socket, recv_q)); + #endif return MP_OBJ_FROM_PTR(socket); } @@ -491,9 +500,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_makefile_obj, 1, 3, socket_mak STATIC mp_obj_t socket_close(mp_obj_t self_in) { socket_obj_t *socket = self_in; - if (socket->ctx != NULL) { - RAISE_ERRNO(net_context_put(socket->ctx)); - socket->ctx = NULL; + if (socket->ctx != -1) { + int res = zsock_close(socket->ctx); + RAISE_SOCK_ERRNO(res); + socket->ctx = -1; } return mp_const_none; } From fa5965c07afc012570f8b8cce34803e449dc8adc Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 20:51:49 +0200 Subject: [PATCH 296/403] allow chdir to mountpoints ('/', '/sdcard' and '/bpp') --- extmod/vfs_native.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/extmod/vfs_native.c b/extmod/vfs_native.c index 781dfa2f1..a8dddd98f 100644 --- a/extmod/vfs_native.c +++ b/extmod/vfs_native.c @@ -33,6 +33,21 @@ int chdir(const char *path) { struct stat buf; + + // root mount-point is special-case. + if (strcmp(path, "/") == 0) { + cwd[0] = 0; + ESP_LOGD(TAG, "cwd set to '/'"); + return 0; + } + + // other mount-points are special as well. + if (strcmp(path, "/sdcard") == 0 || strcmp(path, "/bpp") == 0) { + strncpy(cwd, path, sizeof(cwd)); + ESP_LOGD(TAG, "cwd set to '%s'", cwd); + return 0; + } + int res = stat(path, &buf); if (res < 0) { return -1; From c55b587667887732f7b64b6dcf3a8c806c1c85c0 Mon Sep 17 00:00:00 2001 From: Gavan Date: Mon, 7 Aug 2017 19:54:34 +0100 Subject: [PATCH 297/403] Return the number of ms, not seconds. --- esp32/modules/tasks/badgeeventreminder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/tasks/badgeeventreminder.py b/esp32/modules/tasks/badgeeventreminder.py index 67bf498e9..dab3dbfd2 100644 --- a/esp32/modules/tasks/badgeeventreminder.py +++ b/esp32/modules/tasks/badgeeventreminder.py @@ -19,7 +19,7 @@ def ber_task(): idleFor = whenToTrigger - now if idleFor<0: idleFor = 0 - return idleFor + return idleFor * 1000 def enable(): if badge.nvs_get_u8('badge','evrt',0)==0: From 34bf9ca26c1cd6e44159c584f8aaecc931602791 Mon Sep 17 00:00:00 2001 From: Christian Carlowitz Date: Mon, 7 Aug 2017 21:10:06 +0200 Subject: [PATCH 298/403] added range check to PX macro in freedomgfx module --- esp32/modfreedomgfx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esp32/modfreedomgfx.c b/esp32/modfreedomgfx.c index dbbcf3ce1..11cb5d6f3 100644 --- a/esp32/modfreedomgfx.c +++ b/esp32/modfreedomgfx.c @@ -59,7 +59,10 @@ #define imgSize (BADGE_EINK_WIDTH*BADGE_EINK_HEIGHT) static uint8_t* img = 0; -#define PX(x,y,v) img[((x)+(y)*BADGE_EINK_WIDTH)] = (v) +#define PX(x,y,v) \ + if( x>=0 && y>=0 && x < BADGE_EINK_WIDTH && y < BADGE_EINK_HEIGHT) \ + img[((x)+(y)*BADGE_EINK_WIDTH)] = (v) + #define ABS(x) (((x)<0)?-(x):(x)) static void gfx_input_poll(uint32_t btn); From 34756cbcf8e3c8de054bd0ef40d6b604d58116dd Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 21:19:14 +0200 Subject: [PATCH 299/403] do not warn when event already ended --- esp32/modules/tasks/badgeeventreminder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/tasks/badgeeventreminder.py b/esp32/modules/tasks/badgeeventreminder.py index dab3dbfd2..d52a2864b 100644 --- a/esp32/modules/tasks/badgeeventreminder.py +++ b/esp32/modules/tasks/badgeeventreminder.py @@ -12,12 +12,12 @@ def ber_task(): global whenToTrigger now = time.time() - if now>=whenToTrigger: + if now >= whenToTrigger and now < whenToTrigger + 600 + 3600: badge.nvs_set_u8('badge','evrt',1) print("BADGE EVENT REMINDER ACTIVATED") appglue.start_app("badge_event_reminder") idleFor = whenToTrigger - now - if idleFor<0: + if idleFor < 0: idleFor = 0 return idleFor * 1000 From 324d36d33989e5b3290473e4d5ebe5e9b6ab2326 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 21:40:43 +0200 Subject: [PATCH 300/403] work around time.time() brokenness --- esp32/modules/tasks/badgeeventreminder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esp32/modules/tasks/badgeeventreminder.py b/esp32/modules/tasks/badgeeventreminder.py index d52a2864b..70cd4b927 100644 --- a/esp32/modules/tasks/badgeeventreminder.py +++ b/esp32/modules/tasks/badgeeventreminder.py @@ -7,11 +7,14 @@ import virtualtimers, time, appglue, badge # Tue Aug 8 13:30:00 2017 (CEST) +# (warn 10 minutes before the event) whenToTrigger = 1502191800 - 600 def ber_task(): global whenToTrigger - now = time.time() + # braindead time.time() implementation. it's 2 hours in the + # future. + now = time.time() - 7200 if now >= whenToTrigger and now < whenToTrigger + 600 + 3600: badge.nvs_set_u8('badge','evrt',1) print("BADGE EVENT REMINDER ACTIVATED") From 6756a75ba07d5dcf1e69d5cd70f491950b5561f1 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Mon, 7 Aug 2017 22:05:53 +0200 Subject: [PATCH 301/403] update version --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index d3dfe265f..dae04cf08 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 9 -name = "Sinistere Site" +build = 10 +name = "Blinkende Boemerang" From 600f5afed3a1a576d9bce5e0c75009fa06f0dad7 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 8 Aug 2017 12:31:59 +0300 Subject: [PATCH 302/403] zephyr/modusocket: bind, connect, listen, accept: Swtich to native sockets. --- zephyr/modusocket.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index ff82ab67c..080e6b275 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -278,7 +278,9 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { struct sockaddr sockaddr; parse_inet_addr(socket, addr_in, &sockaddr); - RAISE_ERRNO(net_context_bind(socket->ctx, &sockaddr, sizeof(sockaddr))); + int res = zsock_bind(socket->ctx, &sockaddr, sizeof(sockaddr)); + RAISE_SOCK_ERRNO(res); + // For DGRAM socket, we expect to receive packets after call to bind(), // but for STREAM socket, next expected operation is listen(), which // doesn't work if recv callback is set. @@ -297,7 +299,9 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { struct sockaddr sockaddr; parse_inet_addr(socket, addr_in, &sockaddr); - RAISE_ERRNO(net_context_connect(socket->ctx, &sockaddr, sizeof(sockaddr), NULL, K_FOREVER, NULL)); + int res = zsock_connect(socket->ctx, &sockaddr, sizeof(sockaddr)); + RAISE_SOCK_ERRNO(res); + DEBUG_printf("Setting recv cb after connect()\n"); RAISE_ERRNO(net_context_recv(socket->ctx, sock_received_cb, K_NO_WAIT, socket)); return mp_const_none; @@ -309,8 +313,9 @@ STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog_in) { socket_check_closed(socket); mp_int_t backlog = mp_obj_get_int(backlog_in); - RAISE_ERRNO(net_context_listen(socket->ctx, backlog)); - RAISE_ERRNO(net_context_accept(socket->ctx, sock_accepted_cb, K_NO_WAIT, socket)); + int res = zsock_listen(socket->ctx, backlog); + RAISE_SOCK_ERRNO(res); + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); @@ -319,9 +324,9 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { socket_obj_t *socket = self_in; socket_check_closed(socket); - struct net_context *ctx = k_fifo_get(&SOCK_FIELD(socket, accept_q), K_FOREVER); - // Was overwritten by fifo - ctx->refcount = 1; + struct sockaddr sockaddr; + socklen_t addrlen = sizeof(sockaddr); + void *ctx = zsock_accept(socket->ctx, &sockaddr, &addrlen); socket_obj_t *socket2 = socket_new(); socket2->ctx = ctx; From 675ceb2dd9b66285b22c5e6a2a2d1a95036c3882 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 9 Aug 2017 10:17:15 +0300 Subject: [PATCH 303/403] zephyr/modusocket: send: Switch to native sockets. --- zephyr/modusocket.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index 080e6b275..bcf2caee7 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -344,28 +344,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); STATIC mp_uint_t sock_write(mp_obj_t self_in, const void *buf, mp_uint_t size, int *errcode) { socket_obj_t *socket = self_in; - if (socket->ctx == NULL) { + if (socket->ctx == -1) { // already closed *errcode = EBADF; return MP_STREAM_ERROR; } - struct net_pkt *send_pkt = net_pkt_get_tx(socket->ctx, K_FOREVER); - - unsigned len = net_if_get_mtu(net_context_get_iface(socket->ctx)); - // Arbitrary value to account for protocol headers - len -= 64; - if (len > size) { - len = size; - } - - // TODO: Return value of 0 is a hard case (as we wait forever, should - // not happen). - len = net_pkt_append(send_pkt, len, buf, K_FOREVER); - - int err = net_context_send(send_pkt, /*cb*/NULL, K_FOREVER, NULL, NULL); - if (err < 0) { - *errcode = -err; + ssize_t len = zsock_send(socket->ctx, buf, size, 0); + if (len == -1) { + *errcode = errno; return MP_STREAM_ERROR; } From cb7ecda9f0a1eac1d0b2a3148f5af592c5aa6211 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 9 Aug 2017 10:22:41 +0300 Subject: [PATCH 304/403] zephyr/modusocket: recv: Switch to native sockets. --- zephyr/modusocket.c | 73 +++------------------------------------------ 1 file changed, 4 insertions(+), 69 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index bcf2caee7..7dc44c79c 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -379,75 +379,10 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * return MP_STREAM_ERROR; } - enum net_sock_type sock_type = net_context_get_type(socket->ctx); - unsigned recv_len; - - if (sock_type == SOCK_DGRAM) { - - struct net_pkt *pkt = k_fifo_get(&SOCK_FIELD(socket, recv_q), K_FOREVER); - - recv_len = net_pkt_appdatalen(pkt); - DEBUG_printf("recv: pkt=%p, appdatalen: %d\n", pkt, recv_len); - - if (recv_len > max_len) { - recv_len = max_len; - } - - net_pkt_gather(pkt, buf, recv_len); - net_pkt_unref(pkt); - - } else if (sock_type == SOCK_STREAM) { - - do { - - if (socket->state == STATE_PEER_CLOSED) { - return 0; - } - - _k_fifo_wait_non_empty(&SOCK_FIELD(socket, recv_q), K_FOREVER); - struct net_pkt *pkt = _k_fifo_peek_head(&SOCK_FIELD(socket, recv_q)); - if (pkt == NULL) { - DEBUG_printf("TCP recv: NULL return from fifo\n"); - continue; - } - - DEBUG_printf("TCP recv: cur_pkt: %p\n", pkt); - - struct net_buf *frag = pkt->frags; - if (frag == NULL) { - printf("net_pkt has empty fragments on start!\n"); - assert(0); - } - - unsigned frag_len = frag->len; - recv_len = frag_len; - if (recv_len > max_len) { - recv_len = max_len; - } - DEBUG_printf("%d data bytes in head frag, going to read %d\n", frag_len, recv_len); - - memcpy(buf, frag->data, recv_len); - - if (recv_len != frag_len) { - net_buf_pull(frag, recv_len); - } else { - frag = net_pkt_frag_del(pkt, NULL, frag); - if (frag == NULL) { - DEBUG_printf("Finished processing pkt %p\n", pkt); - // Drop head packet from queue - k_fifo_get(&SOCK_FIELD(socket, recv_q), K_NO_WAIT); - - // If "sent" flag was set, it's last packet and we reached EOF - if (net_pkt_sent(pkt)) { - socket->state = STATE_PEER_CLOSED; - } - net_pkt_unref(pkt); - } - } - // Keep repeating while we're getting empty fragments - // Zephyr IP stack appears to have fed empty net_buf's with empty - // frags for various TCP control packets - in previous versions. - } while (recv_len == 0); + ssize_t recv_len = zsock_recv(socket->ctx, buf, max_len, 0); + if (recv_len == -1) { + *errcode = errno; + return MP_STREAM_ERROR; } return recv_len; From eb2784e8a2dc17b0f551b68d2b41eece3e5348a7 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 9 Aug 2017 21:20:42 +1000 Subject: [PATCH 305/403] py/objtuple: Allow to use inplace-multiplication operator on tuples. --- py/objtuple.c | 3 ++- tests/basics/tuple_mult.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/py/objtuple.c b/py/objtuple.c index 0b05755fb..cbe645494 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -148,7 +148,8 @@ mp_obj_t mp_obj_tuple_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) { mp_seq_cat(s->items, o->items, o->len, p->items, p->len, mp_obj_t); return MP_OBJ_FROM_PTR(s); } - case MP_BINARY_OP_MULTIPLY: { + case MP_BINARY_OP_MULTIPLY: + case MP_BINARY_OP_INPLACE_MULTIPLY: { mp_int_t n; if (!mp_obj_get_int_maybe(rhs, &n)) { return MP_OBJ_NULL; // op not supported diff --git a/tests/basics/tuple_mult.py b/tests/basics/tuple_mult.py index b128b2968..cac95185a 100644 --- a/tests/basics/tuple_mult.py +++ b/tests/basics/tuple_mult.py @@ -11,6 +11,11 @@ c = a * 3 print(a, c) +# inplace multiplication +a = (1, 2) +a *= 2 +print(a) + # unsupported type on RHS try: () * None From 3d25d9c7d96f9a54ad510391901af8f5bd82b306 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 9 Aug 2017 21:25:48 +1000 Subject: [PATCH 306/403] py/objstr: Raise an exception for wrong type on RHS of str binary op. The main case to catch is invalid types for the containment operator, of the form str.__contains__(non-str). --- py/objstr.c | 5 +++-- tests/basics/containment.py | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/py/objstr.c b/py/objstr.c index ddad7d3bd..cc3dda59e 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -347,8 +347,9 @@ mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { rhs_data = bufinfo.buf; rhs_len = bufinfo.len; } else { - // incompatible types - return MP_OBJ_NULL; // op not supported + // LHS is str and RHS has an incompatible type + // (except if operation is EQUAL, but that's handled by mp_obj_equal) + bad_implicit_conversion(rhs_in); } switch (op) { diff --git a/tests/basics/containment.py b/tests/basics/containment.py index bae366113..4c94a9bae 100644 --- a/tests/basics/containment.py +++ b/tests/basics/containment.py @@ -16,6 +16,17 @@ print(haystack, "in", needle, "::", haystack in needle) print(haystack, "not in", needle, "::", haystack not in needle) +# containment of bytes/ints in bytes +print(b'' in b'123') +print(b'0' in b'123', b'1' in b'123') +print(48 in b'123', 49 in b'123') + +# containment of int in str is an error +try: + 1 in '123' +except TypeError: + print('TypeError') + # until here, the tests would work without the 'second attempt' iteration thing. for i in 1, 2: From 63edc2e78b5ed77455caee20989fe708a45a9cb5 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 9 Aug 2017 13:19:22 +0300 Subject: [PATCH 307/403] zephyr/modusocket: Fully switch to native Zephyr sockets. --- zephyr/modusocket.c | 142 +++----------------------------------------- 1 file changed, 8 insertions(+), 134 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index 7dc44c79c..f8d668a70 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -50,13 +50,7 @@ typedef struct _socket_obj_t { mp_obj_base_t base; - struct net_context *ctx; - #ifndef CONFIG_NET_SOCKETS - union { - struct k_fifo recv_q; - struct k_fifo accept_q; - }; - #endif + int ctx; #define STATE_NEW 0 #define STATE_CONNECTING 1 @@ -67,49 +61,13 @@ typedef struct _socket_obj_t { STATIC const mp_obj_type_t socket_type; -#ifdef CONFIG_NET_SOCKETS -#define SOCK_FIELD(ptr, field) ((ptr)->ctx->field) -#else -#define SOCK_FIELD(ptr, field) ((ptr)->field) -#endif - -// k_fifo extended API - -static inline void *_k_fifo_peek_head(struct k_fifo *fifo) -{ -#if KERNEL_VERSION_NUMBER < 0x010763 /* 1.7.99 */ - return sys_slist_peek_head(&fifo->data_q); -#else - return sys_slist_peek_head(&fifo->_queue.data_q); -#endif -} - -static inline void *_k_fifo_peek_tail(struct k_fifo *fifo) -{ -#if KERNEL_VERSION_NUMBER < 0x010763 /* 1.7.99 */ - return sys_slist_peek_tail(&fifo->data_q); -#else - return sys_slist_peek_tail(&fifo->_queue.data_q); -#endif -} - -static inline void _k_fifo_wait_non_empty(struct k_fifo *fifo, int32_t timeout) -{ - struct k_poll_event events[] = { - K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_FIFO_DATA_AVAILABLE, K_POLL_MODE_NOTIFY_ONLY, fifo), - }; - - k_poll(events, MP_ARRAY_SIZE(events), timeout); - DEBUG_printf("poll res: %d\n", events[0].state); -} - // Helper functions #define RAISE_ERRNO(x) { int _err = x; if (_err < 0) mp_raise_OSError(-_err); } #define RAISE_SOCK_ERRNO(x) { if ((int)(x) == -1) mp_raise_OSError(errno); } STATIC void socket_check_closed(socket_obj_t *socket) { - if (socket->ctx == NULL) { + if (socket->ctx == -1) { // already closed mp_raise_OSError(EBADF); } @@ -121,7 +79,7 @@ STATIC void parse_inet_addr(socket_obj_t *socket, mp_obj_t addr_in, struct socka mp_obj_t *addr_items; mp_obj_get_array_fixed_n(addr_in, 2, &addr_items); - sockaddr_in->sin_family = net_context_get_family(socket->ctx); + sockaddr_in->sin_family = net_context_get_family((void*)socket->ctx); RAISE_ERRNO(net_addr_pton(sockaddr_in->sin_family, mp_obj_str_get_str(addr_items[0]), &sockaddr_in->sin_addr)); sockaddr_in->sin_port = htons(mp_obj_get_int(addr_items[1])); } @@ -147,74 +105,6 @@ STATIC mp_obj_t format_inet_addr(struct sockaddr *addr, mp_obj_t port) { return MP_OBJ_FROM_PTR(tuple); } -// Copy data from Zephyr net_buf chain into linear buffer. -// We don't use net_pkt_read(), because it's weird (e.g., we'd like to -// free processed data fragment ASAP, while net_pkt_read() holds onto -// the whole fragment chain to do its deeds, and that's minor comparing -// to the fact that it copies data byte by byte). -static char *net_pkt_gather(struct net_pkt *pkt, char *to, unsigned max_len) { - struct net_buf *tmp = pkt->frags; - - while (tmp && max_len) { - unsigned len = tmp->len; - if (len > max_len) { - len = max_len; - } - memcpy(to, tmp->data, len); - to += len; - max_len -= len; - tmp = net_pkt_frag_del(pkt, NULL, tmp); - } - - return to; -} - -// Callback for incoming packets. -static void sock_received_cb(struct net_context *context, struct net_pkt *pkt, int status, void *user_data) { - socket_obj_t *socket = (socket_obj_t*)user_data; - DEBUG_printf("recv cb: context: %p, status: %d, pkt: %p", context, status, pkt); - if (pkt) { - DEBUG_printf(" (appdatalen=%d), token: %p", pkt->appdatalen, net_pkt_token(pkt)); - } - DEBUG_printf("\n"); - #if DEBUG_PRINT > 1 - net_pkt_print_frags(pkt); - #endif - - // if net_buf == NULL, EOF - if (pkt == NULL) { - struct net_pkt *last_pkt = _k_fifo_peek_tail(&SOCK_FIELD(socket, recv_q)); - if (last_pkt == NULL) { - socket->state = STATE_PEER_CLOSED; - k_fifo_cancel_wait(&SOCK_FIELD(socket, recv_q)); - DEBUG_printf("Marked socket %p as peer-closed\n", socket); - } else { - // We abuse "buf_sent" flag to store EOF flag - net_pkt_set_sent(last_pkt, true); - DEBUG_printf("Set EOF flag on %p\n", last_pkt); - } - return; - } - - // Make sure that "EOF flag" is not set - net_pkt_set_sent(pkt, false); - - // We don't care about packet header, so get rid of it asap - unsigned header_len = net_pkt_appdata(pkt) - pkt->frags->data; - net_buf_pull(pkt->frags, header_len); - - k_fifo_put(&SOCK_FIELD(socket, recv_q), pkt); -} - -// Callback for incoming connections. -static void sock_accepted_cb(struct net_context *new_ctx, struct sockaddr *addr, socklen_t addrlen, int status, void *user_data) { - socket_obj_t *socket = (socket_obj_t*)user_data; - DEBUG_printf("accept cb: context: %p, status: %d, new ctx: %p\n", socket->ctx, status, new_ctx); - DEBUG_printf("new_ctx ref_cnt: %d\n", new_ctx->refcount); - - k_fifo_put(&SOCK_FIELD(socket, accept_q), new_ctx); -} - socket_obj_t *socket_new(void) { socket_obj_t *socket = m_new_obj_with_finaliser(socket_obj_t); socket->base.type = (mp_obj_t)&socket_type; @@ -226,10 +116,10 @@ socket_obj_t *socket_new(void) { STATIC void socket_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { socket_obj_t *self = self_in; - if (self->ctx == NULL) { + if (self->ctx == -1) { mp_printf(print, ""); } else { - struct net_context *ctx = self->ctx; + struct net_context *ctx = (void*)self->ctx; mp_printf(print, "", ctx, net_context_get_type(ctx)); } } @@ -260,13 +150,8 @@ STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t } } - #ifdef CONFIG_NET_SOCKETS - socket->ctx = (void*)zsock_socket(family, socktype, proto); + socket->ctx = zsock_socket(family, socktype, proto); RAISE_SOCK_ERRNO(socket->ctx); - #else - RAISE_ERRNO(net_context_get(family, socktype, proto, &socket->ctx)); - k_fifo_init(&SOCK_FIELD(socket, recv_q)); - #endif return MP_OBJ_FROM_PTR(socket); } @@ -281,13 +166,6 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { int res = zsock_bind(socket->ctx, &sockaddr, sizeof(sockaddr)); RAISE_SOCK_ERRNO(res); - // For DGRAM socket, we expect to receive packets after call to bind(), - // but for STREAM socket, next expected operation is listen(), which - // doesn't work if recv callback is set. - if (net_context_get_type(socket->ctx) == SOCK_DGRAM) { - DEBUG_printf("Setting recv cb after bind\n"); - RAISE_ERRNO(net_context_recv(socket->ctx, sock_received_cb, K_NO_WAIT, socket)); - } return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); @@ -302,8 +180,6 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { int res = zsock_connect(socket->ctx, &sockaddr, sizeof(sockaddr)); RAISE_SOCK_ERRNO(res); - DEBUG_printf("Setting recv cb after connect()\n"); - RAISE_ERRNO(net_context_recv(socket->ctx, sock_received_cb, K_NO_WAIT, socket)); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); @@ -326,12 +202,10 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { struct sockaddr sockaddr; socklen_t addrlen = sizeof(sockaddr); - void *ctx = zsock_accept(socket->ctx, &sockaddr, &addrlen); + int ctx = zsock_accept(socket->ctx, &sockaddr, &addrlen); socket_obj_t *socket2 = socket_new(); socket2->ctx = ctx; - DEBUG_printf("Setting recv cb after accept()\n"); - RAISE_ERRNO(net_context_recv(ctx, sock_received_cb, K_NO_WAIT, socket2)); mp_obj_tuple_t *client = mp_obj_new_tuple(2, NULL); client->items[0] = MP_OBJ_FROM_PTR(socket2); @@ -373,7 +247,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_send_obj, socket_send); STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int *errcode) { socket_obj_t *socket = self_in; - if (socket->ctx == NULL) { + if (socket->ctx == -1) { // already closed *errcode = EBADF; return MP_STREAM_ERROR; From f9dfd8aa3b9030e325f382ebf51ed2627243e238 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Aug 2017 12:17:47 +1000 Subject: [PATCH 308/403] minimal,esp8266,pic16bit: Remove unused stmhal include from Makefile. --- esp8266/Makefile | 1 - minimal/Makefile | 1 - pic16bit/Makefile | 1 - 3 files changed, 3 deletions(-) diff --git a/esp8266/Makefile b/esp8266/Makefile index 1c169862e..452efb2cd 100644 --- a/esp8266/Makefile +++ b/esp8266/Makefile @@ -24,7 +24,6 @@ ESP_SDK = $(shell $(CC) -print-sysroot)/usr INC += -I. INC += -I.. -INC += -I../stmhal INC += -I$(BUILD) INC += -I$(ESP_SDK)/include diff --git a/minimal/Makefile b/minimal/Makefile index 994d26880..0fc919438 100644 --- a/minimal/Makefile +++ b/minimal/Makefile @@ -14,7 +14,6 @@ endif INC += -I. INC += -I.. -INC += -I../stmhal INC += -I$(BUILD) ifeq ($(CROSS), 1) diff --git a/pic16bit/Makefile b/pic16bit/Makefile index 1da444952..b953612fd 100644 --- a/pic16bit/Makefile +++ b/pic16bit/Makefile @@ -14,7 +14,6 @@ PART = 33FJ256GP506 INC += -I. INC += -I.. -INC += -I../stmhal INC += -I$(BUILD) INC += -I$(XC16)/include INC += -I$(XC16)/support/$(PARTFAMILY)/h From 7d4a2f773cc6ce24a91e2d210378188f3371e8a6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Aug 2017 12:22:19 +1000 Subject: [PATCH 309/403] all: Make use of $(TOP) variable in Makefiles, instead of "..". $(TOP) is defined in py/mkenv.mk and should be used to refer to the top level of this repository. --- bare-arm/Makefile | 6 ++--- cc3200/Makefile | 4 +-- cc3200/application.mk | 6 ++--- cc3200/bootmgr/bootloader.mk | 4 +-- esp8266/Makefile | 16 +++++------ minimal/Makefile | 12 ++++----- mpy-cross/Makefile | 6 ++--- pic16bit/Makefile | 6 ++--- py/py.mk | 10 +++---- qemu-arm/Makefile | 12 ++++----- stmhal/Makefile | 16 +++++------ teensy/Makefile | 10 +++---- unix/Makefile | 52 ++++++++++++++++++------------------ windows/Makefile | 6 ++--- zephyr/Makefile | 8 +++--- 15 files changed, 87 insertions(+), 87 deletions(-) diff --git a/bare-arm/Makefile b/bare-arm/Makefile index cfd427c60..90c13de11 100644 --- a/bare-arm/Makefile +++ b/bare-arm/Makefile @@ -4,12 +4,12 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk CROSS_COMPILE = arm-none-eabi- INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion @@ -45,4 +45,4 @@ $(BUILD)/firmware.elf: $(OBJ) $(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS) $(Q)$(SIZE) $@ -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/cc3200/Makefile b/cc3200/Makefile index 663496435..4c8b0b832 100644 --- a/cc3200/Makefile +++ b/cc3200/Makefile @@ -34,7 +34,7 @@ ifeq ($(BTARGET), application) # qstr definitions (must come before including py.mk) QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h # include MicroPython make definitions -include ../py/py.mk +include $(TOP)/py/py.mk include application.mk else ifeq ($(BTARGET), bootloader) @@ -45,7 +45,7 @@ endif endif # always include MicroPython make rules -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk erase: cc3200tool -p $(PORT) format_flash --size $(FLASH_SIZE_$(BOARD)) diff --git a/cc3200/application.mk b/cc3200/application.mk index c6b91ed0e..3ac28823a 100644 --- a/cc3200/application.mk +++ b/cc3200/application.mk @@ -1,5 +1,5 @@ APP_INC = -I. -APP_INC += -I.. +APP_INC += -I$(TOP) APP_INC += -Ifatfs/src APP_INC += -Ifatfs/src/drivers APP_INC += -IFreeRTOS @@ -10,7 +10,7 @@ APP_INC += -Ihal APP_INC += -Ihal/inc APP_INC += -Imisc APP_INC += -Imods -APP_INC += -I../drivers/cc3100/inc +APP_INC += -I$(TOP)/drivers/cc3100/inc APP_INC += -Isimplelink APP_INC += -Isimplelink/oslib APP_INC += -Itelnet @@ -18,7 +18,7 @@ APP_INC += -Iutil APP_INC += -Ibootmgr APP_INC += -I$(BUILD) APP_INC += -I$(BUILD)/genhdr -APP_INC += -I../stmhal +APP_INC += -I$(TOP)/stmhal APP_CPPDEFINES = -Dgcc -DTARGET_IS_CC3200 -DSL_FULL -DUSE_FREERTOS diff --git a/cc3200/bootmgr/bootloader.mk b/cc3200/bootmgr/bootloader.mk index ee5236913..b8aa9082c 100644 --- a/cc3200/bootmgr/bootloader.mk +++ b/cc3200/bootmgr/bootloader.mk @@ -4,13 +4,13 @@ BOOT_INC = -Ibootmgr BOOT_INC += -Ibootmgr/sl BOOT_INC += -Ihal BOOT_INC += -Ihal/inc -BOOT_INC += -I../drivers/cc3100/inc +BOOT_INC += -I$(TOP)/drivers/cc3100/inc BOOT_INC += -Imisc BOOT_INC += -Imods BOOT_INC += -Isimplelink BOOT_INC += -Isimplelink/oslib BOOT_INC += -Iutil -BOOT_INC += -I.. +BOOT_INC += -I$(TOP) BOOT_INC += -I. BOOT_INC += -I$(BUILD) diff --git a/esp8266/Makefile b/esp8266/Makefile index 452efb2cd..fce11a7d4 100644 --- a/esp8266/Makefile +++ b/esp8266/Makefile @@ -12,7 +12,7 @@ FROZEN_DIR ?= scripts FROZEN_MPY_DIR ?= modules # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk FWBIN = $(BUILD)/firmware-combined.bin PORT ?= /dev/ttyACM0 @@ -23,7 +23,7 @@ CROSS_COMPILE = xtensa-lx106-elf- ESP_SDK = $(shell $(CC) -print-sysroot)/usr INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) INC += -I$(ESP_SDK)/include @@ -220,16 +220,16 @@ ota: #$(BUILD)/pins_$(BOARD).o: $(BUILD)/pins_$(BOARD).c # $(call compile_c) -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk axtls: $(BUILD)/libaxtls.a $(BUILD)/libaxtls.a: - cd ../lib/axtls; cp config/upyconfig config/.config - cd ../lib/axtls; $(MAKE) oldconfig -B - cd ../lib/axtls; $(MAKE) clean - cd ../lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" AR="$(AR)" CFLAGS_EXTRA="$(CFLAGS_XTENSA) -Dabort=abort_ -DRT_MAX_PLAIN_LENGTH=1024 -DRT_EXTRA=4096" - cp ../lib/axtls/_stage/libaxtls.a $@ + cd $(TOP)/lib/axtls; cp config/upyconfig config/.config + cd $(TOP)/lib/axtls; $(MAKE) oldconfig -B + cd $(TOP)/lib/axtls; $(MAKE) clean + cd $(TOP)/lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" AR="$(AR)" CFLAGS_EXTRA="$(CFLAGS_XTENSA) -Dabort=abort_ -DRT_MAX_PLAIN_LENGTH=1024 -DRT_EXTRA=4096" + cp $(TOP)/lib/axtls/_stage/libaxtls.a $@ clean-modules: git clean -f -d modules diff --git a/minimal/Makefile b/minimal/Makefile index 0fc919438..c95d639af 100644 --- a/minimal/Makefile +++ b/minimal/Makefile @@ -6,19 +6,19 @@ CROSS = 0 QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk ifeq ($(CROSS), 1) CROSS_COMPILE = arm-none-eabi- endif INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) ifeq ($(CROSS), 1) -DFU = ../tools/dfu.py -PYDFU = ../tools/pydfu.py +DFU = $(TOP)/tools/dfu.py +PYDFU = $(TOP)/tools/pydfu.py CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT) LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref --gc-sections @@ -57,7 +57,7 @@ endif $(BUILD)/_frozen_mpy.c: frozentest.mpy $(BUILD)/genhdr/qstrdefs.generated.h $(ECHO) "MISC freezing bytecode" - $(Q)../tools/mpy-tool.py -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h -mlongint-impl=none $< > $@ + $(Q)$(TOP)/tools/mpy-tool.py -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h -mlongint-impl=none $< > $@ $(BUILD)/firmware.elf: $(OBJ) $(ECHO) "LINK $@" @@ -87,4 +87,4 @@ run: test: $(BUILD)/firmware.elf $(Q)/bin/echo -e "print('hello world!', list(x+1 for x in range(10)), end='eol\\\\n')\\r\\n\\x04" | $(BUILD)/firmware.elf | tail -n2 | grep "^hello world! \\[1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\]eol" -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile index cdec130ee..5399b5ae7 100644 --- a/mpy-cross/Makefile +++ b/mpy-cross/Makefile @@ -23,10 +23,10 @@ QSTR_DEFS = qstrdefsport.h UNAME_S := $(shell uname -s) # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) # compiler settings @@ -71,4 +71,4 @@ endif OBJ = $(PY_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/pic16bit/Makefile b/pic16bit/Makefile index b953612fd..ebf4fc2e8 100644 --- a/pic16bit/Makefile +++ b/pic16bit/Makefile @@ -4,7 +4,7 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk XC16 = /opt/microchip/xc16/v1.24 CROSS_COMPILE = $(XC16)/bin/xc16- @@ -13,7 +13,7 @@ PARTFAMILY = dsPIC33F PART = 33FJ256GP506 INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) INC += -I$(XC16)/include INC += -I$(XC16)/support/$(PARTFAMILY)/h @@ -67,4 +67,4 @@ $(BUILD)/firmware.elf: $(OBJ) $(PY_BUILD)/gc.o: CFLAGS += -O1 $(PY_BUILD)/vm.o: CFLAGS += -O1 -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/py/py.mk b/py/py.mk index 02f2df8e1..663237603 100644 --- a/py/py.mk +++ b/py/py.mk @@ -22,13 +22,13 @@ CFLAGS_MOD += -DFFCONF_H=\"lib/oofatfs/ffconf.h\" ifeq ($(MICROPY_PY_USSL),1) CFLAGS_MOD += -DMICROPY_PY_USSL=1 ifeq ($(MICROPY_SSL_AXTLS),1) -CFLAGS_MOD += -DMICROPY_SSL_AXTLS=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config +CFLAGS_MOD += -DMICROPY_SSL_AXTLS=1 -I$(TOP)/lib/axtls/ssl -I$(TOP)/lib/axtls/crypto -I$(TOP)/lib/axtls/config LDFLAGS_MOD += -Lbuild -laxtls else ifeq ($(MICROPY_SSL_MBEDTLS),1) # Can be overridden by ports which have "builtin" mbedTLS -MICROPY_SSL_MBEDTLS_INCLUDE ?= ../lib/mbedtls/include +MICROPY_SSL_MBEDTLS_INCLUDE ?= $(TOP)/lib/mbedtls/include CFLAGS_MOD += -DMICROPY_SSL_MBEDTLS=1 -I$(MICROPY_SSL_MBEDTLS_INCLUDE) -LDFLAGS_MOD += -L../lib/mbedtls/library -lmbedx509 -lmbedtls -lmbedcrypto +LDFLAGS_MOD += -L$(TOP)/lib/mbedtls/library -lmbedx509 -lmbedtls -lmbedcrypto endif endif @@ -38,7 +38,7 @@ endif ifeq ($(MICROPY_PY_LWIP),1) LWIP_DIR = lib/lwip/src -INC += -I../lib/lwip/src/include -I../lib/lwip/src/include/ipv4 -I../extmod/lwip-include +INC += -I$(TOP)/lib/lwip/src/include -I$(TOP)/lib/lwip/src/include/ipv4 -I$(TOP)/extmod/lwip-include CFLAGS_MOD += -DMICROPY_PY_LWIP=1 SRC_MOD += extmod/modlwip.c lib/netutils/netutils.c SRC_MOD += $(addprefix $(LWIP_DIR)/,\ @@ -75,7 +75,7 @@ endif ifeq ($(MICROPY_PY_BTREE),1) BTREE_DIR = lib/berkeley-db-1.xx BTREE_DEFS = -D__DBINTERFACE_PRIVATE=1 -Dmpool_error=printf -Dabort=abort_ -Dvirt_fd_t=mp_obj_t "-DVIRT_FD_T_HEADER=" -INC += -I../$(BTREE_DIR)/PORT/include +INC += -I$(TOP)/$(BTREE_DIR)/PORT/include SRC_MOD += extmod/modbtree.c SRC_MOD += $(addprefix $(BTREE_DIR)/,\ btree/bt_close.c \ diff --git a/qemu-arm/Makefile b/qemu-arm/Makefile index 743b6683a..71403cb5e 100644 --- a/qemu-arm/Makefile +++ b/qemu-arm/Makefile @@ -5,14 +5,14 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk CROSS_COMPILE = arm-none-eabi- INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) -INC += -I../tools/tinytest/ +INC += -I$(TOP)/tools/tinytest/ CFLAGS_CORTEX_M3 = -mthumb -mcpu=cortex-m3 -mfloat-abi=soft CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -std=gnu99 $(CFLAGS_CORTEX_M3) $(COPT) \ @@ -98,10 +98,10 @@ test: $(BUILD)/firmware-test.elf $(BUILD)/test_main.o: $(BUILD)/genhdr/tests.h $(BUILD)/genhdr/tests.h: - $(Q)echo "Generating $@";(cd ../tests; ../tools/tinytest-codegen.py) > $@ + $(Q)echo "Generating $@";(cd $(TOP)/tests; ../tools/tinytest-codegen.py) > $@ $(BUILD)/tinytest.o: - $(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c ../tools/tinytest/tinytest.c + $(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c $(TOP)/tools/tinytest/tinytest.c ## `$(LD)` doesn't seem to like `--specs` for some reason, but we can just use `$(CC)` here. $(BUILD)/firmware.elf: $(OBJ_COMMON) $(OBJ_RUN) @@ -112,4 +112,4 @@ $(BUILD)/firmware-test.elf: $(OBJ_COMMON) $(OBJ_TEST) $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(Q)$(SIZE) $@ -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/stmhal/Makefile b/stmhal/Makefile index ae1db2ae9..8735d84c3 100644 --- a/stmhal/Makefile +++ b/stmhal/Makefile @@ -19,7 +19,7 @@ QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h $(BUILD)/modstm_qstr.h FROZEN_MPY_DIR ?= modules # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk LD_DIR=boards CMSIS_DIR=cmsis @@ -27,10 +27,10 @@ HAL_DIR=hal/$(MCU_SERIES) USBDEV_DIR=usbdev #USBHOST_DIR=usbhost FATFS_DIR=lib/oofatfs -DFU=../tools/dfu.py +DFU=$(TOP)/tools/dfu.py # may need to prefix dfu-util with sudo USE_PYDFU ?= 1 -PYDFU ?= ../tools/pydfu.py +PYDFU ?= $(TOP)/tools/pydfu.py DFU_UTIL ?= dfu-util DEVICE=0483:df11 STFLASH ?= st-flash @@ -40,9 +40,9 @@ OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg CROSS_COMPILE = arm-none-eabi- INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) -INC += -I../lib/cmsis/inc +INC += -I$(TOP)/lib/cmsis/inc INC += -I$(CMSIS_DIR)/ INC += -I$(HAL_DIR)/inc INC += -I$(USBDEV_DIR)/core/inc -I$(USBDEV_DIR)/class/inc @@ -406,8 +406,8 @@ GEN_PINS_QSTR = $(BUILD)/pins_qstr.h GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h GEN_PINS_AF_PY = $(BUILD)/pins_af.py -INSERT_USB_IDS = ../tools/insert-usb-ids.py -FILE2H = ../tools/file2h.py +INSERT_USB_IDS = $(TOP)/tools/insert-usb-ids.py +FILE2H = $(TOP)/tools/file2h.py USB_IDS_FILE = usb.h CDCINF_TEMPLATE = pybcdc.inf_template @@ -464,4 +464,4 @@ $(GEN_CDCINF_FILE): $(CDCINF_TEMPLATE) $(INSERT_USB_IDS) $(USB_IDS_FILE) | $(HEA $(ECHO) "Create $@" $(Q)$(PYTHON) $(INSERT_USB_IDS) $(USB_IDS_FILE) $< > $@ -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/teensy/Makefile b/teensy/Makefile index 575e15e54..944e281a4 100644 --- a/teensy/Makefile +++ b/teensy/Makefile @@ -4,7 +4,7 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk # If you set USE_ARDUINO_TOOLCHAIN=1 then this makefile will attempt to use # the toolchain that comes with Teensyduino @@ -30,8 +30,8 @@ CFLAGS_TEENSY = -DF_CPU=96000000 -DUSB_SERIAL -D__MK20DX256__ CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float -mfloat-abi=soft -fsingle-precision-constant -Wdouble-promotion $(CFLAGS_TEENSY) INC += -I. -INC += -I.. -INC += -I../stmhal +INC += -I$(TOP) +INC += -I$(TOP)/stmhal INC += -I$(BUILD) INC += -Icore @@ -135,7 +135,7 @@ SRC_C += \ OBJ += $(BUILD)/memzip-files.o -MAKE_MEMZIP = ../lib/memzip/make-memzip.py +MAKE_MEMZIP = $(TOP)/lib/memzip/make-memzip.py ifeq ($(MEMZIP_DIR),) MEMZIP_DIR = memzip_files endif @@ -232,4 +232,4 @@ $(BUILD)/%.pp: $(BUILD)/%.c $(ECHO) "PreProcess $<" $(Q)$(CC) $(CFLAGS) -E -Wp,-C,-dD,-dI -o $@ $< -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/unix/Makefile b/unix/Makefile index 8672b4f18..08bd4db30 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -14,10 +14,10 @@ QSTR_DEFS = qstrdefsport.h UNAME_S := $(shell uname -s) # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) # compiler settings @@ -87,7 +87,7 @@ endif endif ifeq ($(MICROPY_USE_READLINE),1) -INC += -I../lib/mp-readline +INC += -I$(TOP)/lib/mp-readline CFLAGS_MOD += -DMICROPY_USE_READLINE=1 LIB_SRC_C_EXTRA += mp-readline/readline.c endif @@ -107,11 +107,11 @@ endif ifeq ($(MICROPY_PY_FFI),1) ifeq ($(MICROPY_STANDALONE),1) -LIBFFI_CFLAGS_MOD := -I$(shell ls -1d ../lib/libffi/build_dir/out/lib/libffi-*/include) +LIBFFI_CFLAGS_MOD := -I$(shell ls -1d $(TOP)/lib/libffi/build_dir/out/lib/libffi-*/include) ifeq ($(MICROPY_FORCE_32BIT),1) - LIBFFI_LDFLAGS_MOD = ../lib/libffi/build_dir/out/lib32/libffi.a + LIBFFI_LDFLAGS_MOD = $(TOP)/lib/libffi/build_dir/out/lib32/libffi.a else - LIBFFI_LDFLAGS_MOD = ../lib/libffi/build_dir/out/lib/libffi.a + LIBFFI_LDFLAGS_MOD = $(TOP)/lib/libffi/build_dir/out/lib/libffi.a endif else LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi) @@ -183,13 +183,13 @@ MPY_CROSS_FLAGS += -mcache-lookup-bc endif -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk .PHONY: test -test: $(PROG) ../tests/run-tests +test: $(PROG) $(TOP)/tests/run-tests $(eval DIRNAME=$(notdir $(CURDIR))) - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(PROG) ./run-tests + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(PROG) ./run-tests # install micropython in /usr/local/bin TARGET = micropython @@ -254,12 +254,12 @@ coverage: coverage_test: coverage $(eval DIRNAME=$(notdir $(CURDIR))) - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests -d thread - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --emit native - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --via-mpy -d basics float - gcov -o build-coverage/py ../py/*.c - gcov -o build-coverage/extmod ../extmod/*.c + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests -d thread + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --emit native + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --via-mpy -d basics float + gcov -o build-coverage/py $(TOP)/py/*.c + gcov -o build-coverage/extmod $(TOP)/extmod/*.c # Value of configure's --host= option (required for cross-compilation). # Deduce it from CROSS_COMPILE by default, but can be overridden. @@ -274,21 +274,21 @@ deplibs: libffi axtls # install-exec-recursive & install-data-am targets are used to avoid building # docs and depending on makeinfo libffi: - cd ../lib/libffi; git clean -d -x -f - cd ../lib/libffi; ./autogen.sh - mkdir -p ../lib/libffi/build_dir; cd ../lib/libffi/build_dir; \ + cd $(TOP)/lib/libffi; git clean -d -x -f + cd $(TOP)/lib/libffi; ./autogen.sh + mkdir -p $(TOP)/lib/libffi/build_dir; cd $(TOP)/lib/libffi/build_dir; \ ../configure $(CROSS_COMPILE_HOST) --prefix=$$PWD/out --disable-structs CC="$(CC)" CXX="$(CXX)" LD="$(LD)" CFLAGS="-Os -fomit-frame-pointer -fstrict-aliasing -ffast-math -fno-exceptions"; \ $(MAKE) install-exec-recursive; $(MAKE) -C include install-data-am axtls: $(BUILD)/libaxtls.a -$(BUILD)/libaxtls.a: ../lib/axtls/README | $(OBJ_DIRS) - cd ../lib/axtls; cp config/upyconfig config/.config - cd ../lib/axtls; $(MAKE) oldconfig -B - cd ../lib/axtls; $(MAKE) clean - cd ../lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" - cp ../lib/axtls/_stage/libaxtls.a $@ +$(BUILD)/libaxtls.a: $(TOP)/lib/axtls/README | $(OBJ_DIRS) + cd $(TOP)/lib/axtls; cp config/upyconfig config/.config + cd $(TOP)/lib/axtls; $(MAKE) oldconfig -B + cd $(TOP)/lib/axtls; $(MAKE) clean + cd $(TOP)/lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" + cp $(TOP)/lib/axtls/_stage/libaxtls.a $@ -../lib/axtls/README: +$(TOP)/lib/axtls/README: @echo "You cloned without --recursive, fetching submodules for you." - (cd ..; git submodule update --init --recursive) + (cd $(TOP); git submodule update --init --recursive) diff --git a/windows/Makefile b/windows/Makefile index 72c97381b..a39d34826 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -8,10 +8,10 @@ PROG = micropython.exe QSTR_DEFS = ../unix/qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) # compiler settings @@ -62,4 +62,4 @@ SRC_QSTR += $(SRC_C) # SRC_QSTR SRC_QSTR_AUTO_DEPS += -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/zephyr/Makefile b/zephyr/Makefile index 988b32fe8..5840cc47e 100644 --- a/zephyr/Makefile +++ b/zephyr/Makefile @@ -27,10 +27,10 @@ include $(Z_EXPORTS) endif include ../py/mkenv.mk -include ../py/py.mk +include $(TOP)/py/py.mk INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) INC += -I$(ZEPHYR_BASE)/net/ip INC += -I$(ZEPHYR_BASE)/net/ip/contiki @@ -59,7 +59,7 @@ OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) CFLAGS = $(KBUILD_CFLAGS) $(NOSTDINC_FLAGS) $(ZEPHYRINCLUDE) \ -std=gnu99 -fomit-frame-pointer -DNDEBUG -DMICROPY_HEAP_SIZE=$(MICROPY_HEAP_SIZE) $(CFLAGS_EXTRA) $(INC) -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk # We use single target here ($(Z_EXPORTS)) for simplicity, but actually # number of things get generated here: 'initconfig' generates C header for @@ -102,4 +102,4 @@ prj_$(BOARD)_merged.conf: prj_base.conf prj_$(BOARD).conf $(PYTHON) makeprj.py prj_base.conf prj_$(BOARD).conf $@ test: - cd ../tests && ./run-tests --target minimal --device "execpty:make -C ../zephyr run BOARD=$(BOARD) QEMU_PTY=1" + cd $(TOP)/tests && ./run-tests --target minimal --device "execpty:make -C ../zephyr run BOARD=$(BOARD) QEMU_PTY=1" From bfc2092dc55d1faab4a6d7e832005afd61d25c3c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 11 Aug 2017 09:42:39 +0300 Subject: [PATCH 310/403] py/modsys: Initial implementation of sys.getsizeof(). Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and instances. --- py/modsys.c | 12 ++++++++++++ py/mpconfig.h | 5 +++++ py/objdict.c | 6 ++++++ py/objlist.c | 6 ++++++ py/objtype.c | 16 ++++++++++++++++ py/runtime0.h | 1 + tests/unix/extra_coverage.py.exp | 3 ++- unix/mpconfigport_coverage.h | 1 + 8 files changed, 49 insertions(+), 1 deletion(-) diff --git a/py/modsys.c b/py/modsys.c index ee6f8686e..b7d55fdcc 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2014-2017 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,8 +32,11 @@ #include "py/objtuple.h" #include "py/objstr.h" #include "py/objint.h" +#include "py/objtype.h" #include "py/stream.h" #include "py/smallint.h" +#include "py/runtime0.h" +#include "py/runtime.h" #if MICROPY_PY_SYS @@ -143,6 +147,11 @@ STATIC mp_obj_t mp_sys_exc_info(void) { MP_DEFINE_CONST_FUN_OBJ_0(mp_sys_exc_info_obj, mp_sys_exc_info); #endif +STATIC mp_obj_t mp_sys_getsizeof(mp_obj_t obj) { + return mp_unary_op(MP_UNARY_OP_SIZEOF, obj); +} +MP_DEFINE_CONST_FUN_OBJ_1(mp_sys_getsizeof_obj, mp_sys_getsizeof); + STATIC const mp_rom_map_elem_t mp_module_sys_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sys) }, @@ -192,6 +201,9 @@ STATIC const mp_rom_map_elem_t mp_module_sys_globals_table[] = { #if MICROPY_PY_SYS_EXC_INFO { 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) }, + #endif /* * Extensions to CPython diff --git a/py/mpconfig.h b/py/mpconfig.h index fb507a503..0e76a1ff5 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -944,6 +944,11 @@ typedef double mp_float_t; #define MICROPY_PY_SYS_EXIT (1) #endif +// Whether to provide "sys.getsizeof" function +#ifndef MICROPY_PY_SYS_GETSIZEOF +#define MICROPY_PY_SYS_GETSIZEOF (0) +#endif + // Whether to provide sys.{stdin,stdout,stderr} objects #ifndef MICROPY_PY_SYS_STDFILES #define MICROPY_PY_SYS_STDFILES (0) diff --git a/py/objdict.c b/py/objdict.c index a272ebdb6..f6357a905 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -105,6 +105,12 @@ STATIC mp_obj_t dict_unary_op(mp_uint_t op, mp_obj_t self_in) { switch (op) { case MP_UNARY_OP_BOOL: return mp_obj_new_bool(self->map.used != 0); case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(self->map.used); + #if MICROPY_PY_SYS_GETSIZEOF + case MP_UNARY_OP_SIZEOF: { + size_t sz = sizeof(*self) + sizeof(*self->map.table) * self->map.alloc; + return MP_OBJ_NEW_SMALL_INT(sz); + } + #endif default: return MP_OBJ_NULL; // op not supported } } diff --git a/py/objlist.c b/py/objlist.c index ba1c50677..5957c9d4a 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -104,6 +104,12 @@ STATIC mp_obj_t list_unary_op(mp_uint_t op, mp_obj_t self_in) { switch (op) { case MP_UNARY_OP_BOOL: return mp_obj_new_bool(self->len != 0); case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(self->len); + #if MICROPY_PY_SYS_GETSIZEOF + case MP_UNARY_OP_SIZEOF: { + size_t sz = sizeof(*self) + sizeof(mp_obj_t) * self->alloc; + return MP_OBJ_NEW_SMALL_INT(sz); + } + #endif default: return MP_OBJ_NULL; // op not supported } } diff --git a/py/objtype.c b/py/objtype.c index a258915f3..87c0cc9e5 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -339,11 +339,27 @@ const qstr mp_unary_op_method_name[] = { [MP_UNARY_OP_NEGATIVE] = MP_QSTR___neg__, [MP_UNARY_OP_INVERT] = MP_QSTR___invert__, #endif + #if MICROPY_PY_SYS_GETSIZEOF + [MP_UNARY_OP_SIZEOF] = MP_QSTR_getsizeof, + #endif [MP_UNARY_OP_NOT] = MP_QSTR_, // don't need to implement this, used to make sure array has full size }; STATIC mp_obj_t instance_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_instance_t *self = MP_OBJ_TO_PTR(self_in); + + #if MICROPY_PY_SYS_GETSIZEOF + if (MP_UNLIKELY(op == MP_UNARY_OP_SIZEOF)) { + // TODO: This doesn't count inherited objects (self->subobj) + const mp_obj_type_t *native_base; + size_t num_native_bases = instance_count_native_bases(mp_obj_get_type(self_in), &native_base); + + size_t sz = sizeof(*self) + sizeof(*self->subobj) * num_native_bases + + sizeof(*self->members.table) * self->members.alloc; + return MP_OBJ_NEW_SMALL_INT(sz); + } + #endif + qstr op_name = mp_unary_op_method_name[op]; /* Still try to lookup native slot if (op_name == 0) { diff --git a/py/runtime0.h b/py/runtime0.h index d22c2fabe..703c950f2 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -50,6 +50,7 @@ typedef enum { MP_UNARY_OP_NEGATIVE, MP_UNARY_OP_INVERT, MP_UNARY_OP_NOT, + MP_UNARY_OP_SIZEOF, // for sys.getsizeof() } mp_unary_op_t; typedef enum { diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 390ff1669..ab638a632 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -25,7 +25,8 @@ ame__ __name__ path argv version version_info implementation platform byteorder maxsize exit stdin stdout -stderr modules exc_info print_exception +stderr modules exc_info getsizeof +print_exception ementation # attrtuple (start=1, stop=2, step=3) diff --git a/unix/mpconfigport_coverage.h b/unix/mpconfigport_coverage.h index 5fc8d7107..a9e0a38fa 100644 --- a/unix/mpconfigport_coverage.h +++ b/unix/mpconfigport_coverage.h @@ -37,6 +37,7 @@ #define MICROPY_PY_DELATTR_SETATTR (1) #define MICROPY_PY_BUILTINS_HELP (1) #define MICROPY_PY_BUILTINS_HELP_MODULES (1) +#define MICROPY_PY_SYS_GETSIZEOF (1) #define MICROPY_PY_URANDOM_EXTRA_FUNCS (1) #define MICROPY_PY_IO_BUFFEREDWRITER (1) #undef MICROPY_VFS_FAT From e2210a2ffe5982104bfdfe2cd4da95976eb0a7bd Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 12 Aug 2017 12:18:43 +0200 Subject: [PATCH 311/403] Add timezone support to C wrappers. - stop using timeutils.h - use localtime() instead of gmtime() - set daylight savings time to unknown when calling mktime() - add settimezone() method to time module --- esp32/machine_rtc.c | 31 ++++++++++++++++--------------- esp32/modutime.c | 30 ++++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/esp32/machine_rtc.c b/esp32/machine_rtc.c index 7bcd7d3ac..a49d5caec 100644 --- a/esp32/machine_rtc.c +++ b/esp32/machine_rtc.c @@ -35,7 +35,6 @@ #include "py/obj.h" #include "py/runtime.h" #include "py/mphal.h" -#include "timeutils.h" #include "modmachine.h" #include "machine_rtc.h" @@ -85,11 +84,10 @@ STATIC mp_obj_t machine_rtc_datetime_helper(mp_uint_t n_args, const mp_obj_t *ar // Get time struct timeval tv; - struct tm tm; - gettimeofday(&tv, NULL); - gmtime_r(&tv.tv_sec, &tm); + struct tm tm; + localtime_r(&tv.tv_sec, &tm); mp_obj_t tuple[8] = { mp_obj_new_int(tm.tm_year + 1900), @@ -108,19 +106,22 @@ STATIC mp_obj_t machine_rtc_datetime_helper(mp_uint_t n_args, const mp_obj_t *ar mp_obj_t *items; mp_obj_get_array_fixed_n(args[1], 8, &items); - struct tm tm; - struct timeval tv; - - tm.tm_year = mp_obj_get_int(items[0]) - 1900; - tm.tm_mon = mp_obj_get_int(items[1]) - 1; - tm.tm_mday = mp_obj_get_int(items[2]); - tm.tm_hour = mp_obj_get_int(items[4]); - tm.tm_min = mp_obj_get_int(items[5]); - tm.tm_sec = mp_obj_get_int(items[6]); - tv.tv_sec = mktime(&tm); - tv.tv_usec = mp_obj_get_int(items[7]); + struct tm tm = { + .tm_year = mp_obj_get_int(items[0]) - 1900, + .tm_mon = mp_obj_get_int(items[1]) - 1, + .tm_mday = mp_obj_get_int(items[2]), + .tm_hour = mp_obj_get_int(items[4]), + .tm_min = mp_obj_get_int(items[5]), + .tm_sec = mp_obj_get_int(items[6]), + .tm_isdst = -1, + }; + time_t t = mktime(&tm); + struct timeval tv = { + .tv_sec = t, + .tv_usec = mp_obj_get_int(items[7]), + }; settimeofday(&tv, NULL); return mp_const_none; diff --git a/esp32/modutime.c b/esp32/modutime.c index 7b21d974b..2b2c4a49d 100644 --- a/esp32/modutime.c +++ b/esp32/modutime.c @@ -32,7 +32,6 @@ #include #include "extmod/utime_mphal.h" -#include "lib/timeutils/timeutils.h" #include "py/nlr.h" /// \function localtime([secs]) @@ -57,7 +56,7 @@ STATIC mp_obj_t time_localtime(mp_uint_t n_args, const mp_obj_t *args) { } else { tv.tv_sec = mp_obj_get_int(args[0]); } - gmtime_r(&tv.tv_sec, &tm); + localtime_r(&tv.tv_sec, &tm); tuple[0] = mp_obj_new_int(tm.tm_year + 1900); tuple[1] = mp_obj_new_int(tm.tm_mon + 1); tuple[2] = mp_obj_new_int(tm.tm_mday); @@ -84,15 +83,23 @@ STATIC mp_obj_t time_mktime(mp_obj_t tuple) { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "mktime needs a tuple of length 8 or 9 (%d given)", len)); } - return mp_obj_new_int_from_uint(timeutils_mktime_epoch(mp_obj_get_int(elem[0]), - mp_obj_get_int(elem[1]), mp_obj_get_int(elem[2]), mp_obj_get_int(elem[3]), - mp_obj_get_int(elem[4]), mp_obj_get_int(elem[5]))); + struct tm tm = { + .tm_year = mp_obj_get_int(elem[0]) - 1900, + .tm_mon = mp_obj_get_int(elem[1]) - 1, + .tm_mday = mp_obj_get_int(elem[2]), + .tm_hour = mp_obj_get_int(elem[3]), + .tm_min = mp_obj_get_int(elem[4]), + .tm_sec = mp_obj_get_int(elem[5]), + .tm_isdst = ((len > 8) ? mp_obj_get_int(elem[8]) : -1), + }; + time_t t = mktime(&tm); + return mp_obj_new_int_from_uint(t); } MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime); /// \function time() -/// Returns the number of seconds, as an integer, since 1/1/2000. +/// Returns the number of seconds since the unix epoch. STATIC mp_obj_t time_time(void) { struct timeval tv; gettimeofday(&tv, NULL); @@ -100,11 +107,22 @@ STATIC mp_obj_t time_time(void) { } MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time); +/// \function settimezone(tz) +/// Sets the timezone to tz. +STATIC mp_obj_t time_settimezone(mp_obj_t _timezone) { + const char *timezone = mp_obj_str_get_str(_timezone); + setenv("TZ", timezone, 1); + tzset(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(time_settimezone_obj, time_settimezone); + STATIC const mp_rom_map_elem_t time_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_utime) }, { MP_ROM_QSTR(MP_QSTR_localtime), MP_ROM_PTR(&time_localtime_obj) }, { MP_ROM_QSTR(MP_QSTR_mktime), MP_ROM_PTR(&time_mktime_obj) }, { MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&time_time_obj) }, + { MP_ROM_QSTR(MP_QSTR_settimezone), MP_ROM_PTR(&time_settimezone_obj) }, { MP_ROM_QSTR(MP_QSTR_sleep), MP_ROM_PTR(&mp_utime_sleep_obj) }, { MP_ROM_QSTR(MP_QSTR_sleep_ms), MP_ROM_PTR(&mp_utime_sleep_ms_obj) }, { MP_ROM_QSTR(MP_QSTR_sleep_us), MP_ROM_PTR(&mp_utime_sleep_us_obj) }, From c1a3d60005b6561712eec07e9848c1c5dab1b45f Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 12 Aug 2017 12:21:04 +0200 Subject: [PATCH 312/403] Fix timezone usage in micropython modules - set timezone on boot (retrieve it from nvs) - remove timezone code from ntp client --- esp32/modules/boot.py | 8 +++++++- esp32/modules/ntp.py | 9 --------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/esp32/modules/boot.py b/esp32/modules/boot.py index ae606c6b4..d128e87e4 100644 --- a/esp32/modules/boot.py +++ b/esp32/modules/boot.py @@ -1,9 +1,15 @@ # This file is executed on every boot (including wake-boot from deepsleep) -import badge, machine, esp, ugfx, sys +import badge, machine, esp, ugfx, sys, time badge.init() ugfx.init() + esp.rtcmem_write(0,0) esp.rtcmem_write(1,0) + +# setup timezone +timezone = badge.nvs_get_str('system', 'timezone', 'CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00') +time.settimezone(timezone) + if badge.safe_mode(): splash = 'splash' else: diff --git a/esp32/modules/ntp.py b/esp32/modules/ntp.py index a906cf012..d0c31ed9d 100644 --- a/esp32/modules/ntp.py +++ b/esp32/modules/ntp.py @@ -1,7 +1,6 @@ ### Description: Update the badge's time via NTP ### License: MIT -import database import socket NTP_DELTA = 2208988800 @@ -43,14 +42,6 @@ def set_NTP_time(): print("Could not set time from NTP") return False - tz = 0 - with database.Database() as db: - tz = db.get("timezone", 200) # default to CEST - - tz_minutes = int(abs(tz) % 100) * (1 if tz >= 0 else -1) - tz_hours = int(tz / 100) - t += (tz_hours * 3600) + (tz_minutes * 60) - tm = time.localtime(t) tm = tm[0:3] + (0,) + tm[3:6] + (0,) From 84d3e7de0c8f07439b6a4bac1584de9f1dbd569c Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 12 Aug 2017 12:39:11 +0200 Subject: [PATCH 313/403] Remove badge-event-reminder Now the event is over, it is dead code. --- esp32/modules/splash.py | 3 --- esp32/modules/tasks/badgeeventreminder.py | 32 ----------------------- 2 files changed, 35 deletions(-) delete mode 100644 esp32/modules/tasks/badgeeventreminder.py diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index f85067c2f..9d8f675b9 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -14,7 +14,6 @@ import tasks.resourcescheck as resc import tasks.sponsorscheck as spoc import tasks.services as services -import tasks.badgeeventreminder as ber # Graphics @@ -178,8 +177,6 @@ def onSleep(idleTime): pm.callback(onSleep) pm.feed() -ber.enable() - print("----") print("WARNING: POWER MANAGEMENT ACTIVE") print("To use shell type 'import shell' within 5 seconds.") diff --git a/esp32/modules/tasks/badgeeventreminder.py b/esp32/modules/tasks/badgeeventreminder.py deleted file mode 100644 index 70cd4b927..000000000 --- a/esp32/modules/tasks/badgeeventreminder.py +++ /dev/null @@ -1,32 +0,0 @@ -# File: badgeeventreminder.py -# Version: 1 -# Description: Easter egg -# License: MIT -# Authors: Renze Nicolai - -import virtualtimers, time, appglue, badge - -# Tue Aug 8 13:30:00 2017 (CEST) -# (warn 10 minutes before the event) -whenToTrigger = 1502191800 - 600 - -def ber_task(): - global whenToTrigger - # braindead time.time() implementation. it's 2 hours in the - # future. - now = time.time() - 7200 - if now >= whenToTrigger and now < whenToTrigger + 600 + 3600: - badge.nvs_set_u8('badge','evrt',1) - print("BADGE EVENT REMINDER ACTIVATED") - appglue.start_app("badge_event_reminder") - idleFor = whenToTrigger - now - if idleFor < 0: - idleFor = 0 - return idleFor * 1000 - -def enable(): - if badge.nvs_get_u8('badge','evrt',0)==0: - virtualtimers.new(1, ber_task) - -def disable(): - virtualtimers.delete(ber_task) From 770d6d38efc050b971a7a7a51dd42f6df179dc00 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 12 Aug 2017 12:59:34 +0200 Subject: [PATCH 314/403] remove the badge_event_reminder action as well. --- esp32/modules/badge_event_reminder.py | 41 --------------------------- 1 file changed, 41 deletions(-) delete mode 100644 esp32/modules/badge_event_reminder.py diff --git a/esp32/modules/badge_event_reminder.py b/esp32/modules/badge_event_reminder.py deleted file mode 100644 index 05a1e1dfb..000000000 --- a/esp32/modules/badge_event_reminder.py +++ /dev/null @@ -1,41 +0,0 @@ -import ugfx, badge, time, appglue - -def exit(p): - if p: - appglue.home() - -ugfx.clear(ugfx.WHITE) -ugfx.string(0, 0, "SHA2017 Badge", "PermanentMarker22", ugfx.BLACK) -ugfx.string(0, 25, "Please join us for a short talk on how the", "Roboto_Regular12", ugfx.BLACK) -ugfx.string(0, 25+13, "official SHA2017 badge was designed,", "Roboto_Regular12", ugfx.BLACK) -ugfx.string(0, 25+13*2, "some nice numbers and an overview of what all", "Roboto_Regular12", ugfx.BLACK) -ugfx.string(0, 25+13*3, "of you are doing with it.", "Roboto_Regular12", ugfx.BLACK) - -ugfx.string(0, 25+13*5, "The events starts now, in room 'Pa'!", "Roboto_Regular12", ugfx.BLACK) -ugfx.string(0, ugfx.height()-13, "Press any key to close reminder.", "Roboto_Regular12", ugfx.BLACK) -ugfx.set_lut(ugfx.LUT_FULL) -ugfx.flush() - -ugfx.input_init() -ugfx.input_attach(ugfx.JOY_UP, exit) -ugfx.input_attach(ugfx.JOY_DOWN, exit) -ugfx.input_attach(ugfx.JOY_LEFT, exit) -ugfx.input_attach(ugfx.JOY_RIGHT, exit) -ugfx.input_attach(ugfx.BTN_SELECT, exit) -ugfx.input_attach(ugfx.BTN_START, exit) -ugfx.input_attach(ugfx.BTN_A, exit) -ugfx.input_attach(ugfx.BTN_B, exit) - -def led(on): - ledVal = 0 - if on: - ledVal = 64 - badge.leds_send_data(bytes([0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal,0,0,0,ledVal]),24) - -for i in range(0,30): - led(True) - badge.vibrator_activate(0xFF) - led(False) - badge.vibrator_activate(0xFF) - -appglue.home() From b6a328956467339f568b19d9192fbbfdfa47a572 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 12 Aug 2017 22:26:18 +1000 Subject: [PATCH 315/403] tools/mpy-tool.py: Don't generate const_table if it's empty. --- tools/mpy-tool.py | 49 ++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index 544f90cc8..887b3f516 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -331,27 +331,29 @@ def freeze(self, parent_name): # TODO raise FreezeError(self, 'freezing of object %r is not implemented' % (obj,)) - # generate constant table - print('STATIC const mp_rom_obj_t const_table_data_%s[%u] = {' - % (self.escaped_name, len(self.qstrs) + len(self.objs) + len(self.raw_codes))) - for qst in self.qstrs: - print(' MP_ROM_QSTR(%s),' % global_qstrs[qst].qstr_id) - for i in range(len(self.objs)): - if type(self.objs[i]) is float: - print('#if MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A || MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_B') - print(' MP_ROM_PTR(&const_obj_%s_%u),' % (self.escaped_name, i)) - print('#elif MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_C') - n = struct.unpack(' Date: Sun, 13 Aug 2017 14:31:59 +0200 Subject: [PATCH 316/403] move tm12x6_font terminus font to read-only memory. --- esp32/modfreedomgfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modfreedomgfx.c b/esp32/modfreedomgfx.c index 11cb5d6f3..4fdf7f015 100644 --- a/esp32/modfreedomgfx.c +++ b/esp32/modfreedomgfx.c @@ -144,7 +144,7 @@ STATIC mp_obj_t gfx_area(mp_uint_t n_args, const mp_obj_t *args) { STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gfx_area_obj, 5, 5, gfx_area); -static uint8_t tm12x6_font[] = { +static const uint8_t tm12x6_font[] = { #include "../share/fonts/Lat2-Terminus12x6.inc" }; @@ -155,7 +155,7 @@ STATIC mp_obj_t gfx_string(mp_uint_t n_args, const mp_obj_t *args) { int y0 = mp_obj_get_int(args[1]); int col = mp_obj_get_int(args[4]); - uint8_t* font = tm12x6_font; + const uint8_t* font = tm12x6_font; int clen = ((int*)font)[5]; int cheight = ((int*)font)[6]; int cwidth = ((int*)font)[7]; From 35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db Mon Sep 17 00:00:00 2001 From: Javier Candeira Date: Wed, 9 Aug 2017 14:40:45 +1000 Subject: [PATCH 317/403] all: Raise exceptions via mp_raise_XXX - Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions. --- drivers/dht/dht.c | 2 +- esp8266/machine_hspi.c | 6 ++---- esp8266/machine_pin.c | 6 +++--- esp8266/machine_rtc.c | 7 +++---- esp8266/modesp.c | 2 +- esp8266/modmachine.c | 3 +-- esp8266/modnetwork.c | 12 ++++-------- extmod/modlwip.c | 8 ++++---- extmod/modubinascii.c | 6 +++--- extmod/moductypes.c | 8 ++++---- extmod/moduheapq.c | 2 +- extmod/modujson.c | 2 +- extmod/modure.c | 4 ++-- extmod/modussl_axtls.c | 2 +- extmod/moduzlib.c | 2 +- lib/netutils/netutils.c | 3 ++- py/argcheck.c | 2 +- py/emitnative.c | 8 ++++---- py/lexer.c | 2 +- py/objarray.c | 6 +++--- py/objlist.c | 4 ++-- py/objstr.c | 8 ++++---- py/objstrunicode.c | 2 +- py/objtuple.c | 2 +- py/runtime.c | 2 +- py/runtime.h | 2 +- stmhal/dac.c | 2 +- stmhal/i2c.c | 12 ++++++------ stmhal/modmachine.c | 4 ++-- stmhal/moduos.c | 2 +- stmhal/pin.c | 2 +- stmhal/rtc.c | 8 +++----- stmhal/spi.c | 2 +- stmhal/timer.c | 12 ++++++------ stmhal/usb.c | 4 ++-- teensy/servo.c | 2 +- teensy/teensy_hal.c | 2 +- teensy/timer.c | 10 +++++----- unix/file.c | 2 +- unix/modffi.c | 2 +- unix/modjni.c | 2 +- 41 files changed, 86 insertions(+), 95 deletions(-) diff --git a/drivers/dht/dht.c b/drivers/dht/dht.c index 6bdda44b4..5d92ae39a 100644 --- a/drivers/dht/dht.c +++ b/drivers/dht/dht.c @@ -40,7 +40,7 @@ STATIC mp_obj_t dht_readinto(mp_obj_t pin_in, mp_obj_t buf_in) { mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); if (bufinfo.len < 5) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "buffer too small")); + mp_raise_ValueError("buffer too small"); } // issue start command diff --git a/esp8266/machine_hspi.c b/esp8266/machine_hspi.c index 1be342b52..eaabbab7e 100644 --- a/esp8266/machine_hspi.c +++ b/esp8266/machine_hspi.c @@ -122,15 +122,13 @@ STATIC void machine_hspi_init(mp_obj_base_t *self_in, size_t n_args, const mp_ob spi_init_gpio(HSPI, SPI_CLK_80MHZ_NODIV); spi_clock(HSPI, 0, 0); } else if (self->baudrate > 40000000L) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "impossible baudrate")); + mp_raise_ValueError("impossible baudrate"); } else { uint32_t divider = 40000000L / self->baudrate; uint16_t prediv = MIN(divider, SPI_CLKDIV_PRE + 1); uint16_t cntdiv = (divider / prediv) * 2; // cntdiv has to be even if (cntdiv > SPI_CLKCNT_N + 1 || cntdiv == 0 || prediv == 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "impossible baudrate")); + mp_raise_ValueError("impossible baudrate"); } self->baudrate = 80000000L / (prediv * cntdiv); spi_init_gpio(HSPI, SPI_CLK_USE_DIV); diff --git a/esp8266/machine_pin.c b/esp8266/machine_pin.c index de65735ba..673082065 100644 --- a/esp8266/machine_pin.c +++ b/esp8266/machine_pin.c @@ -125,7 +125,7 @@ void pin_intr_handler(uint32_t status) { pyb_pin_obj_t *mp_obj_get_pin_obj(mp_obj_t pin_in) { if (mp_obj_get_type(pin_in) != &pyb_pin_type) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "expecting a pin")); + mp_raise_ValueError("expecting a pin"); } pyb_pin_obj_t *self = pin_in; return self; @@ -280,7 +280,7 @@ STATIC mp_obj_t pyb_pin_obj_init_helper(pyb_pin_obj_t *self, mp_uint_t n_args, c // only pull-down seems to be supported by the hardware, and // we only expose pull-up behaviour in software if (pull != GPIO_PULL_NONE) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Pin(16) doesn't support pull")); + mp_raise_ValueError("Pin(16) doesn't support pull"); } } else { PIN_FUNC_SELECT(self->periph, self->func); @@ -319,7 +319,7 @@ mp_obj_t mp_pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, pin = (pyb_pin_obj_t*)&pyb_pin_obj[wanted_pin]; } if (pin == NULL || pin->base.type == NULL) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid pin")); + mp_raise_ValueError("invalid pin"); } if (n_args > 1 || n_kw > 0) { diff --git a/esp8266/machine_rtc.c b/esp8266/machine_rtc.c index 2ad44318f..c5d04e0cf 100644 --- a/esp8266/machine_rtc.c +++ b/esp8266/machine_rtc.c @@ -183,8 +183,7 @@ STATIC mp_obj_t pyb_rtc_memory(mp_uint_t n_args, const mp_obj_t *args) { mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_READ); if (bufinfo.len > MEM_USER_MAXLEN) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "buffer too long")); + mp_raise_ValueError("buffer too long"); } len = bufinfo.len; @@ -208,7 +207,7 @@ STATIC mp_obj_t pyb_rtc_alarm(mp_obj_t self_in, mp_obj_t alarm_id, mp_obj_t time // check we want alarm0 if (mp_obj_get_int(alarm_id) != 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid alarm")); + mp_raise_ValueError("invalid alarm"); } // set expiry time (in microseconds) @@ -245,7 +244,7 @@ STATIC mp_obj_t pyb_rtc_irq(size_t n_args, const mp_obj_t *pos_args, mp_map_t *k // check we want alarm0 if (args[ARG_trigger].u_int != 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid alarm")); + mp_raise_ValueError("invalid alarm"); } // set the wake value diff --git a/esp8266/modesp.c b/esp8266/modesp.c index a63d50564..6ddca0733 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -118,7 +118,7 @@ STATIC mp_obj_t esp_flash_write(mp_obj_t offset_in, const mp_obj_t buf_in) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); if (bufinfo.len & 0x3) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "len must be multiple of 4")); + mp_raise_ValueError("len must be multiple of 4"); } SpiFlashOpResult res = spi_flash_write(offset, bufinfo.buf, bufinfo.len); if (res == SPI_FLASH_RESULT_OK) { diff --git a/esp8266/modmachine.c b/esp8266/modmachine.c index 070e6fc54..98bc49558 100644 --- a/esp8266/modmachine.c +++ b/esp8266/modmachine.c @@ -59,8 +59,7 @@ STATIC mp_obj_t machine_freq(mp_uint_t n_args, const mp_obj_t *args) { // set mp_int_t freq = mp_obj_get_int(args[0]) / 1000000; if (freq != 80 && freq != 160) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "frequency can only be either 80Mhz or 160MHz")); + mp_raise_ValueError("frequency can only be either 80Mhz or 160MHz"); } system_update_cpu_freq(freq); return mp_const_none; diff --git a/esp8266/modnetwork.c b/esp8266/modnetwork.c index 283abecaf..b893209c6 100644 --- a/esp8266/modnetwork.c +++ b/esp8266/modnetwork.c @@ -275,8 +275,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp_ifconfig_obj, 1, 2, esp_ifconfig) STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) { if (n_args != 1 && kwargs->used != 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, - "either pos or kw args are allowed")); + mp_raise_TypeError("either pos or kw args are allowed"); } wlan_if_obj_t *self = MP_OBJ_TO_PTR(args[0]); @@ -303,8 +302,7 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs mp_buffer_info_t bufinfo; mp_get_buffer_raise(kwargs->table[i].value, &bufinfo, MP_BUFFER_READ); if (bufinfo.len != 6) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "invalid buffer length")); + mp_raise_ValueError("invalid buffer length"); } wifi_set_macaddr(self->if_id, bufinfo.buf); break; @@ -374,8 +372,7 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs // Get config if (n_args != 2) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, - "can query only one param")); + mp_raise_TypeError("can query only one param"); } mp_obj_t val; @@ -422,8 +419,7 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs return val; unknown: - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "unknown config param")); + mp_raise_ValueError("unknown config param"); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(esp_config_obj, 1, esp_config); diff --git a/extmod/modlwip.c b/extmod/modlwip.c index bde251cca..cc10523e5 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -129,15 +129,15 @@ STATIC mp_obj_t lwip_slip_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, ip_addr_t iplocal, ipremote; if (!ipaddr_aton(mp_obj_str_get_str(args[1]), &iplocal)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "not a valid local IP")); + mp_raise_ValueError("not a valid local IP"); } if (!ipaddr_aton(mp_obj_str_get_str(args[2]), &ipremote)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "not a valid remote IP")); + mp_raise_ValueError("not a valid remote IP"); } struct netif *n = &lwip_slip_obj.lwip_netif; if (netif_add(n, &iplocal, IP_ADDR_BROADCAST, &ipremote, NULL, slipif_init, ip_input) == NULL) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "out of memory")); + mp_raise_ValueError("out of memory"); } netif_set_up(n); netif_set_default(n); @@ -1033,7 +1033,7 @@ STATIC mp_obj_t lwip_socket_sendall(mp_obj_t self_in, mp_obj_t buf_in) { break; } case MOD_NETWORK_SOCK_DGRAM: - mp_not_implemented(""); + mp_raise_NotImplementedError(""); break; } diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index d79191b3e..d3092a4df 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -109,7 +109,7 @@ mp_obj_t mod_binascii_a2b_base64(mp_obj_t data) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ); if (bufinfo.len % 4 != 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "incorrect padding")); + mp_raise_ValueError("incorrect padding"); } vstr_t vstr; @@ -136,11 +136,11 @@ mp_obj_t mod_binascii_a2b_base64(mp_obj_t data) { hold[j] = 63; } else if (in[j] == '=') { if (j < 2 || i > 4) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "incorrect padding")); + mp_raise_ValueError("incorrect padding"); } hold[j] = 64; } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid character")); + mp_raise_ValueError("invalid character"); } } in += 4; diff --git a/extmod/moductypes.c b/extmod/moductypes.c index c2d226562..dc03f6de5 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -118,7 +118,7 @@ typedef struct _mp_obj_uctypes_struct_t { } mp_obj_uctypes_struct_t; STATIC NORETURN void syntax_error(void) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "syntax error in uctypes descriptor")); + mp_raise_TypeError("syntax error in uctypes descriptor"); } STATIC mp_obj_t uctypes_struct_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { @@ -215,7 +215,7 @@ STATIC mp_uint_t uctypes_struct_size(mp_obj_t desc_in, int layout_type, mp_uint_ // but scalar structure field is lowered into native Python int, so all // type info is lost. So, we cannot say if it's scalar type description, // or such lowered scalar. - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "Cannot unambiguously get sizeof scalar")); + mp_raise_TypeError("Cannot unambiguously get sizeof scalar"); } syntax_error(); } @@ -393,7 +393,7 @@ STATIC mp_obj_t uctypes_struct_attr_op(mp_obj_t self_in, qstr attr, mp_obj_t set // TODO: Support at least OrderedDict in addition if (!MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "struct: no fields")); + mp_raise_TypeError("struct: no fields"); } mp_obj_t deref = mp_obj_dict_get(self->desc, MP_OBJ_NEW_QSTR(attr)); @@ -526,7 +526,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_ob } else { // load / store if (!MP_OBJ_IS_TYPE(self->desc, &mp_type_tuple)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "struct: cannot index")); + mp_raise_TypeError("struct: cannot index"); } mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->desc); diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index e6e417d2b..4a620bad8 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -35,7 +35,7 @@ STATIC mp_obj_list_t *get_heap(mp_obj_t heap_in) { if (!MP_OBJ_IS_TYPE(heap_in, &mp_type_list)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "heap must be a list")); + mp_raise_TypeError("heap must be a list"); } return MP_OBJ_TO_PTR(heap_in); } diff --git a/extmod/modujson.c b/extmod/modujson.c index f94ec7db8..6c4aa1611 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -269,7 +269,7 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { return stack_top; fail: - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "syntax error in JSON")); + mp_raise_ValueError("syntax error in JSON"); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_load_obj, mod_ujson_load); diff --git a/extmod/modure.c b/extmod/modure.c index b85ba2673..2baebdecc 100644 --- a/extmod/modure.c +++ b/extmod/modure.c @@ -156,7 +156,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) { mp_obj_t s = mp_obj_new_str_of_type(str_type, (const byte*)subj.begin, caps[0] - subj.begin); mp_obj_list_append(retval, s); if (self->re.sub > 0) { - mp_not_implemented("Splitting with sub-captures"); + mp_raise_NotImplementedError("Splitting with sub-captures"); } subj.begin = caps[1]; if (maxsplit > 0 && --maxsplit == 0) { @@ -200,7 +200,7 @@ STATIC mp_obj_t mod_re_compile(size_t n_args, const mp_obj_t *args) { int error = re1_5_compilecode(&o->re, re_str); if (error != 0) { error: - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Error in regex")); + mp_raise_ValueError("Error in regex"); } if (flags & FLAG_DEBUG) { re1_5_dumpcode(&o->re); diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index 86dd8e29c..b5d2412d2 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -153,7 +153,7 @@ STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t flag_in) { // Currently supports only blocking mode (void)self_in; if (!mp_obj_is_true(flag_in)) { - mp_not_implemented(""); + mp_raise_NotImplementedError(""); } return mp_const_none; } diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index a05d0f2ed..b446dba73 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -92,7 +92,7 @@ STATIC mp_obj_t decompio_make_new(const mp_obj_type_t *type, size_t n_args, size dict_opt = uzlib_zlib_parse_header(&o->decomp); if (dict_opt < 0) { header_error: - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "compression header")); + mp_raise_ValueError("compression header"); } dict_sz = 1 << dict_opt; } else { diff --git a/lib/netutils/netutils.c b/lib/netutils/netutils.c index a32452161..15e70397c 100644 --- a/lib/netutils/netutils.c +++ b/lib/netutils/netutils.c @@ -31,6 +31,7 @@ #include "py/obj.h" #include "py/nlr.h" +#include "py/runtime.h" #include "lib/netutils/netutils.h" // Takes an array with a raw IPv4 address and returns something like '192.168.0.1'. @@ -80,7 +81,7 @@ void netutils_parse_ipv4_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian } else if (i > 0 && s < s_top && *s == '.') { s++; } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid arguments")); + mp_raise_ValueError("invalid arguments"); } } } diff --git a/py/argcheck.c b/py/argcheck.c index 22fd9cd2c..0c5c5ca95 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -142,6 +142,6 @@ NORETURN void mp_arg_error_terse_mismatch(void) { #if MICROPY_CPYTHON_COMPAT NORETURN void mp_arg_error_unimpl_kw(void) { - mp_not_implemented("keyword argument(s) not yet implemented - use normal args instead"); + mp_raise_NotImplementedError("keyword argument(s) not yet implemented - use normal args instead"); } #endif diff --git a/py/emitnative.c b/py/emitnative.c index 5ed69ff9b..7ce619625 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -824,7 +824,7 @@ STATIC void emit_get_stack_pointer_to_reg_for_pop(emit_t *emit, mp_uint_t reg_de break; default: // not handled - mp_not_implemented("conversion to object"); + mp_raise_NotImplementedError("conversion to object"); } } @@ -2158,7 +2158,7 @@ STATIC void emit_native_call_function(emit_t *emit, mp_uint_t n_positional, mp_u break; default: // this can happen when casting a cast: int(int) - mp_not_implemented("casting"); + mp_raise_NotImplementedError("casting"); } } else { assert(vtype_fun == VTYPE_PYOBJ); @@ -2232,12 +2232,12 @@ STATIC void emit_native_raise_varargs(emit_t *emit, mp_uint_t n_args) { STATIC void emit_native_yield_value(emit_t *emit) { // not supported (for now) (void)emit; - mp_not_implemented("native yield"); + mp_raise_NotImplementedError("native yield"); } STATIC void emit_native_yield_from(emit_t *emit) { // not supported (for now) (void)emit; - mp_not_implemented("native yield from"); + mp_raise_NotImplementedError("native yield from"); } STATIC void emit_native_start_except_handler(emit_t *emit) { diff --git a/py/lexer.c b/py/lexer.c index 32b3567cc..074d6f356 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -341,7 +341,7 @@ STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw) { // 3MB of text; even gzip-compressed and with minimal structure, it'll take // roughly half a meg of storage. This form of Unicode escape may be added // later on, but it's definitely not a priority right now. -- CJA 20140607 - mp_not_implemented("unicode name escapes"); + mp_raise_NotImplementedError("unicode name escapes"); break; default: if (c >= '0' && c <= '7') { diff --git a/py/objarray.c b/py/objarray.c index 99146bd4c..a31c53680 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -288,7 +288,7 @@ STATIC mp_obj_t array_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) // Otherwise, can only look for a scalar numeric value in an array if (MP_OBJ_IS_INT(rhs_in) || mp_obj_is_float(rhs_in)) { - mp_not_implemented(""); + mp_raise_NotImplementedError(""); } return mp_const_false; @@ -378,7 +378,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value } else if (MP_OBJ_IS_TYPE(index_in, &mp_type_slice)) { mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(o->len, index_in, &slice)) { - mp_not_implemented("only slices with step=1 (aka None) are supported"); + mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported"); } if (value != MP_OBJ_SENTINEL) { #if MICROPY_PY_ARRAY_SLICE_ASSIGN @@ -409,7 +409,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value src_len = bufinfo.len; src_items = bufinfo.buf; } else { - mp_not_implemented("array/bytes required on right side"); + mp_raise_NotImplementedError("array/bytes required on right side"); } // TODO: check src/dst compat diff --git a/py/objlist.c b/py/objlist.c index 5957c9d4a..86d430062 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -162,7 +162,7 @@ STATIC mp_obj_t list_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { mp_obj_list_t *self = MP_OBJ_TO_PTR(self_in); mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) { - mp_not_implemented(""); + mp_raise_NotImplementedError(""); } mp_int_t len_adj = slice.start - slice.stop; @@ -202,7 +202,7 @@ STATIC mp_obj_t list_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { mp_obj_get_array(value, &value_len, &value_items); mp_bound_slice_t slice_out; if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice_out)) { - mp_not_implemented(""); + mp_raise_NotImplementedError(""); } mp_int_t len_adj = value_len - (slice_out.stop - slice_out.start); //printf("Len adj: %d\n", len_adj); diff --git a/py/objstr.c b/py/objstr.c index cc3dda59e..d4c038a68 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -404,7 +404,7 @@ STATIC mp_obj_t bytes_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) { mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(self_len, index, &slice)) { - mp_not_implemented("only slices with step=1 (aka None) are supported"); + mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported"); } return mp_obj_new_str_of_type(type, self_data + slice.start, slice.stop - slice.start); } @@ -618,7 +618,7 @@ STATIC mp_obj_t str_rsplit(size_t n_args, const mp_obj_t *args) { mp_int_t idx = splits; if (sep == mp_const_none) { - mp_not_implemented("rsplit(None,n)"); + mp_raise_NotImplementedError("rsplit(None,n)"); } else { size_t sep_len; const char *sep_str = mp_obj_str_get_data(sep, &sep_len); @@ -742,7 +742,7 @@ STATIC mp_obj_t str_endswith(size_t n_args, const mp_obj_t *args) { GET_STR_DATA_LEN(args[0], str, str_len); GET_STR_DATA_LEN(args[1], suffix, suffix_len); if (n_args > 2) { - mp_not_implemented("start/end indices"); + mp_raise_NotImplementedError("start/end indices"); } if (suffix_len > str_len) { @@ -1044,7 +1044,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar arg = key_elem->value; } if (field_name < field_name_top) { - mp_not_implemented("attributes not supported yet"); + mp_raise_NotImplementedError("attributes not supported yet"); } } else { if (*arg_i < 0) { diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 0cf791ff7..036f7f3c1 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -188,7 +188,7 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { mp_obj_t ostart, ostop, ostep; mp_obj_slice_get(index, &ostart, &ostop, &ostep); if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) { - mp_not_implemented("only slices with step=1 (aka None) are supported"); + mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported"); } const byte *pstart, *pstop; diff --git a/py/objtuple.c b/py/objtuple.c index cbe645494..765edb907 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -181,7 +181,7 @@ mp_obj_t mp_obj_tuple_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) { mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) { - mp_not_implemented("only slices with step=1 (aka None) are supported"); + mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported"); } mp_obj_tuple_t *res = MP_OBJ_TO_PTR(mp_obj_new_tuple(slice.stop - slice.start, NULL)); mp_seq_copy(res->items, self->items + slice.start, res->len, mp_obj_t); diff --git a/py/runtime.c b/py/runtime.c index 6a0db007e..9c3edeb9c 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1439,6 +1439,6 @@ NORETURN void mp_raise_OSError(int errno_) { nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno_))); } -NORETURN void mp_not_implemented(const char *msg) { +NORETURN void mp_raise_NotImplementedError(const char *msg) { mp_raise_msg(&mp_type_NotImplementedError, msg); } diff --git a/py/runtime.h b/py/runtime.h index fe492885b..428e2571c 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -149,8 +149,8 @@ NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const char *msg); //NORETURN void nlr_raise_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...); NORETURN void mp_raise_ValueError(const char *msg); NORETURN void mp_raise_TypeError(const char *msg); +NORETURN void mp_raise_NotImplementedError(const char *msg); NORETURN void mp_raise_OSError(int errno_); -NORETURN void mp_not_implemented(const char *msg); // Raise NotImplementedError with given message NORETURN void mp_exc_recursion_depth(void); #if MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG diff --git a/stmhal/dac.c b/stmhal/dac.c index cdb3a9bcd..14bd59b41 100644 --- a/stmhal/dac.c +++ b/stmhal/dac.c @@ -119,7 +119,7 @@ STATIC uint32_t TIMx_Config(mp_obj_t timer) { return DAC_TRIGGER_T8_TRGO; #endif } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Timer does not support DAC triggering")); + mp_raise_ValueError("Timer does not support DAC triggering"); } } diff --git a/stmhal/i2c.c b/stmhal/i2c.c index 3fcce327f..48a1e49af 100644 --- a/stmhal/i2c.c +++ b/stmhal/i2c.c @@ -670,7 +670,7 @@ STATIC mp_obj_t pyb_i2c_is_ready(mp_obj_t self_in, mp_obj_t i2c_addr_o) { pyb_i2c_obj_t *self = self_in; if (!in_master_mode(self)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "I2C must be a master")); + mp_raise_TypeError("I2C must be a master"); } mp_uint_t i2c_addr = mp_obj_get_int(i2c_addr_o) << 1; @@ -693,7 +693,7 @@ STATIC mp_obj_t pyb_i2c_scan(mp_obj_t self_in) { pyb_i2c_obj_t *self = self_in; if (!in_master_mode(self)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "I2C must be a master")); + mp_raise_TypeError("I2C must be a master"); } mp_obj_t list = mp_obj_new_list(0, NULL); @@ -754,7 +754,7 @@ STATIC mp_obj_t pyb_i2c_send(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ if (use_dma) { dma_deinit(self->tx_dma_descr); } - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "addr argument required")); + mp_raise_TypeError("addr argument required"); } mp_uint_t i2c_addr = args[1].u_int << 1; if (!use_dma) { @@ -830,7 +830,7 @@ STATIC mp_obj_t pyb_i2c_recv(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ HAL_StatusTypeDef status; if (in_master_mode(self)) { if (args[1].u_int == PYB_I2C_MASTER_ADDRESS) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "addr argument required")); + mp_raise_TypeError("addr argument required"); } mp_uint_t i2c_addr = args[1].u_int << 1; if (!use_dma) { @@ -897,7 +897,7 @@ STATIC mp_obj_t pyb_i2c_mem_read(mp_uint_t n_args, const mp_obj_t *pos_args, mp_ mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(pyb_i2c_mem_read_allowed_args), pyb_i2c_mem_read_allowed_args, args); if (!in_master_mode(self)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "I2C must be a master")); + mp_raise_TypeError("I2C must be a master"); } // get the buffer to read into @@ -965,7 +965,7 @@ STATIC mp_obj_t pyb_i2c_mem_write(mp_uint_t n_args, const mp_obj_t *pos_args, mp mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(pyb_i2c_mem_read_allowed_args), pyb_i2c_mem_read_allowed_args, args); if (!in_master_mode(self)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "I2C must be a master")); + mp_raise_TypeError("I2C must be a master"); } // get the buffer to write from diff --git a/stmhal/modmachine.c b/stmhal/modmachine.c index c5444ec98..cb7957681 100644 --- a/stmhal/modmachine.c +++ b/stmhal/modmachine.c @@ -258,7 +258,7 @@ STATIC mp_obj_t machine_freq(mp_uint_t n_args, const mp_obj_t *args) { mp_int_t wanted_sysclk = mp_obj_get_int(args[0]) / 1000000; #if defined(MCU_SERIES_L4) - nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, "machine.freq set not supported yet")); + mp_raise_NotImplementedError("machine.freq set not supported yet"); #endif // default PLL parameters that give 48MHz on PLL48CK @@ -318,7 +318,7 @@ STATIC mp_obj_t machine_freq(mp_uint_t n_args, const mp_obj_t *args) { goto set_clk; } } - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "can't make valid freq")); + mp_raise_ValueError("can't make valid freq"); } set_clk: diff --git a/stmhal/moduos.c b/stmhal/moduos.c index 77a60c0cb..e02f6aefa 100644 --- a/stmhal/moduos.c +++ b/stmhal/moduos.c @@ -121,7 +121,7 @@ STATIC mp_obj_t os_dupterm(mp_uint_t n_args, const mp_obj_t *args) { } else if (mp_obj_get_type(args[0]) == &pyb_uart_type) { MP_STATE_PORT(pyb_stdio_uart) = args[0]; } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "need a UART object")); + mp_raise_ValueError("need a UART object"); } return mp_const_none; } diff --git a/stmhal/pin.c b/stmhal/pin.c index 0dce0c1c0..8d4e80022 100644 --- a/stmhal/pin.c +++ b/stmhal/pin.c @@ -120,7 +120,7 @@ const pin_obj_t *pin_find(mp_obj_t user_obj) { pin_obj = mp_call_function_1(MP_STATE_PORT(pin_class_mapper), user_obj); if (pin_obj != mp_const_none) { if (!MP_OBJ_IS_TYPE(pin_obj, &pin_type)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Pin.mapper didn't return a Pin object")); + mp_raise_ValueError("Pin.mapper didn't return a Pin object"); } if (pin_class_debug) { printf("Pin.mapper maps "); diff --git a/stmhal/rtc.c b/stmhal/rtc.c index 4efc56d5c..6cb6ef047 100644 --- a/stmhal/rtc.c +++ b/stmhal/rtc.c @@ -575,7 +575,7 @@ mp_obj_t pyb_rtc_wakeup(mp_uint_t n_args, const mp_obj_t *args) { wut -= 0x10000; if (wut > 0x10000) { // wut still too large - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "wakeup value too large")); + mp_raise_ValueError("wakeup value too large"); } } } @@ -685,12 +685,10 @@ mp_obj_t pyb_rtc_calibration(mp_uint_t n_args, const mp_obj_t *args) { } return mp_obj_new_int(cal & 1); } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "calibration value out of range")); + mp_raise_ValueError("calibration value out of range"); } #else - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "calibration value out of range")); + mp_raise_ValueError("calibration value out of range"); #endif } if (cal > 0) { diff --git a/stmhal/spi.c b/stmhal/spi.c index 574fed073..d25e13f98 100644 --- a/stmhal/spi.c +++ b/stmhal/spi.c @@ -765,7 +765,7 @@ STATIC mp_obj_t pyb_spi_send_recv(mp_uint_t n_args, const mp_obj_t *pos_args, mp // recv argument given mp_get_buffer_raise(args[1].u_obj, &bufinfo_recv, MP_BUFFER_WRITE); if (bufinfo_recv.len != bufinfo_send.len) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "recv must be same length as send")); + mp_raise_ValueError("recv must be same length as send"); } o_ret = args[1].u_obj; } diff --git a/stmhal/timer.c b/stmhal/timer.c index 570558775..938e96597 100644 --- a/stmhal/timer.c +++ b/stmhal/timer.c @@ -278,7 +278,7 @@ STATIC uint32_t compute_prescaler_period_from_freq(pyb_timer_obj_t *self, mp_obj if (freq <= 0) { goto bad_freq; bad_freq: - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "must have positive freq")); + mp_raise_ValueError("must have positive freq"); } period = source_freq / freq; } @@ -429,7 +429,7 @@ STATIC void config_deadtime(pyb_timer_obj_t *self, mp_int_t ticks) { TIM_HandleTypeDef *pyb_timer_get_handle(mp_obj_t timer) { if (mp_obj_get_type(timer) != &pyb_timer_type) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "need a Timer object")); + mp_raise_ValueError("need a Timer object"); } pyb_timer_obj_t *self = timer; return &self->tim; @@ -541,7 +541,7 @@ STATIC mp_obj_t pyb_timer_init_helper(pyb_timer_obj_t *self, mp_uint_t n_args, c init->Prescaler = args[1].u_int; init->Period = args[2].u_int; } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "must specify either freq, or prescaler and period")); + mp_raise_TypeError("must specify either freq, or prescaler and period"); } init->CounterMode = args[3].u_int; @@ -891,7 +891,7 @@ STATIC mp_obj_t pyb_timer_channel(mp_uint_t n_args, const mp_obj_t *pos_args, mp mp_obj_t pin_obj = args[2].u_obj; if (pin_obj != mp_const_none) { if (!MP_OBJ_IS_TYPE(pin_obj, &pin_type)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "pin argument needs to be be a Pin type")); + mp_raise_ValueError("pin argument needs to be be a Pin type"); } const pin_obj_t *pin = pin_obj; const pin_af_obj_t *af = pin_find_af(pin, AF_FN_TIM, self->tim_id); @@ -1174,7 +1174,7 @@ STATIC mp_obj_t pyb_timer_callback(mp_obj_t self_in, mp_obj_t callback) { HAL_TIM_Base_Start_IT(&self->tim); // This will re-enable the IRQ HAL_NVIC_EnableIRQ(self->irqn); } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "callback must be None or a callable object")); + mp_raise_ValueError("callback must be None or a callable object"); } return mp_const_none; } @@ -1331,7 +1331,7 @@ STATIC mp_obj_t pyb_timer_channel_callback(mp_obj_t self_in, mp_obj_t callback) break; } } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "callback must be None or a callable object")); + mp_raise_ValueError("callback must be None or a callable object"); } return mp_const_none; } diff --git a/stmhal/usb.c b/stmhal/usb.c index 9bf351f49..e2cbd6745 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -319,7 +319,7 @@ STATIC mp_obj_t pyb_usb_mode(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ return mp_const_none; bad_mode: - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "bad USB mode")); + mp_raise_ValueError("bad USB mode"); } MP_DEFINE_CONST_FUN_OBJ_KW(pyb_usb_mode_obj, 0, pyb_usb_mode); @@ -590,7 +590,7 @@ STATIC mp_obj_t pyb_usb_hid_send(mp_obj_t self_in, mp_obj_t report_in) { mp_obj_t *items; mp_obj_get_array(report_in, &bufinfo.len, &items); if (bufinfo.len > sizeof(temp_buf)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "tuple/list too large for HID report; use bytearray instead")); + mp_raise_ValueError("tuple/list too large for HID report; use bytearray instead"); } for (int i = 0; i < bufinfo.len; i++) { temp_buf[i] = mp_obj_get_int(items[i]); diff --git a/teensy/servo.c b/teensy/servo.c index 6ccdb05e9..262daaeb6 100644 --- a/teensy/servo.c +++ b/teensy/servo.c @@ -217,7 +217,7 @@ mp_obj_t pyb_Servo(void) { self->servo_id++; } m_del_obj(pyb_servo_obj_t, self); - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "No available servo ids")); + mp_raise_ValueError("No available servo ids"); return mp_const_none; } diff --git a/teensy/teensy_hal.c b/teensy/teensy_hal.c index 4fcf99922..439e3380d 100644 --- a/teensy/teensy_hal.c +++ b/teensy/teensy_hal.c @@ -61,5 +61,5 @@ void mp_hal_gpio_clock_enable(GPIO_TypeDef *gpio) { } void extint_register_pin(const void *pin, uint32_t mode, int hard_irq, mp_obj_t callback_obj) { - mp_not_implemented(NULL); + mp_raise_NotImplementedError(NULL); } diff --git a/teensy/timer.c b/teensy/timer.c index bc560d85e..6e578acc1 100644 --- a/teensy/timer.c +++ b/teensy/timer.c @@ -255,7 +255,7 @@ STATIC mp_obj_t pyb_timer_init_helper(pyb_timer_obj_t *self, uint n_args, const // set prescaler and period from frequency if (vals[0].u_int == 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "can't have 0 frequency")); + mp_raise_ValueError("can't have 0 frequency"); } uint32_t period = MAX(1, F_BUS / vals[0].u_int); @@ -277,7 +277,7 @@ STATIC mp_obj_t pyb_timer_init_helper(pyb_timer_obj_t *self, uint n_args, const nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "period must be between 0 and 65535, not %d", init->Period)); } } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "must specify either freq, or prescaler and period")); + mp_raise_TypeError("must specify either freq, or prescaler and period"); } init->CounterMode = vals[3].u_int; @@ -498,7 +498,7 @@ STATIC mp_obj_t pyb_timer_channel(mp_uint_t n_args, const mp_obj_t *args, mp_map mp_obj_t pin_obj = vals[1].u_obj; if (pin_obj != mp_const_none) { if (!MP_OBJ_IS_TYPE(pin_obj, &pin_type)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "pin argument needs to be be a Pin type")); + mp_raise_ValueError("pin argument needs to be be a Pin type"); } const pin_obj_t *pin = pin_obj; const pin_af_obj_t *af = pin_find_af(pin, AF_FN_FTM, self->tim_id); @@ -668,7 +668,7 @@ STATIC mp_obj_t pyb_timer_callback(mp_obj_t self_in, mp_obj_t callback) { // start timer, so that it interrupts on overflow HAL_FTM_Base_Start_IT(&self->ftm); } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "callback must be None or a callable object")); + mp_raise_ValueError("callback must be None or a callable object"); } return mp_const_none; } @@ -846,7 +846,7 @@ STATIC mp_obj_t pyb_timer_channel_callback(mp_obj_t self_in, mp_obj_t callback) break; } } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "callback must be None or a callable object")); + mp_raise_ValueError("callback must be None or a callable object"); } return mp_const_none; } diff --git a/unix/file.c b/unix/file.c index f27e23547..0d65f9ca0 100644 --- a/unix/file.c +++ b/unix/file.c @@ -47,7 +47,7 @@ #ifdef MICROPY_CPYTHON_COMPAT STATIC void check_fd_is_open(const mp_obj_fdfile_t *o) { if (o->fd < 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "I/O operation on closed file")); + mp_raise_ValueError("I/O operation on closed file"); } } #else diff --git a/unix/modffi.c b/unix/modffi.c index 6c5e4f22e..9b514371b 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -409,7 +409,7 @@ STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const } error: - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "Don't know how to pass object to native function")); + mp_raise_TypeError("Don't know how to pass object to native function"); } STATIC const mp_obj_type_t ffifunc_type = { diff --git a/unix/modjni.c b/unix/modjni.c index 540964d44..df9cd9d67 100644 --- a/unix/modjni.c +++ b/unix/modjni.c @@ -268,7 +268,7 @@ STATIC mp_obj_t jobject_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) return mp_const_none; } } - mp_not_implemented(""); + mp_raise_NotImplementedError(""); } if (!JJ(IsInstanceOf, self->obj, List_class)) { From c127ace28a4faeb93ef86743c703a14258137efc Mon Sep 17 00:00:00 2001 From: Javier Candeira Date: Mon, 14 Aug 2017 15:42:25 +1000 Subject: [PATCH 318/403] docs/library/machine.RTC.rst: Fix typo. --- docs/library/machine.RTC.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/library/machine.RTC.rst b/docs/library/machine.RTC.rst index 2a53b9146..95fa2b4ce 100644 --- a/docs/library/machine.RTC.rst +++ b/docs/library/machine.RTC.rst @@ -38,7 +38,7 @@ Methods Resets the RTC to the time of January 1, 2015 and starts running it again. -.. method:: RTC.alarm(id, time, /*, repeat=False) +.. method:: RTC.alarm(id, time, \*, repeat=False) Set the RTC alarm. Time might be either a millisecond value to program the alarm to current time + time_in_ms in the future, or a datetimetuple. If the time passed is in From a14ce77b28146526661c79c89b2e6ff6837c2bb0 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 12 Aug 2017 14:40:49 +0200 Subject: [PATCH 319/403] py/binary.c: Fix bug when packing big-endian 'Q' values. Without bugfix: struct.pack('>Q', 16) b'\x00\x00\x00\x10\x00\x00\x00\x00' With bugfix: struct.pack('>Q', 16) b'\x00\x00\x00\x00\x00\x00\x00\x10' --- py/binary.c | 5 ++++- tests/basics/struct1_intbig.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/py/binary.c b/py/binary.c index e38aae8ea..870a0942b 100644 --- a/py/binary.c +++ b/py/binary.c @@ -303,7 +303,10 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte ** // zero/sign extend if needed if (BYTES_PER_WORD < 8 && size > sizeof(val)) { int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00; - memset(p + sizeof(val), c, size - sizeof(val)); + memset(p, c, size); + if (struct_type == '>') { + p += size - sizeof(val); + } } } } diff --git a/tests/basics/struct1_intbig.py b/tests/basics/struct1_intbig.py index b1fec527e..380293f36 100644 --- a/tests/basics/struct1_intbig.py +++ b/tests/basics/struct1_intbig.py @@ -12,6 +12,8 @@ print(struct.pack("Q", 1)) print(struct.pack("Q", 2**64 - 1)) print(struct.pack(" Date: Mon, 24 Jul 2017 18:55:14 +0200 Subject: [PATCH 320/403] py: Add verbose debug compile-time flag MICROPY_DEBUG_VERBOSE. It enables all the DEBUG_printf outputs in the py/ source code. --- py/bc.c | 2 +- py/builtinimport.c | 2 +- py/emitglue.c | 2 +- py/emitnative.c | 2 +- py/gc.c | 2 +- py/malloc.c | 2 +- py/modthread.c | 2 +- py/mpconfig.h | 5 +++++ py/nativeglue.c | 2 +- py/objfun.c | 2 +- py/objtype.c | 2 +- py/qstr.c | 2 +- py/runtime.c | 2 +- 13 files changed, 17 insertions(+), 12 deletions(-) diff --git a/py/bc.c b/py/bc.c index 522eb0aeb..917eba57d 100644 --- a/py/bc.c +++ b/py/bc.c @@ -35,7 +35,7 @@ #include "py/bc0.h" #include "py/bc.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #else // don't print debugging info #define DEBUG_PRINT (0) diff --git a/py/builtinimport.c b/py/builtinimport.c index e0ce91d9b..f5bfb0d98 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -37,7 +37,7 @@ #include "py/builtin.h" #include "py/frozenmod.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #define DEBUG_printf DEBUG_printf #else // don't print debugging info diff --git a/py/emitglue.c b/py/emitglue.c index 383e6a136..d2add988f 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -35,7 +35,7 @@ #include "py/runtime0.h" #include "py/bc.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #define WRITE_CODE (1) #define DEBUG_printf DEBUG_printf diff --git a/py/emitnative.c b/py/emitnative.c index 7ce619625..4608cd1e0 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -50,7 +50,7 @@ #include "py/emit.h" #include "py/bc.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #define DEBUG_printf DEBUG_printf #else // don't print debugging info diff --git a/py/gc.c b/py/gc.c index 7253b7db6..3a505e9c7 100644 --- a/py/gc.c +++ b/py/gc.c @@ -35,7 +35,7 @@ #if MICROPY_ENABLE_GC -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #define DEBUG_printf DEBUG_printf #else // don't print debugging info diff --git a/py/malloc.c b/py/malloc.c index e679e2092..af4ccf2e8 100644 --- a/py/malloc.c +++ b/py/malloc.c @@ -32,7 +32,7 @@ #include "py/misc.h" #include "py/mpstate.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_printf DEBUG_printf #else // don't print debugging info #define DEBUG_printf(...) (void)0 diff --git a/py/modthread.c b/py/modthread.c index 1d7602789..bf74128e8 100644 --- a/py/modthread.c +++ b/py/modthread.c @@ -34,7 +34,7 @@ #include "py/mpthread.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #define DEBUG_printf DEBUG_printf #else // don't print debugging info diff --git a/py/mpconfig.h b/py/mpconfig.h index 0e76a1ff5..dac8a903c 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -373,6 +373,11 @@ #define MICROPY_DEBUG_PRINTERS (0) #endif +// Whether to enable all debugging outputs (it will be extremely verbose) +#ifndef MICROPY_DEBUG_VERBOSE +#define MICROPY_DEBUG_VERBOSE (0) +#endif + /*****************************************************************************/ /* Optimisations */ diff --git a/py/nativeglue.c b/py/nativeglue.c index 46c6906d9..e954234c2 100644 --- a/py/nativeglue.c +++ b/py/nativeglue.c @@ -34,7 +34,7 @@ #include "py/emitglue.h" #include "py/bc.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_printf DEBUG_printf #else // don't print debugging info #define DEBUG_printf(...) (void)0 diff --git a/py/objfun.c b/py/objfun.c index eaba13129..5606511d8 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -36,7 +36,7 @@ #include "py/bc.h" #include "py/stackctrl.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #else // don't print debugging info #define DEBUG_PRINT (0) diff --git a/py/objtype.c b/py/objtype.c index 87c0cc9e5..e1a24da7e 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -35,7 +35,7 @@ #include "py/runtime0.h" #include "py/runtime.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #define DEBUG_printf DEBUG_printf #else // don't print debugging info diff --git a/py/qstr.c b/py/qstr.c index fdb38f1de..95c9b6835 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -36,7 +36,7 @@ // ultimately we will replace this with a static hash table of some kind // also probably need to include the length in the string data, to allow null bytes in the string -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_printf DEBUG_printf #else // don't print debugging info #define DEBUG_printf(...) (void)0 diff --git a/py/runtime.c b/py/runtime.c index 9c3edeb9c..eb1298813 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -44,7 +44,7 @@ #include "py/stackctrl.h" #include "py/gc.h" -#if 0 // print debugging info +#if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) #define DEBUG_printf DEBUG_printf #define DEBUG_OP_printf(...) DEBUG_printf(__VA_ARGS__) From 7a7a7e51ed9b601f6c15e423e739752ace404a19 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 16 Aug 2017 00:37:50 +0200 Subject: [PATCH 321/403] add justifyTop when drawing text in an ugfx list item. --- esp32/ugfx_widgets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/ugfx_widgets.c b/esp32/ugfx_widgets.c index 7055618d5..e2fd76aac 100644 --- a/esp32/ugfx_widgets.c +++ b/esp32/ugfx_widgets.c @@ -635,7 +635,7 @@ void BWgwinListDefaultDraw(GWidgetObject* gw, void* param) { } } #endif - gdispGFillStringBox(gw->g.display, gw->g.x+x+LST_HORIZ_PAD, gw->g.y+y, iwidth-LST_HORIZ_PAD, iheight, qi2li->text, gw->g.font, text, fill, justifyLeft); + gdispGFillStringBox(gw->g.display, gw->g.x+x+LST_HORIZ_PAD, gw->g.y+y, iwidth-LST_HORIZ_PAD, iheight, qi2li->text, gw->g.font, text, fill, justifyLeft | justifyTop); } // Fill any remaining item space From d033ba24b3917599c0284a28c5c90ff6a9635b11 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 16 Aug 2017 00:51:11 +0200 Subject: [PATCH 322/403] when the splash screen doesn't start, revert to default splash screen. this most often happens when someone just uninstalled an egg. --- esp32/modules/boot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/esp32/modules/boot.py b/esp32/modules/boot.py index d128e87e4..b0b522f13 100644 --- a/esp32/modules/boot.py +++ b/esp32/modules/boot.py @@ -14,6 +14,7 @@ splash = 'splash' else: splash = badge.nvs_get_str('boot','splash','splash') + if machine.reset_cause() != machine.DEEPSLEEP_RESET: print('[BOOT] Cold boot') else: @@ -23,6 +24,7 @@ splash = load_me print("starting %s" % load_me) esp.rtcmem_write_string("") + try: if not splash=="shell": __import__(splash) @@ -30,6 +32,11 @@ ugfx.clear(ugfx.WHITE) ugfx.flush(ugfx.LUT_FULL) except BaseException as e: + # if we started the splash screen and it is not the default splash screen, + # then revert to original splash screen. + if splash == badge.nvs_get_str('boot', 'splash', 'splash') and splash != 'splash': + badge.nvs_erase_key('boot', 'splash') + sys.print_exception(e) import easydraw easydraw.msg("A fatal error occured!","Still Crashing Anyway", True) From 34ce3bae49f9d203fc54929f49f259a850645986 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 26 Jul 2017 12:51:46 +1000 Subject: [PATCH 323/403] extmod/machine_signal: Fix parsing of invert arg when Pin is first arg. --- extmod/machine_signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/machine_signal.c b/extmod/machine_signal.c index d08931296..78d0c3fee 100644 --- a/extmod/machine_signal.c +++ b/extmod/machine_signal.c @@ -96,7 +96,7 @@ STATIC mp_obj_t signal_make_new(const mp_obj_type_t *type, size_t n_args, size_t if (n_args == 1) { if (n_kw == 0) { } else if (n_kw == 1 && args[1] == MP_OBJ_NEW_QSTR(MP_QSTR_invert)) { - invert = mp_obj_is_true(args[1]); + invert = mp_obj_is_true(args[2]); } else { goto error; } From 53f62d2d2a652d015f9be48959df434804e33ec1 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 27 Jul 2017 14:41:27 +0300 Subject: [PATCH 324/403] tools/mpy_bin2res: Tools to convert binary resources to Python module. Afterwards, they can be access using pkg_resource module from micropython-lib. --- tools/mpy_bin2res.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 tools/mpy_bin2res.py diff --git a/tools/mpy_bin2res.py b/tools/mpy_bin2res.py new file mode 100755 index 000000000..0c89e7e92 --- /dev/null +++ b/tools/mpy_bin2res.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# +# This tool converts binary resource files passed on the command line +# into a Python source file containing data from these files, which can +# be accessed using standard pkg_resources.resource_stream() function +# from micropython-lib: +# https://github.com/micropython/micropython-lib/tree/master/pkg_resources +# +import sys + +print("R = {") + +for fname in sys.argv[1:]: + with open(fname, "rb") as f: + b = f.read() + print("%r: %r," % (fname, b)) + +print("}") From eacd365fe397a8b0a1dc30a198d64384d0ec4549 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 28 Jul 2017 17:24:31 +0300 Subject: [PATCH 325/403] .travis.yml: Pin cpp-coveralls at 0.3.12. Next version, 0.4.0 appears to depend on newer version of urllib3 and conflicts with version installed in Travis. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9915cdd00..14d5df0a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,8 @@ before_script: # For teensy build - sudo apt-get install realpath # For coverage testing - - sudo pip install cpp-coveralls + # cpp-coveralls 0.4 conflicts with urllib3 preinstalled in Travis VM + - sudo pip install cpp-coveralls==0.3.12 - gcc --version - arm-none-eabi-gcc --version - python3 --version From 134ded2a0ba9091d2ba38a5e6db263f931599a17 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 28 Jul 2017 21:41:42 +0300 Subject: [PATCH 326/403] py/modio: BufferedWriter: Convert to mp_rom_map_elem_t. --- py/modio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py/modio.c b/py/modio.c index 2d317d022..a6a093278 100644 --- a/py/modio.c +++ b/py/modio.c @@ -112,9 +112,9 @@ STATIC mp_obj_t bufwriter_flush(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bufwriter_flush_obj, bufwriter_flush); -STATIC const mp_map_elem_t bufwriter_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flush), (mp_obj_t)&bufwriter_flush_obj }, +STATIC const mp_rom_map_elem_t bufwriter_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&bufwriter_flush_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bufwriter_locals_dict, bufwriter_locals_dict_table); @@ -127,7 +127,7 @@ STATIC const mp_obj_type_t bufwriter_type = { .name = MP_QSTR_BufferedWriter, .make_new = bufwriter_make_new, .protocol = &bufwriter_stream_p, - .locals_dict = (mp_obj_t)&bufwriter_locals_dict, + .locals_dict = (mp_obj_dict_t*)&bufwriter_locals_dict, }; #endif // MICROPY_PY_IO_BUFFEREDWRITER From 919d2d3cd5eeed4c9767d730274655bdee02b38c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 29 Jul 2017 10:26:41 +0300 Subject: [PATCH 327/403] extmod/modframebuf: Use correct initialization for .locals_dict. --- extmod/modframebuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index 779214bb7..d3318899a 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -549,7 +549,7 @@ STATIC const mp_obj_type_t mp_type_framebuf = { .name = MP_QSTR_FrameBuffer, .make_new = framebuf_make_new, .buffer_p = { .get_buffer = framebuf_get_buffer }, - .locals_dict = (mp_obj_t)&framebuf_locals_dict, + .locals_dict = (mp_obj_dict_t*)&framebuf_locals_dict, }; // this factory function is provided for backwards compatibility with old FrameBuffer1 class From 6cf327eb9a7152ac14ffe1a055e896778c41c0d2 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 29 Jul 2017 18:09:33 +0300 Subject: [PATCH 328/403] extmod/mod{lwip,onewire,webrepl}: Convert to mp_rom_map_elem_t. --- extmod/modlwip.c | 82 ++++++++++++++++++++++----------------------- extmod/modonewire.c | 14 ++++---- extmod/modwebrepl.c | 20 +++++------ 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 01190d200..48b4190e9 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -5,7 +5,7 @@ * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Galen Hazelwood - * Copyright (c) 2015-2016 Paul Sokolovsky + * Copyright (c) 2015-2017 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -148,8 +148,8 @@ STATIC mp_obj_t lwip_slip_status(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(lwip_slip_status_obj, lwip_slip_status); -STATIC const mp_map_elem_t lwip_slip_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_status), (mp_obj_t)&lwip_slip_status_obj }, +STATIC const mp_rom_map_elem_t lwip_slip_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_status), MP_ROM_PTR(&lwip_slip_status_obj) }, }; STATIC MP_DEFINE_CONST_DICT(lwip_slip_locals_dict, lwip_slip_locals_dict_table); @@ -158,7 +158,7 @@ STATIC const mp_obj_type_t lwip_slip_type = { { &mp_type_type }, .name = MP_QSTR_slip, .make_new = lwip_slip_make_new, - .locals_dict = (mp_obj_t)&lwip_slip_locals_dict, + .locals_dict = (mp_obj_dict_t*)&lwip_slip_locals_dict, }; #endif // MICROPY_PY_LWIP_SLIP @@ -1160,27 +1160,27 @@ STATIC mp_uint_t lwip_socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_ return ret; } -STATIC const mp_map_elem_t lwip_socket_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___del__), (mp_obj_t)&lwip_socket_close_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&lwip_socket_close_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_bind), (mp_obj_t)&lwip_socket_bind_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_listen), (mp_obj_t)&lwip_socket_listen_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_accept), (mp_obj_t)&lwip_socket_accept_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_connect), (mp_obj_t)&lwip_socket_connect_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_send), (mp_obj_t)&lwip_socket_send_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_recv), (mp_obj_t)&lwip_socket_recv_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_sendto), (mp_obj_t)&lwip_socket_sendto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_recvfrom), (mp_obj_t)&lwip_socket_recvfrom_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_sendall), (mp_obj_t)&lwip_socket_sendall_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_settimeout), (mp_obj_t)&lwip_socket_settimeout_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_setblocking), (mp_obj_t)&lwip_socket_setblocking_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_setsockopt), (mp_obj_t)&lwip_socket_setsockopt_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_makefile), (mp_obj_t)&lwip_socket_makefile_obj }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&mp_stream_read_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), (mp_obj_t)&mp_stream_readinto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_readline), (mp_obj_t)&mp_stream_unbuffered_readline_obj}, - { MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj }, +STATIC const mp_rom_map_elem_t lwip_socket_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&lwip_socket_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&lwip_socket_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&lwip_socket_bind_obj) }, + { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&lwip_socket_listen_obj) }, + { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&lwip_socket_accept_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&lwip_socket_connect_obj) }, + { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&lwip_socket_send_obj) }, + { MP_ROM_QSTR(MP_QSTR_recv), MP_ROM_PTR(&lwip_socket_recv_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&lwip_socket_sendto_obj) }, + { MP_ROM_QSTR(MP_QSTR_recvfrom), MP_ROM_PTR(&lwip_socket_recvfrom_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendall), MP_ROM_PTR(&lwip_socket_sendall_obj) }, + { MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&lwip_socket_settimeout_obj) }, + { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&lwip_socket_setblocking_obj) }, + { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&lwip_socket_setsockopt_obj) }, + { MP_ROM_QSTR(MP_QSTR_makefile), MP_ROM_PTR(&lwip_socket_makefile_obj) }, + + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, }; STATIC MP_DEFINE_CONST_DICT(lwip_socket_locals_dict, lwip_socket_locals_dict_table); @@ -1196,7 +1196,7 @@ STATIC const mp_obj_type_t lwip_socket_type = { .print = lwip_socket_print, .make_new = lwip_socket_make_new, .protocol = &lwip_socket_stream_p, - .locals_dict = (mp_obj_t)&lwip_socket_locals_dict, + .locals_dict = (mp_obj_dict_t*)&lwip_socket_locals_dict, }; /******************************************************************************/ @@ -1321,27 +1321,27 @@ MP_DEFINE_CONST_FUN_OBJ_0(lwip_print_pcbs_obj, lwip_print_pcbs); #ifdef MICROPY_PY_LWIP -STATIC const mp_map_elem_t mp_module_lwip_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_lwip) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_reset), (mp_obj_t)&mod_lwip_reset_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_callback), (mp_obj_t)&mod_lwip_callback_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_getaddrinfo), (mp_obj_t)&lwip_getaddrinfo_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_print_pcbs), (mp_obj_t)&lwip_print_pcbs_obj }, +STATIC const mp_rom_map_elem_t mp_module_lwip_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_lwip) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&mod_lwip_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_callback), MP_ROM_PTR(&mod_lwip_callback_obj) }, + { MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&lwip_getaddrinfo_obj) }, + { MP_ROM_QSTR(MP_QSTR_print_pcbs), MP_ROM_PTR(&lwip_print_pcbs_obj) }, // objects - { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&lwip_socket_type }, + { MP_ROM_QSTR(MP_QSTR_socket), MP_ROM_PTR(&lwip_socket_type) }, #ifdef MICROPY_PY_LWIP_SLIP - { MP_OBJ_NEW_QSTR(MP_QSTR_slip), (mp_obj_t)&lwip_slip_type }, + { MP_ROM_QSTR(MP_QSTR_slip), MP_ROM_PTR(&lwip_slip_type) }, #endif // class constants - { MP_OBJ_NEW_QSTR(MP_QSTR_AF_INET), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AF_INET6), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET6) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET6) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOCK_STREAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOCK_DGRAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_DGRAM) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOCK_RAW), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_RAW) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_DGRAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_RAW) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SOL_SOCKET), MP_OBJ_NEW_SMALL_INT(1) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SO_REUSEADDR), MP_OBJ_NEW_SMALL_INT(SOF_REUSEADDR) }, + { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_OBJ_NEW_SMALL_INT(1) }, + { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_OBJ_NEW_SMALL_INT(SOF_REUSEADDR) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_lwip_globals, mp_module_lwip_globals_table); diff --git a/extmod/modonewire.c b/extmod/modonewire.c index 8583cc1c2..53c9456c2 100644 --- a/extmod/modonewire.c +++ b/extmod/modonewire.c @@ -143,15 +143,15 @@ STATIC mp_obj_t onewire_crc8(mp_obj_t data) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(onewire_crc8_obj, onewire_crc8); -STATIC const mp_map_elem_t onewire_module_globals_table[] = { +STATIC const mp_rom_map_elem_t onewire_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_onewire) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR((mp_obj_t)&onewire_reset_obj) }, - { MP_ROM_QSTR(MP_QSTR_readbit), MP_ROM_PTR((mp_obj_t)&onewire_readbit_obj) }, - { MP_ROM_QSTR(MP_QSTR_readbyte), MP_ROM_PTR((mp_obj_t)&onewire_readbyte_obj) }, - { MP_ROM_QSTR(MP_QSTR_writebit), MP_ROM_PTR((mp_obj_t)&onewire_writebit_obj) }, - { MP_ROM_QSTR(MP_QSTR_writebyte), MP_ROM_PTR((mp_obj_t)&onewire_writebyte_obj) }, - { MP_ROM_QSTR(MP_QSTR_crc8), MP_ROM_PTR((mp_obj_t)&onewire_crc8_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&onewire_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_readbit), MP_ROM_PTR(&onewire_readbit_obj) }, + { MP_ROM_QSTR(MP_QSTR_readbyte), MP_ROM_PTR(&onewire_readbyte_obj) }, + { MP_ROM_QSTR(MP_QSTR_writebit), MP_ROM_PTR(&onewire_writebit_obj) }, + { MP_ROM_QSTR(MP_QSTR_writebyte), MP_ROM_PTR(&onewire_writebyte_obj) }, + { MP_ROM_QSTR(MP_QSTR_crc8), MP_ROM_PTR(&onewire_crc8_obj) }, }; STATIC MP_DEFINE_CONST_DICT(onewire_module_globals, onewire_module_globals_table); diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c index 9e3f16fe7..d618f5370 100644 --- a/extmod/modwebrepl.c +++ b/extmod/modwebrepl.c @@ -317,11 +317,11 @@ STATIC mp_obj_t webrepl_set_password(mp_obj_t passwd_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(webrepl_set_password_obj, webrepl_set_password); -STATIC const mp_map_elem_t webrepl_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&mp_stream_read_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), (mp_obj_t)&mp_stream_readinto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&webrepl_close_obj }, +STATIC const mp_rom_map_elem_t webrepl_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_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_close), MP_ROM_PTR(&webrepl_close_obj) }, }; STATIC MP_DEFINE_CONST_DICT(webrepl_locals_dict, webrepl_locals_dict_table); @@ -335,13 +335,13 @@ STATIC const mp_obj_type_t webrepl_type = { .name = MP_QSTR__webrepl, .make_new = webrepl_make_new, .protocol = &webrepl_stream_p, - .locals_dict = (mp_obj_t)&webrepl_locals_dict, + .locals_dict = (mp_obj_dict_t*)&webrepl_locals_dict, }; -STATIC const mp_map_elem_t webrepl_module_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR__webrepl) }, - { MP_OBJ_NEW_QSTR(MP_QSTR__webrepl), (mp_obj_t)&webrepl_type }, - { MP_OBJ_NEW_QSTR(MP_QSTR_password), (mp_obj_t)&webrepl_set_password_obj }, +STATIC const mp_rom_map_elem_t webrepl_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__webrepl) }, + { MP_ROM_QSTR(MP_QSTR__webrepl), MP_ROM_PTR(&webrepl_type) }, + { MP_ROM_QSTR(MP_QSTR_password), MP_ROM_PTR(&webrepl_set_password_obj) }, }; STATIC MP_DEFINE_CONST_DICT(webrepl_module_globals, webrepl_module_globals_table); From f3190e024c3bdbddd7ecf599d954421111b5799c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 30 Jul 2017 10:03:14 +0300 Subject: [PATCH 329/403] unix/modjni: Convert to mp_rom_map_elem_t. --- unix/modjni.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/unix/modjni.c b/unix/modjni.c index 0aeb0601f..896f2f919 100644 --- a/unix/modjni.c +++ b/unix/modjni.c @@ -168,9 +168,9 @@ STATIC mp_obj_t jclass_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const return call_method(self->cls, NULL, methods, true, n_args, args); } -STATIC const mp_map_elem_t jclass_locals_dict_table[] = { -// { MP_OBJ_NEW_QSTR(MP_QSTR_get), (mp_obj_t)&ffivar_get_obj }, -// { MP_OBJ_NEW_QSTR(MP_QSTR_set), (mp_obj_t)&ffivar_set_obj }, +STATIC const mp_rom_map_elem_t jclass_locals_dict_table[] = { +// { MP_ROM_QSTR(MP_QSTR_get), MP_ROM_PTR(&ffivar_get_obj) }, +// { MP_ROM_QSTR(MP_QSTR_set), MP_ROM_PTR(&ffivar_set_obj) }, }; STATIC MP_DEFINE_CONST_DICT(jclass_locals_dict, jclass_locals_dict_table); @@ -181,7 +181,7 @@ STATIC const mp_obj_type_t jclass_type = { .print = jclass_print, .attr = jclass_attr, .call = jclass_call, - .locals_dict = (mp_obj_t)&jclass_locals_dict, + .locals_dict = (mp_obj_dict_t*)&jclass_locals_dict, }; STATIC mp_obj_t new_jclass(jclass jc) { @@ -331,7 +331,7 @@ STATIC const mp_obj_type_t jobject_type = { .attr = jobject_attr, .subscr = jobject_subscr, .getiter = subscr_getiter, -// .locals_dict = (mp_obj_t)&jobject_locals_dict, +// .locals_dict = (mp_obj_dict_t*)&jobject_locals_dict, }; STATIC mp_obj_t new_jobject(jobject jo) { @@ -578,7 +578,7 @@ STATIC const mp_obj_type_t jmethod_type = { .print = jmethod_print, .call = jmethod_call, // .attr = jobject_attr, -// .locals_dict = (mp_obj_t)&jobject_locals_dict, +// .locals_dict = (mp_obj_dict_t*)&jobject_locals_dict, }; #ifdef __ANDROID__ @@ -707,11 +707,11 @@ STATIC mp_obj_t mod_jni_env() { } MP_DEFINE_CONST_FUN_OBJ_0(mod_jni_env_obj, mod_jni_env); -STATIC const mp_map_elem_t mp_module_jni_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_jni) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_cls), (mp_obj_t)&mod_jni_cls_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_array), (mp_obj_t)&mod_jni_array_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_env), (mp_obj_t)&mod_jni_env_obj }, +STATIC const mp_rom_map_elem_t mp_module_jni_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_jni) }, + { MP_ROM_QSTR(MP_QSTR_cls), MP_ROM_PTR(&mod_jni_cls_obj) }, + { MP_ROM_QSTR(MP_QSTR_array), MP_ROM_PTR(&mod_jni_array_obj) }, + { MP_ROM_QSTR(MP_QSTR_env), MP_ROM_PTR(&mod_jni_env_obj) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_jni_globals, mp_module_jni_globals_table); From a127c47586fb9a8b83f2fde0db8117e753e8377f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 30 Jul 2017 12:35:57 +0300 Subject: [PATCH 330/403] esp8266/modesp: Remove unused constants: STA_MODE, etc. WiFi mode selection happens on the level of individual interfaces. --- esp8266/modesp.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/esp8266/modesp.c b/esp8266/modesp.c index 5eaae27d6..b85a05ccb 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -384,13 +384,6 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = { MP_OBJ_NEW_SMALL_INT(LIGHT_SLEEP_T) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_MODEM), MP_OBJ_NEW_SMALL_INT(MODEM_SLEEP_T) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_STA_MODE), - MP_OBJ_NEW_SMALL_INT(STATION_MODE)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_AP_MODE), - MP_OBJ_NEW_SMALL_INT(SOFTAP_MODE)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STA_AP_MODE), - MP_OBJ_NEW_SMALL_INT(STATIONAP_MODE)}, #endif }; From 168129bf2c678b7f22e31317877faa1a6f20f906 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 30 Jul 2017 18:13:01 +0300 Subject: [PATCH 331/403] esp8266: Convert to mp_rom_map_elem_t. --- esp8266/machine_adc.c | 6 ++-- esp8266/machine_pin.c | 32 ++++++++--------- esp8266/machine_rtc.c | 16 ++++----- esp8266/machine_wdt.c | 8 ++--- esp8266/modesp.c | 55 ++++++++++++++-------------- esp8266/modmachine.c | 14 ++++---- esp8266/modnetwork.c | 84 ++++++++++++++++++------------------------- 7 files changed, 98 insertions(+), 117 deletions(-) diff --git a/esp8266/machine_adc.c b/esp8266/machine_adc.c index f1fb5be31..73ec05208 100644 --- a/esp8266/machine_adc.c +++ b/esp8266/machine_adc.c @@ -70,8 +70,8 @@ STATIC mp_obj_t pyb_adc_read(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_adc_read_obj, pyb_adc_read); -STATIC const mp_map_elem_t pyb_adc_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&pyb_adc_read_obj } +STATIC const mp_rom_map_elem_t pyb_adc_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&pyb_adc_read_obj) } }; STATIC MP_DEFINE_CONST_DICT(pyb_adc_locals_dict, pyb_adc_locals_dict_table); @@ -79,5 +79,5 @@ const mp_obj_type_t pyb_adc_type = { { &mp_type_type }, .name = MP_QSTR_ADC, .make_new = pyb_adc_make_new, - .locals_dict = (mp_obj_t)&pyb_adc_locals_dict, + .locals_dict = (mp_obj_dict_t*)&pyb_adc_locals_dict, }; diff --git a/esp8266/machine_pin.c b/esp8266/machine_pin.c index febbc1587..6f75a0a6a 100644 --- a/esp8266/machine_pin.c +++ b/esp8266/machine_pin.c @@ -426,24 +426,24 @@ STATIC mp_uint_t pin_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, i return -1; } -STATIC const mp_map_elem_t pyb_pin_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t pyb_pin_locals_dict_table[] = { // instance methods - { MP_OBJ_NEW_QSTR(MP_QSTR_init), (mp_obj_t)&pyb_pin_init_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_value), (mp_obj_t)&pyb_pin_value_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_off), (mp_obj_t)&pyb_pin_off_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_on), (mp_obj_t)&pyb_pin_on_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_irq), (mp_obj_t)&pyb_pin_irq_obj }, + { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&pyb_pin_init_obj) }, + { MP_ROM_QSTR(MP_QSTR_value), MP_ROM_PTR(&pyb_pin_value_obj) }, + { MP_ROM_QSTR(MP_QSTR_off), MP_ROM_PTR(&pyb_pin_off_obj) }, + { MP_ROM_QSTR(MP_QSTR_on), MP_ROM_PTR(&pyb_pin_on_obj) }, + { MP_ROM_QSTR(MP_QSTR_irq), MP_ROM_PTR(&pyb_pin_irq_obj) }, // class constants - { MP_OBJ_NEW_QSTR(MP_QSTR_IN), MP_OBJ_NEW_SMALL_INT(GPIO_MODE_INPUT) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_OUT), MP_OBJ_NEW_SMALL_INT(GPIO_MODE_OUTPUT) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_OPEN_DRAIN), MP_OBJ_NEW_SMALL_INT(GPIO_MODE_OPEN_DRAIN) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_PULL_UP), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_UP) }, - //{ MP_OBJ_NEW_QSTR(MP_QSTR_PULL_DOWN), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_DOWN) }, - - // IRG triggers, can be or'd together - { MP_OBJ_NEW_QSTR(MP_QSTR_IRQ_RISING), MP_OBJ_NEW_SMALL_INT(GPIO_PIN_INTR_POSEDGE) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_IRQ_FALLING), MP_OBJ_NEW_SMALL_INT(GPIO_PIN_INTR_NEGEDGE) }, + { MP_ROM_QSTR(MP_QSTR_IN), MP_ROM_INT(GPIO_MODE_INPUT) }, + { MP_ROM_QSTR(MP_QSTR_OUT), MP_ROM_INT(GPIO_MODE_OUTPUT) }, + { MP_ROM_QSTR(MP_QSTR_OPEN_DRAIN), MP_ROM_INT(GPIO_MODE_OPEN_DRAIN) }, + { MP_ROM_QSTR(MP_QSTR_PULL_UP), MP_ROM_INT(GPIO_PULL_UP) }, + //{ MP_ROM_QSTR(MP_QSTR_PULL_DOWN), MP_ROM_INT(GPIO_PULL_DOWN) }, + + // IRQ triggers, can be or'd together + { MP_ROM_QSTR(MP_QSTR_IRQ_RISING), MP_ROM_INT(GPIO_PIN_INTR_POSEDGE) }, + { MP_ROM_QSTR(MP_QSTR_IRQ_FALLING), MP_ROM_INT(GPIO_PIN_INTR_NEGEDGE) }, }; STATIC MP_DEFINE_CONST_DICT(pyb_pin_locals_dict, pyb_pin_locals_dict_table); @@ -459,7 +459,7 @@ const mp_obj_type_t pyb_pin_type = { .make_new = mp_pin_make_new, .call = pyb_pin_call, .protocol = &pin_pin_p, - .locals_dict = (mp_obj_t)&pyb_pin_locals_dict, + .locals_dict = (mp_obj_dict_t*)&pyb_pin_locals_dict, }; /******************************************************************************/ diff --git a/esp8266/machine_rtc.c b/esp8266/machine_rtc.c index b92ce1d5a..984e8b6e8 100644 --- a/esp8266/machine_rtc.c +++ b/esp8266/machine_rtc.c @@ -255,13 +255,13 @@ STATIC mp_obj_t pyb_rtc_irq(size_t n_args, const mp_obj_t *pos_args, mp_map_t *k } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_rtc_irq_obj, 1, pyb_rtc_irq); -STATIC const mp_map_elem_t pyb_rtc_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_datetime), (mp_obj_t)&pyb_rtc_datetime_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_memory), (mp_obj_t)&pyb_rtc_memory_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_alarm), (mp_obj_t)&pyb_rtc_alarm_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_alarm_left), (mp_obj_t)&pyb_rtc_alarm_left_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_irq), (mp_obj_t)&pyb_rtc_irq_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ALARM0), MP_OBJ_NEW_SMALL_INT(0) }, +STATIC const mp_rom_map_elem_t pyb_rtc_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_datetime), MP_ROM_PTR(&pyb_rtc_datetime_obj) }, + { MP_ROM_QSTR(MP_QSTR_memory), MP_ROM_PTR(&pyb_rtc_memory_obj) }, + { MP_ROM_QSTR(MP_QSTR_alarm), MP_ROM_PTR(&pyb_rtc_alarm_obj) }, + { MP_ROM_QSTR(MP_QSTR_alarm_left), MP_ROM_PTR(&pyb_rtc_alarm_left_obj) }, + { MP_ROM_QSTR(MP_QSTR_irq), MP_ROM_PTR(&pyb_rtc_irq_obj) }, + { MP_ROM_QSTR(MP_QSTR_ALARM0), MP_ROM_INT(0) }, }; STATIC MP_DEFINE_CONST_DICT(pyb_rtc_locals_dict, pyb_rtc_locals_dict_table); @@ -269,5 +269,5 @@ const mp_obj_type_t pyb_rtc_type = { { &mp_type_type }, .name = MP_QSTR_RTC, .make_new = pyb_rtc_make_new, - .locals_dict = (mp_obj_t)&pyb_rtc_locals_dict, + .locals_dict = (mp_obj_dict_t*)&pyb_rtc_locals_dict, }; diff --git a/esp8266/machine_wdt.c b/esp8266/machine_wdt.c index 83b5e8f32..5e23ff782 100644 --- a/esp8266/machine_wdt.c +++ b/esp8266/machine_wdt.c @@ -71,9 +71,9 @@ STATIC mp_obj_t machine_wdt_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_wdt_deinit_obj, machine_wdt_deinit); -STATIC const mp_map_elem_t machine_wdt_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_feed), (mp_obj_t)&machine_wdt_feed_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&machine_wdt_deinit_obj }, +STATIC const mp_rom_map_elem_t machine_wdt_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&machine_wdt_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&machine_wdt_deinit_obj) }, }; STATIC MP_DEFINE_CONST_DICT(machine_wdt_locals_dict, machine_wdt_locals_dict_table); @@ -81,5 +81,5 @@ const mp_obj_type_t esp_wdt_type = { { &mp_type_type }, .name = MP_QSTR_WDT, .make_new = machine_wdt_make_new, - .locals_dict = (mp_obj_t)&machine_wdt_locals_dict, + .locals_dict = (mp_obj_dict_t*)&machine_wdt_locals_dict, }; diff --git a/esp8266/modesp.c b/esp8266/modesp.c index b85a05ccb..1aec1f90e 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -347,43 +347,40 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp_set_native_code_location_obj, esp_set_nativ #endif -STATIC const mp_map_elem_t esp_module_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_esp) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_osdebug), (mp_obj_t)&esp_osdebug_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_sleep_type), (mp_obj_t)&esp_sleep_type_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_deepsleep), (mp_obj_t)&esp_deepsleep_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_id), (mp_obj_t)&esp_flash_id_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_read), (mp_obj_t)&esp_flash_read_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_write), (mp_obj_t)&esp_flash_write_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_erase), (mp_obj_t)&esp_flash_erase_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_size), (mp_obj_t)&esp_flash_size_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_flash_user_start), (mp_obj_t)&esp_flash_user_start_obj }, +STATIC const mp_rom_map_elem_t esp_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_esp) }, + + { MP_ROM_QSTR(MP_QSTR_osdebug), MP_ROM_PTR(&esp_osdebug_obj) }, + { MP_ROM_QSTR(MP_QSTR_sleep_type), MP_ROM_PTR(&esp_sleep_type_obj) }, + { MP_ROM_QSTR(MP_QSTR_deepsleep), MP_ROM_PTR(&esp_deepsleep_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_id), MP_ROM_PTR(&esp_flash_id_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_read), MP_ROM_PTR(&esp_flash_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_write), MP_ROM_PTR(&esp_flash_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_erase), MP_ROM_PTR(&esp_flash_erase_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_size), MP_ROM_PTR(&esp_flash_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_user_start), MP_ROM_PTR(&esp_flash_user_start_obj) }, #if MICROPY_ESP8266_NEOPIXEL - { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write), (mp_obj_t)&esp_neopixel_write_obj }, + { MP_ROM_QSTR(MP_QSTR_neopixel_write), MP_ROM_PTR(&esp_neopixel_write_obj) }, #endif #if MICROPY_ESP8266_APA102 - { MP_OBJ_NEW_QSTR(MP_QSTR_apa102_write), (mp_obj_t)&esp_apa102_write_obj }, + { MP_ROM_QSTR(MP_QSTR_apa102_write), MP_ROM_PTR(&esp_apa102_write_obj) }, #endif - { MP_OBJ_NEW_QSTR(MP_QSTR_dht_readinto), (mp_obj_t)&dht_readinto_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_freemem), (mp_obj_t)&esp_freemem_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_meminfo), (mp_obj_t)&esp_meminfo_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_check_fw), (mp_obj_t)&esp_check_fw_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, // TODO delete/rename/move elsewhere - { MP_OBJ_NEW_QSTR(MP_QSTR_malloc), (mp_obj_t)&esp_malloc_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_free), (mp_obj_t)&esp_free_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_esf_free_bufs), (mp_obj_t)&esp_esf_free_bufs_obj }, + { MP_ROM_QSTR(MP_QSTR_dht_readinto), MP_ROM_PTR(&dht_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_freemem), MP_ROM_PTR(&esp_freemem_obj) }, + { MP_ROM_QSTR(MP_QSTR_meminfo), MP_ROM_PTR(&esp_meminfo_obj) }, + { MP_ROM_QSTR(MP_QSTR_check_fw), MP_ROM_PTR(&esp_check_fw_obj) }, + { MP_ROM_QSTR(MP_QSTR_info), MP_ROM_PTR(&pyb_info_obj) }, // TODO delete/rename/move elsewhere + { MP_ROM_QSTR(MP_QSTR_malloc), MP_ROM_PTR(&esp_malloc_obj) }, + { MP_ROM_QSTR(MP_QSTR_free), MP_ROM_PTR(&esp_free_obj) }, + { MP_ROM_QSTR(MP_QSTR_esf_free_bufs), MP_ROM_PTR(&esp_esf_free_bufs_obj) }, #if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA - { MP_OBJ_NEW_QSTR(MP_QSTR_set_native_code_location), (mp_obj_t)&esp_set_native_code_location_obj }, + { MP_ROM_QSTR(MP_QSTR_set_native_code_location), MP_ROM_PTR(&esp_set_native_code_location_obj) }, #endif #if MODESP_INCLUDE_CONSTANTS - { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_NONE), - MP_OBJ_NEW_SMALL_INT(NONE_SLEEP_T) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_LIGHT), - MP_OBJ_NEW_SMALL_INT(LIGHT_SLEEP_T) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_MODEM), - MP_OBJ_NEW_SMALL_INT(MODEM_SLEEP_T) }, + { MP_ROM_QSTR(MP_QSTR_SLEEP_NONE), MP_ROM_INT(NONE_SLEEP_T) }, + { MP_ROM_QSTR(MP_QSTR_SLEEP_LIGHT), MP_ROM_INT(LIGHT_SLEEP_T) }, + { MP_ROM_QSTR(MP_QSTR_SLEEP_MODEM), MP_ROM_INT(MODEM_SLEEP_T) }, #endif }; diff --git a/esp8266/modmachine.c b/esp8266/modmachine.c index c26c63396..070e6fc54 100644 --- a/esp8266/modmachine.c +++ b/esp8266/modmachine.c @@ -193,12 +193,12 @@ STATIC mp_obj_t esp_timer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_timer_deinit_obj, esp_timer_deinit); -STATIC const mp_map_elem_t esp_timer_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&esp_timer_deinit_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_init), (mp_obj_t)&esp_timer_init_obj }, -// { MP_OBJ_NEW_QSTR(MP_QSTR_callback), (mp_obj_t)&esp_timer_callback_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ONE_SHOT), MP_OBJ_NEW_SMALL_INT(false) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_PERIODIC), MP_OBJ_NEW_SMALL_INT(true) }, +STATIC const mp_rom_map_elem_t esp_timer_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&esp_timer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&esp_timer_init_obj) }, +// { MP_ROM_QSTR(MP_QSTR_callback), MP_ROM_PTR(&esp_timer_callback_obj) }, + { MP_ROM_QSTR(MP_QSTR_ONE_SHOT), MP_ROM_INT(false) }, + { MP_ROM_QSTR(MP_QSTR_PERIODIC), MP_ROM_INT(true) }, }; STATIC MP_DEFINE_CONST_DICT(esp_timer_locals_dict, esp_timer_locals_dict_table); @@ -207,7 +207,7 @@ const mp_obj_type_t esp_timer_type = { .name = MP_QSTR_Timer, .print = esp_timer_print, .make_new = esp_timer_make_new, - .locals_dict = (mp_obj_t)&esp_timer_locals_dict, + .locals_dict = (mp_obj_dict_t*)&esp_timer_locals_dict, }; // this bit is unused in the Xtensa PS register diff --git a/esp8266/modnetwork.c b/esp8266/modnetwork.c index eb9d75e28..a621522d0 100644 --- a/esp8266/modnetwork.c +++ b/esp8266/modnetwork.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Paul Sokolovsky + * Copyright (c) 2015-2016 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -427,15 +427,15 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(esp_config_obj, 1, esp_config); -STATIC const mp_map_elem_t wlan_if_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_active), (mp_obj_t)&esp_active_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_connect), (mp_obj_t)&esp_connect_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_disconnect), (mp_obj_t)&esp_disconnect_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_status), (mp_obj_t)&esp_status_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_scan), (mp_obj_t)&esp_scan_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_isconnected), (mp_obj_t)&esp_isconnected_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_config), (mp_obj_t)&esp_config_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ifconfig), (mp_obj_t)&esp_ifconfig_obj }, +STATIC const mp_rom_map_elem_t wlan_if_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_active), MP_ROM_PTR(&esp_active_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&esp_connect_obj) }, + { MP_ROM_QSTR(MP_QSTR_disconnect), MP_ROM_PTR(&esp_disconnect_obj) }, + { MP_ROM_QSTR(MP_QSTR_status), MP_ROM_PTR(&esp_status_obj) }, + { MP_ROM_QSTR(MP_QSTR_scan), MP_ROM_PTR(&esp_scan_obj) }, + { MP_ROM_QSTR(MP_QSTR_isconnected), MP_ROM_PTR(&esp_isconnected_obj) }, + { MP_ROM_QSTR(MP_QSTR_config), MP_ROM_PTR(&esp_config_obj) }, + { MP_ROM_QSTR(MP_QSTR_ifconfig), MP_ROM_PTR(&esp_ifconfig_obj) }, }; STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table); @@ -443,7 +443,7 @@ STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table); const mp_obj_type_t wlan_if_type = { { &mp_type_type }, .name = MP_QSTR_WLAN, - .locals_dict = (mp_obj_t)&wlan_if_locals_dict, + .locals_dict = (mp_obj_dict_t*)&wlan_if_locals_dict, }; STATIC mp_obj_t esp_phy_mode(mp_uint_t n_args, const mp_obj_t *args) { @@ -456,47 +456,31 @@ STATIC mp_obj_t esp_phy_mode(mp_uint_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp_phy_mode_obj, 0, 1, esp_phy_mode); -STATIC const mp_map_elem_t mp_module_network_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_network) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_WLAN), (mp_obj_t)&get_wlan_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_phy_mode), (mp_obj_t)&esp_phy_mode_obj }, +STATIC const mp_rom_map_elem_t mp_module_network_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_network) }, + { MP_ROM_QSTR(MP_QSTR_WLAN), MP_ROM_PTR(&get_wlan_obj) }, + { MP_ROM_QSTR(MP_QSTR_phy_mode), MP_ROM_PTR(&esp_phy_mode_obj) }, #if MODNETWORK_INCLUDE_CONSTANTS - { MP_OBJ_NEW_QSTR(MP_QSTR_STA_IF), - MP_OBJ_NEW_SMALL_INT(STATION_IF)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_AP_IF), - MP_OBJ_NEW_SMALL_INT(SOFTAP_IF)}, - - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_IDLE), - MP_OBJ_NEW_SMALL_INT(STATION_IDLE)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_CONNECTING), - MP_OBJ_NEW_SMALL_INT(STATION_CONNECTING)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_WRONG_PASSWORD), - MP_OBJ_NEW_SMALL_INT(STATION_WRONG_PASSWORD)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_NO_AP_FOUND), - MP_OBJ_NEW_SMALL_INT(STATION_NO_AP_FOUND)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_CONNECT_FAIL), - MP_OBJ_NEW_SMALL_INT(STATION_CONNECT_FAIL)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_STAT_GOT_IP), - MP_OBJ_NEW_SMALL_INT(STATION_GOT_IP)}, - - { MP_OBJ_NEW_QSTR(MP_QSTR_MODE_11B), - MP_OBJ_NEW_SMALL_INT(PHY_MODE_11B) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MODE_11G), - MP_OBJ_NEW_SMALL_INT(PHY_MODE_11G) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MODE_11N), - MP_OBJ_NEW_SMALL_INT(PHY_MODE_11N) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_OPEN), - MP_OBJ_NEW_SMALL_INT(AUTH_OPEN) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WEP), - MP_OBJ_NEW_SMALL_INT(AUTH_WEP) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WPA_PSK), - MP_OBJ_NEW_SMALL_INT(AUTH_WPA_PSK) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WPA2_PSK), - MP_OBJ_NEW_SMALL_INT(AUTH_WPA2_PSK) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_AUTH_WPA_WPA2_PSK), - MP_OBJ_NEW_SMALL_INT(AUTH_WPA_WPA2_PSK) }, + { MP_ROM_QSTR(MP_QSTR_STA_IF), MP_ROM_INT(STATION_IF)}, + { MP_ROM_QSTR(MP_QSTR_AP_IF), MP_ROM_INT(SOFTAP_IF)}, + + { MP_ROM_QSTR(MP_QSTR_STAT_IDLE), MP_ROM_INT(STATION_IDLE)}, + { MP_ROM_QSTR(MP_QSTR_STAT_CONNECTING), MP_ROM_INT(STATION_CONNECTING)}, + { MP_ROM_QSTR(MP_QSTR_STAT_WRONG_PASSWORD), MP_ROM_INT(STATION_WRONG_PASSWORD)}, + { MP_ROM_QSTR(MP_QSTR_STAT_NO_AP_FOUND), MP_ROM_INT(STATION_NO_AP_FOUND)}, + { MP_ROM_QSTR(MP_QSTR_STAT_CONNECT_FAIL), MP_ROM_INT(STATION_CONNECT_FAIL)}, + { MP_ROM_QSTR(MP_QSTR_STAT_GOT_IP), MP_ROM_INT(STATION_GOT_IP)}, + + { MP_ROM_QSTR(MP_QSTR_MODE_11B), MP_ROM_INT(PHY_MODE_11B) }, + { MP_ROM_QSTR(MP_QSTR_MODE_11G), MP_ROM_INT(PHY_MODE_11G) }, + { MP_ROM_QSTR(MP_QSTR_MODE_11N), MP_ROM_INT(PHY_MODE_11N) }, + + { MP_ROM_QSTR(MP_QSTR_AUTH_OPEN), MP_ROM_INT(AUTH_OPEN) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WEP), MP_ROM_INT(AUTH_WEP) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WPA_PSK), MP_ROM_INT(AUTH_WPA_PSK) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WPA2_PSK), MP_ROM_INT(AUTH_WPA2_PSK) }, + { MP_ROM_QSTR(MP_QSTR_AUTH_WPA_WPA2_PSK), MP_ROM_INT(AUTH_WPA_WPA2_PSK) }, #endif }; From d2c1dc8091ca0d65dceaeab1f5e5cba17d2936cd Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 31 Jul 2017 12:59:39 +1000 Subject: [PATCH 332/403] py/modsys: Use MP_ROM_INT for int values in an mp_rom_map_elem_t. --- py/modsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/modsys.c b/py/modsys.c index b8c427ba8..0a8f3cd50 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -168,7 +168,7 @@ 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_OBJ_NEW_SMALL_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) }, #endif From ca282b3131cd3f9e4cb30f6aad92e63c2de50cef Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 31 Jul 2017 13:00:34 +1000 Subject: [PATCH 333/403] extmod: Use MP_ROM_INT for int values in an mp_rom_map_elem_t. --- extmod/modframebuf.c | 12 ++++++------ extmod/modlwip.c | 14 +++++++------- extmod/moduselect.c | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index d3318899a..f4e857129 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -578,12 +578,12 @@ STATIC const mp_rom_map_elem_t framebuf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_framebuf) }, { MP_ROM_QSTR(MP_QSTR_FrameBuffer), MP_ROM_PTR(&mp_type_framebuf) }, { MP_ROM_QSTR(MP_QSTR_FrameBuffer1), MP_ROM_PTR(&legacy_framebuffer1_obj) }, - { MP_ROM_QSTR(MP_QSTR_MVLSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MVLSB) }, - { MP_ROM_QSTR(MP_QSTR_MONO_VLSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MVLSB) }, - { MP_ROM_QSTR(MP_QSTR_RGB565), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_RGB565) }, - { MP_ROM_QSTR(MP_QSTR_GS4_HMSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_GS4_HMSB) }, - { MP_ROM_QSTR(MP_QSTR_MONO_HLSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MHLSB) }, - { MP_ROM_QSTR(MP_QSTR_MONO_HMSB), MP_OBJ_NEW_SMALL_INT(FRAMEBUF_MHMSB) }, + { MP_ROM_QSTR(MP_QSTR_MVLSB), MP_ROM_INT(FRAMEBUF_MVLSB) }, + { MP_ROM_QSTR(MP_QSTR_MONO_VLSB), MP_ROM_INT(FRAMEBUF_MVLSB) }, + { MP_ROM_QSTR(MP_QSTR_RGB565), MP_ROM_INT(FRAMEBUF_RGB565) }, + { MP_ROM_QSTR(MP_QSTR_GS4_HMSB), MP_ROM_INT(FRAMEBUF_GS4_HMSB) }, + { MP_ROM_QSTR(MP_QSTR_MONO_HLSB), MP_ROM_INT(FRAMEBUF_MHLSB) }, + { MP_ROM_QSTR(MP_QSTR_MONO_HMSB), MP_ROM_INT(FRAMEBUF_MHMSB) }, }; STATIC MP_DEFINE_CONST_DICT(framebuf_module_globals, framebuf_module_globals_table); diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 48b4190e9..9d1a8c4d0 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -1333,15 +1333,15 @@ STATIC const mp_rom_map_elem_t mp_module_lwip_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_slip), MP_ROM_PTR(&lwip_slip_type) }, #endif // class constants - { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET) }, - { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET6) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(MOD_NETWORK_AF_INET) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(MOD_NETWORK_AF_INET6) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_DGRAM) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_RAW) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(MOD_NETWORK_SOCK_STREAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(MOD_NETWORK_SOCK_DGRAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(MOD_NETWORK_SOCK_RAW) }, - { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_OBJ_NEW_SMALL_INT(1) }, - { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_OBJ_NEW_SMALL_INT(SOF_REUSEADDR) }, + { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_ROM_INT(1) }, + { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_ROM_INT(SOF_REUSEADDR) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_lwip_globals, mp_module_lwip_globals_table); diff --git a/extmod/moduselect.c b/extmod/moduselect.c index 88dd29a49..2b8b87b5a 100644 --- a/extmod/moduselect.c +++ b/extmod/moduselect.c @@ -362,10 +362,10 @@ STATIC const mp_rom_map_elem_t mp_module_select_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uselect) }, { MP_ROM_QSTR(MP_QSTR_select), MP_ROM_PTR(&mp_select_select_obj) }, { MP_ROM_QSTR(MP_QSTR_poll), MP_ROM_PTR(&mp_select_poll_obj) }, - { MP_ROM_QSTR(MP_QSTR_POLLIN), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_RD) }, - { MP_ROM_QSTR(MP_QSTR_POLLOUT), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_WR) }, - { MP_ROM_QSTR(MP_QSTR_POLLERR), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_ERR) }, - { MP_ROM_QSTR(MP_QSTR_POLLHUP), MP_OBJ_NEW_SMALL_INT(MP_STREAM_POLL_HUP) }, + { MP_ROM_QSTR(MP_QSTR_POLLIN), MP_ROM_INT(MP_STREAM_POLL_RD) }, + { MP_ROM_QSTR(MP_QSTR_POLLOUT), MP_ROM_INT(MP_STREAM_POLL_WR) }, + { MP_ROM_QSTR(MP_QSTR_POLLERR), MP_ROM_INT(MP_STREAM_POLL_ERR) }, + { MP_ROM_QSTR(MP_QSTR_POLLHUP), MP_ROM_INT(MP_STREAM_POLL_HUP) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_select_globals, mp_module_select_globals_table); From 46635a7790ec05ce5ef589c16707aea760fb5729 Mon Sep 17 00:00:00 2001 From: Alexander Steffen Date: Fri, 30 Jun 2017 09:22:17 +0200 Subject: [PATCH 334/403] all: Use the name MicroPython consistently in comments There were several different spellings of MicroPython present in comments, when there should be only one. --- bare-arm/mpconfigport.h | 2 +- cc3200/application.lds | 8 ++++---- cc3200/boards/LAUNCHXL/mpconfigboard.h | 2 +- cc3200/boards/WIPY/mpconfigboard.h | 2 +- cc3200/boards/cc3200_prefix.c | 2 +- cc3200/bootmgr/bootmgr.h | 2 +- cc3200/bootmgr/bootmgr.lds | 2 +- cc3200/bootmgr/flc.h | 2 +- cc3200/bootmgr/main.c | 2 +- cc3200/ftp/ftp.c | 2 +- cc3200/ftp/ftp.h | 2 +- cc3200/ftp/updater.c | 2 +- cc3200/ftp/updater.h | 2 +- cc3200/hal/cc3200_asm.h | 2 +- cc3200/hal/cc3200_hal.c | 2 +- cc3200/hal/cc3200_hal.h | 2 +- cc3200/hal/fault_registers.h | 2 +- cc3200/main.c | 2 +- cc3200/misc/FreeRTOSHooks.c | 2 +- cc3200/misc/antenna.c | 2 +- cc3200/misc/antenna.h | 2 +- cc3200/misc/help.c | 2 +- cc3200/misc/mperror.c | 2 +- cc3200/misc/mperror.h | 2 +- cc3200/misc/mpexception.c | 2 +- cc3200/misc/mpexception.h | 2 +- cc3200/misc/mpirq.c | 4 ++-- cc3200/misc/mpirq.h | 2 +- cc3200/mods/modmachine.c | 4 ++-- cc3200/mods/modnetwork.c | 2 +- cc3200/mods/modnetwork.h | 2 +- cc3200/mods/modubinascii.c | 4 ++-- cc3200/mods/modubinascii.h | 2 +- cc3200/mods/moduhashlib.c | 4 ++-- cc3200/mods/moduos.c | 4 ++-- cc3200/mods/moduos.h | 2 +- cc3200/mods/modusocket.c | 2 +- cc3200/mods/modusocket.h | 2 +- cc3200/mods/modussl.c | 4 ++-- cc3200/mods/modutime.c | 4 ++-- cc3200/mods/modwipy.c | 2 +- cc3200/mods/modwlan.c | 4 ++-- cc3200/mods/modwlan.h | 2 +- cc3200/mods/pybadc.c | 4 ++-- cc3200/mods/pybadc.h | 2 +- cc3200/mods/pybi2c.c | 4 ++-- cc3200/mods/pybi2c.h | 2 +- cc3200/mods/pybpin.c | 4 ++-- cc3200/mods/pybpin.h | 2 +- cc3200/mods/pybrtc.c | 4 ++-- cc3200/mods/pybrtc.h | 2 +- cc3200/mods/pybsd.c | 4 ++-- cc3200/mods/pybsd.h | 2 +- cc3200/mods/pybsleep.c | 2 +- cc3200/mods/pybsleep.h | 2 +- cc3200/mods/pybspi.c | 4 ++-- cc3200/mods/pybspi.h | 2 +- cc3200/mods/pybtimer.c | 4 ++-- cc3200/mods/pybtimer.h | 2 +- cc3200/mods/pybuart.c | 4 ++-- cc3200/mods/pybuart.h | 2 +- cc3200/mods/pybwdt.c | 4 ++-- cc3200/mods/pybwdt.h | 2 +- cc3200/mpconfigport.h | 4 ++-- cc3200/mptask.c | 2 +- cc3200/mptask.h | 2 +- cc3200/qstrdefsport.h | 2 +- cc3200/serverstask.c | 2 +- cc3200/serverstask.h | 2 +- cc3200/telnet/telnet.c | 2 +- cc3200/telnet/telnet.h | 2 +- cc3200/util/cryptohash.c | 2 +- cc3200/util/cryptohash.h | 2 +- cc3200/util/fifo.c | 2 +- cc3200/util/fifo.h | 2 +- cc3200/util/gccollect.c | 2 +- cc3200/util/gccollect.h | 2 +- cc3200/util/gchelper.h | 2 +- cc3200/util/random.c | 4 ++-- cc3200/util/random.h | 2 +- cc3200/util/sleeprestore.h | 2 +- cc3200/util/socketfifo.c | 2 +- cc3200/util/socketfifo.h | 2 +- cc3200/version.h | 2 +- drivers/nrf24l01/nrf24l01.py | 2 +- drivers/sdcard/sdcard.py | 2 +- drivers/wiznet5k/README.md | 2 +- esp8266/esp_mphal.c | 2 +- esp8266/esp_mphal.h | 2 +- esp8266/fatfs_port.c | 2 +- esp8266/gccollect.c | 2 +- esp8266/gccollect.h | 2 +- esp8266/hspi.c | 6 +++--- esp8266/machine_adc.c | 2 +- esp8266/machine_pin.c | 2 +- esp8266/machine_pwm.c | 2 +- esp8266/machine_rtc.c | 2 +- esp8266/main.c | 2 +- esp8266/modesp.c | 2 +- esp8266/modnetwork.c | 2 +- esp8266/modpyb.c | 2 +- esp8266/moduos.c | 2 +- esp8266/modutime.c | 2 +- esp8266/mpconfigport.h | 2 +- esp8266/qstrdefsport.h | 2 +- examples/embedding/Makefile.upylib | 2 +- examples/embedding/hello-embed.c | 2 +- examples/embedding/mpconfigport_minimal.h | 4 ++-- extmod/machine_mem.c | 2 +- extmod/machine_mem.h | 2 +- extmod/modubinascii.c | 2 +- extmod/modubinascii.h | 2 +- extmod/moductypes.c | 2 +- extmod/moduhashlib.c | 2 +- extmod/moduheapq.c | 2 +- extmod/modure.c | 2 +- extmod/moduselect.c | 2 +- extmod/modussl_axtls.c | 2 +- extmod/moduzlib.c | 2 +- extmod/vfs_fat.h | 2 +- extmod/vfs_fat_diskio.c | 2 +- extmod/vfs_fat_file.c | 2 +- lib/libc/string0.c | 2 +- lib/libm/ef_rem_pio2.c | 2 +- lib/libm/erf_lgamma.c | 2 +- lib/libm/fdlibm.h | 2 +- lib/libm/kf_cos.c | 2 +- lib/libm/kf_rem_pio2.c | 2 +- lib/libm/kf_sin.c | 2 +- lib/libm/kf_tan.c | 2 +- lib/libm/math.c | 2 +- lib/libm/sf_cos.c | 2 +- lib/libm/sf_erf.c | 2 +- lib/libm/sf_frexp.c | 2 +- lib/libm/sf_ldexp.c | 2 +- lib/libm/sf_modf.c | 2 +- lib/libm/sf_sin.c | 2 +- lib/libm/sf_tan.c | 2 +- lib/libm/wf_lgamma.c | 2 +- lib/libm/wf_tgamma.c | 2 +- lib/mp-readline/readline.c | 2 +- lib/mp-readline/readline.h | 2 +- lib/netutils/netutils.c | 2 +- lib/netutils/netutils.h | 2 +- lib/timeutils/timeutils.c | 4 ++-- lib/timeutils/timeutils.h | 2 +- lib/utils/printf.c | 2 +- lib/utils/pyexec.c | 2 +- lib/utils/pyexec.h | 2 +- logo/FONT-LICENSE.txt | 2 +- minimal/mpconfigport.h | 2 +- mpy-cross/Makefile | 2 +- pic16bit/board.c | 2 +- pic16bit/board.h | 2 +- pic16bit/main.c | 2 +- pic16bit/modpyb.c | 2 +- pic16bit/modpyb.h | 2 +- pic16bit/modpybled.c | 2 +- pic16bit/modpybswitch.c | 2 +- pic16bit/mpconfigport.h | 2 +- pic16bit/pic16bit_mphal.c | 2 +- pic16bit/pic16bit_mphal.h | 2 +- py/argcheck.c | 2 +- py/asmarm.c | 2 +- py/asmarm.h | 2 +- py/asmthumb.c | 2 +- py/asmthumb.h | 2 +- py/asmx64.c | 2 +- py/asmx64.h | 2 +- py/asmx86.c | 2 +- py/asmx86.h | 2 +- py/bc.c | 2 +- py/bc.h | 2 +- py/bc0.h | 4 ++-- py/binary.c | 2 +- py/binary.h | 2 +- py/builtin.h | 2 +- py/builtinevex.c | 2 +- py/builtinimport.c | 2 +- py/compile.c | 18 +++++++++--------- py/compile.h | 2 +- py/emit.h | 2 +- py/emitbc.c | 2 +- py/emitcommon.c | 2 +- py/emitglue.c | 2 +- py/emitglue.h | 2 +- py/emitinlinethumb.c | 2 +- py/emitnative.c | 2 +- py/formatfloat.c | 2 +- py/formatfloat.h | 2 +- py/frozenmod.c | 2 +- py/frozenmod.h | 2 +- py/gc.c | 2 +- py/gc.h | 2 +- py/grammar.h | 4 ++-- py/lexer.c | 2 +- py/lexer.h | 4 ++-- py/malloc.c | 4 ++-- py/map.c | 2 +- py/misc.h | 2 +- py/mkrules.mk | 2 +- py/modarray.c | 2 +- py/modbuiltins.c | 2 +- py/modcmath.c | 2 +- py/modcollections.c | 2 +- py/modgc.c | 2 +- py/modio.c | 2 +- py/modmath.c | 2 +- py/modmicropython.c | 2 +- py/modstruct.c | 2 +- py/modsys.c | 4 ++-- py/mphal.h | 2 +- py/mpprint.c | 2 +- py/mpprint.h | 2 +- py/mpstate.c | 2 +- py/mpstate.h | 4 ++-- py/mpz.c | 2 +- py/mpz.h | 2 +- py/nativeglue.c | 6 +++--- py/nlr.h | 2 +- py/nlrsetjmp.c | 2 +- py/obj.c | 2 +- py/obj.h | 2 +- py/objarray.c | 2 +- py/objattrtuple.c | 2 +- py/objbool.c | 2 +- py/objboundmeth.c | 2 +- py/objcell.c | 2 +- py/objclosure.c | 2 +- py/objcomplex.c | 2 +- py/objdict.c | 2 +- py/objenumerate.c | 2 +- py/objexcept.c | 2 +- py/objexcept.h | 2 +- py/objfilter.c | 2 +- py/objfloat.c | 2 +- py/objfun.c | 4 ++-- py/objfun.h | 2 +- py/objgenerator.c | 2 +- py/objgenerator.h | 2 +- py/objgetitemiter.c | 2 +- py/objint.c | 2 +- py/objint.h | 2 +- py/objint_longlong.c | 2 +- py/objint_mpz.c | 2 +- py/objlist.c | 2 +- py/objlist.h | 2 +- py/objmap.c | 2 +- py/objmodule.c | 2 +- py/objmodule.h | 2 +- py/objnamedtuple.c | 2 +- py/objnone.c | 2 +- py/objobject.c | 2 +- py/objproperty.c | 2 +- py/objrange.c | 2 +- py/objreversed.c | 2 +- py/objset.c | 2 +- py/objsingleton.c | 2 +- py/objslice.c | 2 +- py/objstr.c | 2 +- py/objstr.h | 2 +- py/objstringio.c | 2 +- py/objstrunicode.c | 2 +- py/objtuple.c | 2 +- py/objtuple.h | 2 +- py/objtype.c | 6 +++--- py/objtype.h | 2 +- py/objzip.c | 2 +- py/opmethods.c | 2 +- py/parse.c | 2 +- py/parse.h | 2 +- py/parsenum.c | 2 +- py/parsenum.h | 2 +- py/parsenumbase.c | 2 +- py/parsenumbase.h | 2 +- py/qstr.c | 2 +- py/qstr.h | 2 +- py/qstrdefs.h | 2 +- py/repl.c | 2 +- py/repl.h | 2 +- py/runtime.c | 4 ++-- py/runtime.h | 2 +- py/runtime0.h | 2 +- py/runtime_utils.c | 2 +- py/scope.c | 2 +- py/scope.h | 2 +- py/sequence.c | 2 +- py/showbc.c | 2 +- py/smallint.c | 2 +- py/smallint.h | 2 +- py/stackctrl.c | 2 +- py/stackctrl.h | 2 +- py/stream.c | 2 +- py/stream.h | 2 +- py/unicode.c | 2 +- py/unicode.h | 2 +- py/vm.c | 2 +- py/vmentrytable.h | 2 +- py/vstr.c | 2 +- py/warning.c | 2 +- qemu-arm/mpconfigport.h | 2 +- stmhal/accel.c | 4 ++-- stmhal/accel.h | 2 +- stmhal/adc.c | 6 +++--- stmhal/adc.h | 2 +- stmhal/bufhelper.c | 2 +- stmhal/bufhelper.h | 2 +- stmhal/can.c | 4 ++-- stmhal/can.h | 2 +- stmhal/dac.c | 4 ++-- stmhal/dac.h | 2 +- stmhal/dma.c | 2 +- stmhal/dma.h | 2 +- stmhal/extint.c | 2 +- stmhal/extint.h | 2 +- stmhal/flash.c | 2 +- stmhal/flash.h | 2 +- stmhal/font_petme128_8x8.h | 2 +- stmhal/gccollect.c | 2 +- stmhal/gccollect.h | 2 +- stmhal/hal/l4/inc/stm32l4xx_hal_uart.h | 2 +- stmhal/hal/l4/src/stm32l4xx_hal_uart.c | 2 +- stmhal/help.c | 2 +- stmhal/i2c.c | 4 ++-- stmhal/i2c.h | 2 +- stmhal/irq.c | 2 +- stmhal/irq.h | 2 +- stmhal/lcd.c | 2 +- stmhal/lcd.h | 2 +- stmhal/led.c | 2 +- stmhal/led.h | 2 +- stmhal/main.c | 4 ++-- stmhal/modnetwork.c | 2 +- stmhal/modnetwork.h | 2 +- stmhal/modnwcc3k.c | 4 ++-- stmhal/modnwwiznet5k.c | 4 ++-- stmhal/modpyb.c | 2 +- stmhal/modstm.c | 2 +- stmhal/moduos.c | 2 +- stmhal/modusocket.c | 2 +- stmhal/modutime.c | 2 +- stmhal/pendsv.c | 2 +- stmhal/pendsv.h | 2 +- stmhal/pin.c | 2 +- stmhal/pin.h | 2 +- stmhal/pin_defs_stmhal.h | 2 +- stmhal/pin_named_pins.c | 2 +- stmhal/portmodules.h | 2 +- stmhal/qstrdefsport.h | 2 +- stmhal/rng.c | 2 +- stmhal/rng.h | 2 +- stmhal/rtc.c | 4 ++-- stmhal/rtc.h | 2 +- stmhal/sdcard.c | 4 ++-- stmhal/sdcard.h | 2 +- stmhal/servo.c | 4 ++-- stmhal/servo.h | 2 +- stmhal/spi.c | 2 +- stmhal/spi.h | 2 +- stmhal/stm32_it.c | 2 +- stmhal/stm32_it.h | 2 +- stmhal/storage.c | 2 +- stmhal/storage.h | 2 +- stmhal/system_stm32.c | 2 +- stmhal/systick.c | 2 +- stmhal/systick.h | 2 +- stmhal/timer.c | 4 ++-- stmhal/timer.h | 2 +- stmhal/uart.c | 4 ++-- stmhal/uart.h | 2 +- stmhal/usb.c | 8 ++++---- stmhal/usb.h | 2 +- stmhal/usbd_cdc_interface.h | 2 +- stmhal/usbd_conf.c | 2 +- stmhal/usbd_conf.h | 2 +- stmhal/usbd_desc.c | 2 +- stmhal/usbd_desc.h | 2 +- stmhal/usbd_msc_storage.h | 2 +- stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h | 2 +- stmhal/usbdev/class/src/usbd_cdc_msc_hid.c | 2 +- stmhal/usrsw.c | 4 ++-- stmhal/usrsw.h | 2 +- teensy/hal_ftm.c | 2 +- teensy/hal_ftm.h | 2 +- teensy/help.c | 2 +- teensy/led.c | 2 +- teensy/main.c | 2 +- teensy/modpyb.c | 6 +++--- teensy/mpconfigport.h | 2 +- teensy/timer.c | 4 ++-- teensy/timer.h | 2 +- teensy/uart.c | 4 ++-- tests/basics/bytearray_slice_assign.py | 2 +- tests/basics/list_slice_assign.py | 2 +- tests/io/stringio1.py | 2 +- tests/run-bench-tests | 2 +- tests/run-tests | 2 +- tools/gen-cpydiff.py | 2 +- unix/Makefile | 2 +- unix/alloc.c | 2 +- unix/fdfile.h | 2 +- unix/file.c | 2 +- unix/gccollect.c | 2 +- unix/input.c | 2 +- unix/main.c | 2 +- unix/modffi.c | 2 +- unix/modjni.c | 2 +- unix/modmachine.c | 2 +- unix/modos.c | 2 +- unix/modsocket.c | 2 +- unix/modtermios.c | 2 +- unix/modtime.c | 2 +- unix/moduselect.c | 2 +- unix/mpconfigport.h | 4 ++-- unix/mpconfigport_fast.h | 2 +- unix/mpconfigport_minimal.h | 4 ++-- unix/mphalport.h | 2 +- unix/qstrdefsport.h | 2 +- unix/unix_mphal.c | 2 +- windows/init.c | 2 +- windows/init.h | 2 +- windows/mpconfigport.h | 4 ++-- windows/msvc/gettimeofday.c | 2 +- windows/msvc/sys/time.h | 2 +- windows/msvc/unistd.h | 2 +- windows/realpath.c | 2 +- windows/realpath.h | 2 +- windows/sleep.c | 2 +- windows/sleep.h | 2 +- windows/windows_mphal.c | 2 +- windows/windows_mphal.h | 2 +- zephyr/machine_pin.c | 2 +- zephyr/modutime.c | 2 +- 433 files changed, 504 insertions(+), 504 deletions(-) diff --git a/bare-arm/mpconfigport.h b/bare-arm/mpconfigport.h index 97e866bdb..17f794521 100644 --- a/bare-arm/mpconfigport.h +++ b/bare-arm/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_QSTR_BYTES_IN_HASH (1) #define MICROPY_ALLOC_PATH_MAX (512) diff --git a/cc3200/application.lds b/cc3200/application.lds index 22ad1968d..3f5e72f8b 100644 --- a/cc3200/application.lds +++ b/cc3200/application.lds @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -37,7 +37,7 @@ ENTRY(ResetISR) SECTIONS { - /* place the FreeRTOS heap (the micropython stack will live here) */ + /* place the FreeRTOS heap (the MicroPython stack will live here) */ .rtos_heap (NOLOAD) : { . = ALIGN(8); @@ -83,7 +83,7 @@ SECTIONS } > SRAM /* place here functions that are only called during boot up, */ - /* that way, we can re-use this area for the micropython heap */ + /* that way, we can re-use this area for the MicroPython heap */ .boot : { . = ALIGN(8); @@ -93,7 +93,7 @@ SECTIONS _eboot = .; } > SRAM - /* allocate the micropython heap */ + /* allocate the MicroPython heap */ .heap : { . = ALIGN(8); diff --git a/cc3200/boards/LAUNCHXL/mpconfigboard.h b/cc3200/boards/LAUNCHXL/mpconfigboard.h index 32ef5290b..b3d766d1e 100644 --- a/cc3200/boards/LAUNCHXL/mpconfigboard.h +++ b/cc3200/boards/LAUNCHXL/mpconfigboard.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/boards/WIPY/mpconfigboard.h b/cc3200/boards/WIPY/mpconfigboard.h index 9f04dbf23..af15cca35 100644 --- a/cc3200/boards/WIPY/mpconfigboard.h +++ b/cc3200/boards/WIPY/mpconfigboard.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/boards/cc3200_prefix.c b/cc3200/boards/cc3200_prefix.c index 971285745..d03efe024 100644 --- a/cc3200/boards/cc3200_prefix.c +++ b/cc3200/boards/cc3200_prefix.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/bootmgr.h b/cc3200/bootmgr/bootmgr.h index e5285d4e4..5a370f8c9 100644 --- a/cc3200/bootmgr/bootmgr.h +++ b/cc3200/bootmgr/bootmgr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/bootmgr.lds b/cc3200/bootmgr/bootmgr.lds index e67fe23ae..9c911a0d0 100644 --- a/cc3200/bootmgr/bootmgr.lds +++ b/cc3200/bootmgr/bootmgr.lds @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/flc.h b/cc3200/bootmgr/flc.h index 7c04c7b05..8f05bb320 100644 --- a/cc3200/bootmgr/flc.h +++ b/cc3200/bootmgr/flc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/bootmgr/main.c b/cc3200/bootmgr/main.c index 0d9ab35f8..cfb8dec21 100644 --- a/cc3200/bootmgr/main.c +++ b/cc3200/bootmgr/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/ftp.c b/cc3200/ftp/ftp.c index b56e3f4ce..5461f9180 100644 --- a/cc3200/ftp/ftp.c +++ b/cc3200/ftp/ftp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/ftp.h b/cc3200/ftp/ftp.h index 7d16002e4..af4c14fa3 100644 --- a/cc3200/ftp/ftp.h +++ b/cc3200/ftp/ftp.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/updater.c b/cc3200/ftp/updater.c index fece70095..5be2c6063 100644 --- a/cc3200/ftp/updater.c +++ b/cc3200/ftp/updater.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/ftp/updater.h b/cc3200/ftp/updater.h index dcca70472..51248e4bf 100644 --- a/cc3200/ftp/updater.h +++ b/cc3200/ftp/updater.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/cc3200_asm.h b/cc3200/hal/cc3200_asm.h index dcaaf57e1..742c9a6f7 100644 --- a/cc3200/hal/cc3200_asm.h +++ b/cc3200/hal/cc3200_asm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/cc3200_hal.c b/cc3200/hal/cc3200_hal.c index 5c0e9c30f..b4848e99e 100644 --- a/cc3200/hal/cc3200_hal.c +++ b/cc3200/hal/cc3200_hal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/cc3200_hal.h b/cc3200/hal/cc3200_hal.h index 9953f0e5a..71e245eeb 100644 --- a/cc3200/hal/cc3200_hal.h +++ b/cc3200/hal/cc3200_hal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/hal/fault_registers.h b/cc3200/hal/fault_registers.h index 739745e92..ade516b9e 100644 --- a/cc3200/hal/fault_registers.h +++ b/cc3200/hal/fault_registers.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/main.c b/cc3200/main.c index 1ffb98188..e2299e146 100644 --- a/cc3200/main.c +++ b/cc3200/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/FreeRTOSHooks.c b/cc3200/misc/FreeRTOSHooks.c index dac9a9282..c618279b7 100644 --- a/cc3200/misc/FreeRTOSHooks.c +++ b/cc3200/misc/FreeRTOSHooks.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/antenna.c b/cc3200/misc/antenna.c index 0fbf79f0f..afeed85e1 100644 --- a/cc3200/misc/antenna.c +++ b/cc3200/misc/antenna.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/antenna.h b/cc3200/misc/antenna.h index 3bb87e32b..c9d845453 100644 --- a/cc3200/misc/antenna.h +++ b/cc3200/misc/antenna.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/help.c b/cc3200/misc/help.c index cce515898..739303e19 100644 --- a/cc3200/misc/help.c +++ b/cc3200/misc/help.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mperror.c b/cc3200/misc/mperror.c index 81b853b48..082d940e2 100644 --- a/cc3200/misc/mperror.c +++ b/cc3200/misc/mperror.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mperror.h b/cc3200/misc/mperror.h index 46a9b8cb0..1c3eb6269 100644 --- a/cc3200/misc/mperror.h +++ b/cc3200/misc/mperror.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mpexception.c b/cc3200/misc/mpexception.c index 068adb70b..72b203fae 100644 --- a/cc3200/misc/mpexception.c +++ b/cc3200/misc/mpexception.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mpexception.h b/cc3200/misc/mpexception.h index d23381caf..88134857c 100644 --- a/cc3200/misc/mpexception.h +++ b/cc3200/misc/mpexception.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/misc/mpirq.c b/cc3200/misc/mpirq.c index 37149089f..321663088 100644 --- a/cc3200/misc/mpirq.c +++ b/cc3200/misc/mpirq.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -143,7 +143,7 @@ void mp_irq_handler (mp_obj_t self_in) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC mp_obj_t mp_irq_init (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_irq_obj_t *self = pos_args[0]; diff --git a/cc3200/misc/mpirq.h b/cc3200/misc/mpirq.h index 8b4ab2f1b..35ce66e2d 100644 --- a/cc3200/misc/mpirq.h +++ b/cc3200/misc/mpirq.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modmachine.c b/cc3200/mods/modmachine.c index fd1485607..5f63d0196 100644 --- a/cc3200/mods/modmachine.c +++ b/cc3200/mods/modmachine.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -72,7 +72,7 @@ extern OsiTaskHandle xSimpleLinkSpawnTaskHndl; /// /******************************************************************************/ -// Micro Python bindings; +// MicroPython bindings; STATIC mp_obj_t machine_reset(void) { // disable wlan diff --git a/cc3200/mods/modnetwork.c b/cc3200/mods/modnetwork.c index d44f75aca..249e1be37 100644 --- a/cc3200/mods/modnetwork.c +++ b/cc3200/mods/modnetwork.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modnetwork.h b/cc3200/mods/modnetwork.h index 8e1196e86..6ec90a2ba 100644 --- a/cc3200/mods/modnetwork.h +++ b/cc3200/mods/modnetwork.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modubinascii.c b/cc3200/mods/modubinascii.c index 09f4b1e10..8bc2feacc 100644 --- a/cc3200/mods/modubinascii.c +++ b/cc3200/mods/modubinascii.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -44,7 +44,7 @@ /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_map_elem_t mp_module_binascii_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_ubinascii) }, diff --git a/cc3200/mods/modubinascii.h b/cc3200/mods/modubinascii.h index 3e784e9ae..eb9fc4f21 100644 --- a/cc3200/mods/modubinascii.h +++ b/cc3200/mods/modubinascii.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/moduhashlib.c b/cc3200/mods/moduhashlib.c index e1145e4d8..c90c727c2 100644 --- a/cc3200/mods/moduhashlib.c +++ b/cc3200/mods/moduhashlib.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -117,7 +117,7 @@ STATIC mp_obj_t hash_read (mp_obj_t self_in) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings /// \classmethod \constructor([data[, block_size]]) /// initial data must be given if block_size wants to be passed diff --git a/cc3200/mods/moduos.c b/cc3200/mods/moduos.c index ed8879bf3..51dc5834d 100644 --- a/cc3200/mods/moduos.c +++ b/cc3200/mods/moduos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -78,7 +78,7 @@ void osmount_unmount_all (void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings // STATIC const qstr os_uname_info_fields[] = { diff --git a/cc3200/mods/moduos.h b/cc3200/mods/moduos.h index 148cddf2e..f183715c9 100644 --- a/cc3200/mods/moduos.h +++ b/cc3200/mods/moduos.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modusocket.c b/cc3200/mods/modusocket.c index 4e17bbae6..739355360 100644 --- a/cc3200/mods/modusocket.c +++ b/cc3200/mods/modusocket.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modusocket.h b/cc3200/mods/modusocket.h index 80c1f24cd..6e7758662 100644 --- a/cc3200/mods/modusocket.h +++ b/cc3200/mods/modusocket.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/modussl.c b/cc3200/mods/modussl.c index 95ecdbce7..808267571 100644 --- a/cc3200/mods/modussl.c +++ b/cc3200/mods/modussl.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -57,7 +57,7 @@ typedef struct _mp_obj_ssl_socket_t { STATIC const mp_obj_type_t ssl_socket_type; /******************************************************************************/ -// Micro Python bindings; SSL class +// MicroPython bindings; SSL class // ssl sockets inherit from normal socket, so we take its // locals and stream methods diff --git a/cc3200/mods/modutime.c b/cc3200/mods/modutime.c index 48fde67e7..428b00f93 100644 --- a/cc3200/mods/modutime.c +++ b/cc3200/mods/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -51,7 +51,7 @@ /// and for sleeping. /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings /// \function localtime([secs]) /// Convert a time expressed in seconds since Jan 1, 2000 into an 8-tuple which diff --git a/cc3200/mods/modwipy.c b/cc3200/mods/modwipy.c index b4c18d153..21a9cc63b 100644 --- a/cc3200/mods/modwipy.c +++ b/cc3200/mods/modwipy.c @@ -5,7 +5,7 @@ /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC mp_obj_t mod_wipy_heartbeat (mp_uint_t n_args, const mp_obj_t *args) { if (n_args) { diff --git a/cc3200/mods/modwlan.c b/cc3200/mods/modwlan.c index 68d892364..77f5bd991 100644 --- a/cc3200/mods/modwlan.c +++ b/cc3200/mods/modwlan.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -763,7 +763,7 @@ STATIC bool wlan_scan_result_is_unique (const mp_obj_list_t *nets, _u8 *bssid) { } /******************************************************************************/ -// Micro Python bindings; WLAN class +// MicroPython bindings; WLAN class /// \class WLAN - WiFi driver diff --git a/cc3200/mods/modwlan.h b/cc3200/mods/modwlan.h index d37d276e8..b806644f5 100644 --- a/cc3200/mods/modwlan.h +++ b/cc3200/mods/modwlan.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybadc.c b/cc3200/mods/pybadc.c index 696e7650b..0b4f0ba68 100644 --- a/cc3200/mods/pybadc.c +++ b/cc3200/mods/pybadc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -126,7 +126,7 @@ STATIC void pyb_adc_deinit_all_channels (void) { } /******************************************************************************/ -/* Micro Python bindings : adc object */ +/* MicroPython bindings : adc object */ STATIC void adc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_adc_obj_t *self = self_in; diff --git a/cc3200/mods/pybadc.h b/cc3200/mods/pybadc.h index 50640ee60..db04b006b 100644 --- a/cc3200/mods/pybadc.h +++ b/cc3200/mods/pybadc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybi2c.c b/cc3200/mods/pybi2c.c index 9fc97d914..9c62ffdc4 100644 --- a/cc3200/mods/pybi2c.c +++ b/cc3200/mods/pybi2c.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -281,7 +281,7 @@ STATIC void pyb_i2c_readmem_into (mp_arg_val_t *args, vstr_t *vstr) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ /******************************************************************************/ STATIC void pyb_i2c_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_i2c_obj_t *self = self_in; diff --git a/cc3200/mods/pybi2c.h b/cc3200/mods/pybi2c.h index d547f6330..dcc3f0468 100644 --- a/cc3200/mods/pybi2c.h +++ b/cc3200/mods/pybi2c.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybpin.c b/cc3200/mods/pybpin.c index c2a469117..d59f113eb 100644 --- a/cc3200/mods/pybpin.c +++ b/cc3200/mods/pybpin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -519,7 +519,7 @@ STATIC void EXTI_Handler(uint port) { /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_arg_t pin_init_args[] = { { MP_QSTR_mode, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, diff --git a/cc3200/mods/pybpin.h b/cc3200/mods/pybpin.h index 6b4b7b1ed..74f0af2b3 100644 --- a/cc3200/mods/pybpin.h +++ b/cc3200/mods/pybpin.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybrtc.c b/cc3200/mods/pybrtc.c index 134bd440e..14c4cd419 100644 --- a/cc3200/mods/pybrtc.c +++ b/cc3200/mods/pybrtc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -278,7 +278,7 @@ STATIC void rtc_msec_add (uint16_t msecs_1, uint32_t *secs, uint16_t *msecs_2) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_arg_t pyb_rtc_init_args[] = { { MP_QSTR_id, MP_ARG_INT, {.u_int = 0} }, diff --git a/cc3200/mods/pybrtc.h b/cc3200/mods/pybrtc.h index 3fd11ecd6..f73de3f5a 100644 --- a/cc3200/mods/pybrtc.h +++ b/cc3200/mods/pybrtc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybsd.c b/cc3200/mods/pybsd.c index 306baea8b..5ba6119b2 100644 --- a/cc3200/mods/pybsd.c +++ b/cc3200/mods/pybsd.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -118,7 +118,7 @@ STATIC mp_obj_t pyb_sd_init_helper (pybsd_obj_t *self, const mp_arg_val_t *args) } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings // STATIC const mp_arg_t pyb_sd_init_args[] = { diff --git a/cc3200/mods/pybsd.h b/cc3200/mods/pybsd.h index 084d7caaf..af942084d 100644 --- a/cc3200/mods/pybsd.h +++ b/cc3200/mods/pybsd.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybsleep.c b/cc3200/mods/pybsleep.c index ced7fef85..a7488c5f1 100644 --- a/cc3200/mods/pybsleep.c +++ b/cc3200/mods/pybsleep.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybsleep.h b/cc3200/mods/pybsleep.h index 513e6fa95..e98636178 100644 --- a/cc3200/mods/pybsleep.h +++ b/cc3200/mods/pybsleep.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybspi.c b/cc3200/mods/pybspi.c index 3cd384266..9edad579a 100644 --- a/cc3200/mods/pybspi.c +++ b/cc3200/mods/pybspi.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -144,7 +144,7 @@ STATIC void pybspi_transfer (pyb_spi_obj_t *self, const char *txdata, char *rxda } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ /******************************************************************************/ STATIC void pyb_spi_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_spi_obj_t *self = self_in; diff --git a/cc3200/mods/pybspi.h b/cc3200/mods/pybspi.h index b533b6056..b0fce8870 100644 --- a/cc3200/mods/pybspi.h +++ b/cc3200/mods/pybspi.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybtimer.c b/cc3200/mods/pybtimer.c index d25ac6c2b..1ef9a4a44 100644 --- a/cc3200/mods/pybtimer.c +++ b/cc3200/mods/pybtimer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -264,7 +264,7 @@ STATIC void timer_channel_init (pyb_timer_channel_obj_t *ch) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_timer_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_timer_obj_t *tim = self_in; diff --git a/cc3200/mods/pybtimer.h b/cc3200/mods/pybtimer.h index a1b30cd2b..0af0864ca 100644 --- a/cc3200/mods/pybtimer.h +++ b/cc3200/mods/pybtimer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybuart.c b/cc3200/mods/pybuart.c index 06938bdd4..626357179 100644 --- a/cc3200/mods/pybuart.c +++ b/cc3200/mods/pybuart.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -311,7 +311,7 @@ STATIC int uart_irq_flags (mp_obj_t self_in) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_uart_obj_t *self = self_in; diff --git a/cc3200/mods/pybuart.h b/cc3200/mods/pybuart.h index 56440987f..d481242f1 100644 --- a/cc3200/mods/pybuart.h +++ b/cc3200/mods/pybuart.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mods/pybwdt.c b/cc3200/mods/pybwdt.c index 76c701ca0..114e7ac96 100644 --- a/cc3200/mods/pybwdt.c +++ b/cc3200/mods/pybwdt.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -87,7 +87,7 @@ void pybwdt_sl_alive (void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC const mp_arg_t pyb_wdt_init_args[] = { { MP_QSTR_id, MP_ARG_OBJ, {.u_obj = mp_const_none} }, diff --git a/cc3200/mods/pybwdt.h b/cc3200/mods/pybwdt.h index 2844587cb..275c49435 100644 --- a/cc3200/mods/pybwdt.h +++ b/cc3200/mods/pybwdt.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mpconfigport.h b/cc3200/mpconfigport.h index 78f8c0948..dcde9aae0 100644 --- a/cc3200/mpconfigport.h +++ b/cc3200/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -32,7 +32,7 @@ #include "semphr.h" #endif -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (128) #define MICROPY_PERSISTENT_CODE_LOAD (1) diff --git a/cc3200/mptask.c b/cc3200/mptask.c index 50c3c769d..09be8c441 100644 --- a/cc3200/mptask.c +++ b/cc3200/mptask.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/mptask.h b/cc3200/mptask.h index 5345ecfda..a1c3eb2cb 100644 --- a/cc3200/mptask.h +++ b/cc3200/mptask.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/qstrdefsport.h b/cc3200/qstrdefsport.h index 2fc56668c..d5f22d70a 100644 --- a/cc3200/qstrdefsport.h +++ b/cc3200/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/serverstask.c b/cc3200/serverstask.c index 6b5899e18..100b8d33b 100644 --- a/cc3200/serverstask.c +++ b/cc3200/serverstask.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/serverstask.h b/cc3200/serverstask.h index 77a3af2f3..c4533d717 100644 --- a/cc3200/serverstask.h +++ b/cc3200/serverstask.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/telnet/telnet.c b/cc3200/telnet/telnet.c index 26e45a75f..2f0818f6b 100644 --- a/cc3200/telnet/telnet.c +++ b/cc3200/telnet/telnet.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/telnet/telnet.h b/cc3200/telnet/telnet.h index 1e3173b11..51c569104 100644 --- a/cc3200/telnet/telnet.h +++ b/cc3200/telnet/telnet.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/cryptohash.c b/cc3200/util/cryptohash.c index d2d6222ff..909dadc8c 100644 --- a/cc3200/util/cryptohash.c +++ b/cc3200/util/cryptohash.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/cryptohash.h b/cc3200/util/cryptohash.h index df3a8475c..15d46b705 100644 --- a/cc3200/util/cryptohash.h +++ b/cc3200/util/cryptohash.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/fifo.c b/cc3200/util/fifo.c index 166f99d98..421f83710 100644 --- a/cc3200/util/fifo.c +++ b/cc3200/util/fifo.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/fifo.h b/cc3200/util/fifo.h index ee7571c26..6ede57e1e 100644 --- a/cc3200/util/fifo.h +++ b/cc3200/util/fifo.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/gccollect.c b/cc3200/util/gccollect.c index 8963852f7..baee2eeef 100644 --- a/cc3200/util/gccollect.c +++ b/cc3200/util/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/gccollect.h b/cc3200/util/gccollect.h index 3c4232b84..08d43d283 100644 --- a/cc3200/util/gccollect.h +++ b/cc3200/util/gccollect.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/gchelper.h b/cc3200/util/gchelper.h index 0277a754b..48e81bc61 100644 --- a/cc3200/util/gchelper.h +++ b/cc3200/util/gchelper.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/random.c b/cc3200/util/random.c index 54aaa829c..f8e9cdf0c 100644 --- a/cc3200/util/random.c +++ b/cc3200/util/random.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -67,7 +67,7 @@ STATIC uint32_t lfsr (uint32_t input) { } /******************************************************************************/ -// Micro Python bindings; +// MicroPython bindings; STATIC mp_obj_t machine_rng_get(void) { return mp_obj_new_int(rng_get()); diff --git a/cc3200/util/random.h b/cc3200/util/random.h index 60b0b8663..02cde6b52 100644 --- a/cc3200/util/random.h +++ b/cc3200/util/random.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/sleeprestore.h b/cc3200/util/sleeprestore.h index 1c5509db0..e178f4c2d 100644 --- a/cc3200/util/sleeprestore.h +++ b/cc3200/util/sleeprestore.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/socketfifo.c b/cc3200/util/socketfifo.c index eb25f3be3..d0a715048 100644 --- a/cc3200/util/socketfifo.c +++ b/cc3200/util/socketfifo.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/util/socketfifo.h b/cc3200/util/socketfifo.h index 1309201ee..e6cf851b1 100644 --- a/cc3200/util/socketfifo.h +++ b/cc3200/util/socketfifo.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/cc3200/version.h b/cc3200/version.h index 83e3f8c07..fccb95c52 100644 --- a/cc3200/version.h +++ b/cc3200/version.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/drivers/nrf24l01/nrf24l01.py b/drivers/nrf24l01/nrf24l01.py index b45c137c6..7274a7927 100644 --- a/drivers/nrf24l01/nrf24l01.py +++ b/drivers/nrf24l01/nrf24l01.py @@ -1,4 +1,4 @@ -"""NRF24L01 driver for Micro Python +"""NRF24L01 driver for MicroPython """ from micropython import const diff --git a/drivers/sdcard/sdcard.py b/drivers/sdcard/sdcard.py index e749d5376..75a0c501e 100644 --- a/drivers/sdcard/sdcard.py +++ b/drivers/sdcard/sdcard.py @@ -1,5 +1,5 @@ """ -Micro Python driver for SD cards using SPI bus. +MicroPython driver for SD cards using SPI bus. Requires an SPI bus and a CS pin. Provides readblocks and writeblocks methods so the device can be mounted as a filesystem. diff --git a/drivers/wiznet5k/README.md b/drivers/wiznet5k/README.md index 4f907e0b1..88f25a2b8 100644 --- a/drivers/wiznet5k/README.md +++ b/drivers/wiznet5k/README.md @@ -1,6 +1,6 @@ This is the driver for the WIZnet5x00 series of Ethernet controllers. -Adapted for Micro Python. +Adapted for MicroPython. Original source: https://github.com/Wiznet/W5500_EVB/tree/master/ioLibrary Taken on: 30 August 2014 diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c index 55f9a5894..61848fd34 100644 --- a/esp8266/esp_mphal.c +++ b/esp8266/esp_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/esp_mphal.h b/esp8266/esp_mphal.h index 1d1d6de3f..913bd70dc 100644 --- a/esp8266/esp_mphal.h +++ b/esp8266/esp_mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/fatfs_port.c b/esp8266/fatfs_port.c index 02384f605..a8865c817 100644 --- a/esp8266/fatfs_port.c +++ b/esp8266/fatfs_port.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/gccollect.c b/esp8266/gccollect.c index 1b9349f57..cd5d4932c 100644 --- a/esp8266/gccollect.c +++ b/esp8266/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/gccollect.h b/esp8266/gccollect.h index 0aee42771..5735d8a39 100644 --- a/esp8266/gccollect.h +++ b/esp8266/gccollect.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/hspi.c b/esp8266/hspi.c index 436fb4f6f..554a50460 100644 --- a/esp8266/hspi.c +++ b/esp8266/hspi.c @@ -28,7 +28,7 @@ /* Wrapper to setup HSPI/SPI GPIO pins and default SPI clock spi_no - SPI (0) or HSPI (1) -Not used in Micropython. +Not used in MicroPython. */ void spi_init(uint8_t spi_no) { spi_init_gpio(spi_no, SPI_CLK_USE_DIV); @@ -48,7 +48,7 @@ Configures SPI mode parameters for clock edge and clock polarity. (1) Data is valid on clock trailing edge spi_cpol - (0) Clock is low when inactive (1) Clock is high when inactive -For Micropython this version is different from original. +For MicroPython this version is different from original. */ void spi_mode(uint8_t spi_no, uint8_t spi_cpha, uint8_t spi_cpol) { if (spi_cpol) { @@ -99,7 +99,7 @@ void spi_init_gpio(uint8_t spi_no, uint8_t sysclk_as_spiclk) { // GPIO14 is HSPI CLK pin (Clock) PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, 2); // GPIO15 is HSPI CS pin (Chip Select / Slave Select) - // In Micropython, we are handling CS ourself in drivers. + // In MicroPython, we are handling CS ourself in drivers. // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, 2); } } diff --git a/esp8266/machine_adc.c b/esp8266/machine_adc.c index 73ec05208..c8c08695b 100644 --- a/esp8266/machine_adc.c +++ b/esp8266/machine_adc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/machine_pin.c b/esp8266/machine_pin.c index 6f75a0a6a..de65735ba 100644 --- a/esp8266/machine_pin.c +++ b/esp8266/machine_pin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/machine_pwm.c b/esp8266/machine_pwm.c index 5d30f0965..8d73e6bb1 100644 --- a/esp8266/machine_pwm.c +++ b/esp8266/machine_pwm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/machine_rtc.c b/esp8266/machine_rtc.c index 984e8b6e8..2ad44318f 100644 --- a/esp8266/machine_rtc.c +++ b/esp8266/machine_rtc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/main.c b/esp8266/main.c index 43b83759e..957198aa0 100644 --- a/esp8266/main.c +++ b/esp8266/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modesp.c b/esp8266/modesp.c index 1aec1f90e..a63d50564 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modnetwork.c b/esp8266/modnetwork.c index a621522d0..283abecaf 100644 --- a/esp8266/modnetwork.c +++ b/esp8266/modnetwork.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modpyb.c b/esp8266/modpyb.c index 9fe8039bc..e977191ee 100644 --- a/esp8266/modpyb.c +++ b/esp8266/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/moduos.c b/esp8266/moduos.c index 807d2e18a..d0554096e 100644 --- a/esp8266/moduos.c +++ b/esp8266/moduos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/modutime.c b/esp8266/modutime.c index bdeb3bb45..afb14dfd6 100644 --- a/esp8266/modutime.c +++ b/esp8266/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h index ab5591bb7..bbded43f4 100644 --- a/esp8266/mpconfigport.h +++ b/esp8266/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C) #define MICROPY_ALLOC_PATH_MAX (128) diff --git a/esp8266/qstrdefsport.h b/esp8266/qstrdefsport.h index 7610eb33d..8f301a69c 100644 --- a/esp8266/qstrdefsport.h +++ b/esp8266/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/examples/embedding/Makefile.upylib b/examples/embedding/Makefile.upylib index bb48fd507..a9b653517 100644 --- a/examples/embedding/Makefile.upylib +++ b/examples/embedding/Makefile.upylib @@ -55,7 +55,7 @@ CFLAGS += -U _FORTIFY_SOURCE endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. -# The unix port of micropython on OSX must be compiled with clang, +# The unix port of MicroPython on OSX must be compiled with clang, # while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) diff --git a/examples/embedding/hello-embed.c b/examples/embedding/hello-embed.c index e3a484783..3473e5bcd 100644 --- a/examples/embedding/hello-embed.c +++ b/examples/embedding/hello-embed.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/examples/embedding/mpconfigport_minimal.h b/examples/embedding/mpconfigport_minimal.h index 87c87fa97..5b96aa4b0 100644 --- a/examples/embedding/mpconfigport_minimal.h +++ b/examples/embedding/mpconfigport_minimal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (PATH_MAX) #define MICROPY_ENABLE_GC (1) diff --git a/extmod/machine_mem.c b/extmod/machine_mem.c index 88c176803..af987cb7f 100644 --- a/extmod/machine_mem.c +++ b/extmod/machine_mem.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/machine_mem.h b/extmod/machine_mem.h index 4bc9ac127..a48a52c82 100644 --- a/extmod/machine_mem.h +++ b/extmod/machine_mem.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index 4dda3c442..d79191b3e 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modubinascii.h b/extmod/modubinascii.h index 6c0156fc4..fb3169267 100644 --- a/extmod/modubinascii.h +++ b/extmod/modubinascii.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moductypes.c b/extmod/moductypes.c index d2d2e85de..9678fd58f 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduhashlib.c b/extmod/moduhashlib.c index 13525cc3f..f3beb3939 100644 --- a/extmod/moduhashlib.c +++ b/extmod/moduhashlib.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index 567ee83da..e6e417d2b 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modure.c b/extmod/modure.c index b4c7a364f..b85ba2673 100644 --- a/extmod/modure.c +++ b/extmod/modure.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduselect.c b/extmod/moduselect.c index 2b8b87b5a..a9f25c195 100644 --- a/extmod/moduselect.c +++ b/extmod/moduselect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index be1aa0359..86dd8e29c 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index 6e045c403..a05d0f2ed 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h index 63c4abb82..443e4eda8 100644 --- a/extmod/vfs_fat.h +++ b/extmod/vfs_fat.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/extmod/vfs_fat_diskio.c b/extmod/vfs_fat_diskio.c index 24c00ffba..ff23c6b0c 100644 --- a/extmod/vfs_fat_diskio.c +++ b/extmod/vfs_fat_diskio.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Original template for this file comes from: * Low level disk I/O module skeleton for FatFs, (C)ChaN, 2013 diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 22907c12a..8fb48f01a 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/libc/string0.c b/lib/libc/string0.c index 1b37169ed..c2f2abd0f 100644 --- a/lib/libc/string0.c +++ b/lib/libc/string0.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/libm/ef_rem_pio2.c b/lib/libm/ef_rem_pio2.c index f7a695e17..ca55243fb 100644 --- a/lib/libm/ef_rem_pio2.c +++ b/lib/libm/ef_rem_pio2.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/erf_lgamma.c b/lib/libm/erf_lgamma.c index a0da86b8d..877816a0c 100644 --- a/lib/libm/erf_lgamma.c +++ b/lib/libm/erf_lgamma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/fdlibm.h b/lib/libm/fdlibm.h index 529a3975a..ace3b2da2 100644 --- a/lib/libm/fdlibm.h +++ b/lib/libm/fdlibm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * This file is adapted from from newlib-nano-2, the newlib/libm/common/fdlib.h, * available from https://github.com/32bitmicro/newlib-nano-2. The main change diff --git a/lib/libm/kf_cos.c b/lib/libm/kf_cos.c index f1f883ced..691f9842f 100644 --- a/lib/libm/kf_cos.c +++ b/lib/libm/kf_cos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/kf_rem_pio2.c b/lib/libm/kf_rem_pio2.c index e267b65f9..c7e947957 100644 --- a/lib/libm/kf_rem_pio2.c +++ b/lib/libm/kf_rem_pio2.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/kf_sin.c b/lib/libm/kf_sin.c index 81390b4eb..07ea99344 100644 --- a/lib/libm/kf_sin.c +++ b/lib/libm/kf_sin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/kf_tan.c b/lib/libm/kf_tan.c index 68254c682..6da9bd817 100644 --- a/lib/libm/kf_tan.c +++ b/lib/libm/kf_tan.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/math.c b/lib/libm/math.c index d7e27e775..984636627 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/libm/sf_cos.c b/lib/libm/sf_cos.c index 33cde50e2..fabb129cd 100644 --- a/lib/libm/sf_cos.c +++ b/lib/libm/sf_cos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_erf.c b/lib/libm/sf_erf.c index 00ac4baf1..3f0172c6e 100644 --- a/lib/libm/sf_erf.c +++ b/lib/libm/sf_erf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_frexp.c b/lib/libm/sf_frexp.c index 397373fde..df50fb773 100644 --- a/lib/libm/sf_frexp.c +++ b/lib/libm/sf_frexp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_ldexp.c b/lib/libm/sf_ldexp.c index a0941df9f..37968d475 100644 --- a/lib/libm/sf_ldexp.c +++ b/lib/libm/sf_ldexp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_modf.c b/lib/libm/sf_modf.c index 4fcae057a..410db2a37 100644 --- a/lib/libm/sf_modf.c +++ b/lib/libm/sf_modf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/common * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_sin.c b/lib/libm/sf_sin.c index 585ab8d8c..d27050778 100644 --- a/lib/libm/sf_sin.c +++ b/lib/libm/sf_sin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/sf_tan.c b/lib/libm/sf_tan.c index a9296d8bf..148b16d61 100644 --- a/lib/libm/sf_tan.c +++ b/lib/libm/sf_tan.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/wf_lgamma.c b/lib/libm/wf_lgamma.c index 7d2f42c54..d86ede790 100644 --- a/lib/libm/wf_lgamma.c +++ b/lib/libm/wf_lgamma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/libm/wf_tgamma.c b/lib/libm/wf_tgamma.c index afd16bf67..64b2488d1 100644 --- a/lib/libm/wf_tgamma.c +++ b/lib/libm/wf_tgamma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * These math functions are taken from newlib-nano-2, the newlib/libm/math * directory, available from https://github.com/32bitmicro/newlib-nano-2. diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 5b35c8660..9d254d8cf 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/mp-readline/readline.h b/lib/mp-readline/readline.h index f53fdeaa8..00aa9622a 100644 --- a/lib/mp-readline/readline.h +++ b/lib/mp-readline/readline.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/netutils/netutils.c b/lib/netutils/netutils.c index a2ea31cf3..a32452161 100644 --- a/lib/netutils/netutils.c +++ b/lib/netutils/netutils.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/netutils/netutils.h b/lib/netutils/netutils.h index 1e147afa9..4befc90db 100644 --- a/lib/netutils/netutils.h +++ b/lib/netutils/netutils.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/timeutils/timeutils.c b/lib/timeutils/timeutils.c index f1bcd8f3f..d836884b3 100644 --- a/lib/timeutils/timeutils.c +++ b/lib/timeutils/timeutils.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -67,7 +67,7 @@ mp_uint_t timeutils_year_day(mp_uint_t year, mp_uint_t month, mp_uint_t date) { void timeutils_seconds_since_2000_to_struct_time(mp_uint_t t, timeutils_struct_time_t *tm) { // The following algorithm was adapted from musl's __secs_to_tm and adapted - // for differences in Micro Python's timebase. + // for differences in MicroPython's timebase. mp_int_t seconds = t - LEAPOCH; diff --git a/lib/timeutils/timeutils.h b/lib/timeutils/timeutils.h index ffaab985e..1477229b4 100644 --- a/lib/timeutils/timeutils.h +++ b/lib/timeutils/timeutils.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/utils/printf.c b/lib/utils/printf.c index 303edfcca..51dfa5b96 100644 --- a/lib/utils/printf.c +++ b/lib/utils/printf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 7d0d1cc38..d3500b42b 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index 69cdb4762..bc98ba94a 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/logo/FONT-LICENSE.txt b/logo/FONT-LICENSE.txt index 18ac0379f..69c49d84c 100644 --- a/logo/FONT-LICENSE.txt +++ b/logo/FONT-LICENSE.txt @@ -1,4 +1,4 @@ -The font used for the Micro Python logo is "Exo", +The font used for the MicroPython logo is "Exo", http://www.google.com/fonts/specimen/Exo. Copyright (c) 2013, Natanael Gama (https://plus.google.com/u/0/+NatanaelGama), diff --git a/minimal/mpconfigport.h b/minimal/mpconfigport.h index 47fc98429..ce4f8f240 100644 --- a/minimal/mpconfigport.h +++ b/minimal/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built // You can disable the built-in MicroPython compiler by setting the following // config option to 0. If you do this then you won't get a REPL prompt, but you diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile index c04adaf6a..cdec130ee 100644 --- a/mpy-cross/Makefile +++ b/mpy-cross/Makefile @@ -44,7 +44,7 @@ COPT = -Os #-DNDEBUG endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. -# The unix port of micropython on OSX must be compiled with clang, +# The unix port of MicroPython on OSX must be compiled with clang, # while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) diff --git a/pic16bit/board.c b/pic16bit/board.c index 77f059fc7..0321b0ee2 100644 --- a/pic16bit/board.c +++ b/pic16bit/board.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/board.h b/pic16bit/board.h index f79dd3497..f45f87544 100644 --- a/pic16bit/board.h +++ b/pic16bit/board.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/main.c b/pic16bit/main.c index 343fe86d0..4a61c5ff5 100644 --- a/pic16bit/main.c +++ b/pic16bit/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpyb.c b/pic16bit/modpyb.c index 326d37f8a..4a608541e 100644 --- a/pic16bit/modpyb.c +++ b/pic16bit/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpyb.h b/pic16bit/modpyb.h index 910ec1b6e..ac19fd2f3 100644 --- a/pic16bit/modpyb.h +++ b/pic16bit/modpyb.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpybled.c b/pic16bit/modpybled.c index 797246d13..eb04689aa 100644 --- a/pic16bit/modpybled.c +++ b/pic16bit/modpybled.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/modpybswitch.c b/pic16bit/modpybswitch.c index aa102e821..4af0c9dfc 100644 --- a/pic16bit/modpybswitch.c +++ b/pic16bit/modpybswitch.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/mpconfigport.h b/pic16bit/mpconfigport.h index e4113956b..3cd099c67 100644 --- a/pic16bit/mpconfigport.h +++ b/pic16bit/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/pic16bit_mphal.c b/pic16bit/pic16bit_mphal.c index 557b1e0da..35955f2d3 100644 --- a/pic16bit/pic16bit_mphal.c +++ b/pic16bit/pic16bit_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/pic16bit/pic16bit_mphal.h b/pic16bit/pic16bit_mphal.h index ffcca41bf..f5da6cdc8 100644 --- a/pic16bit/pic16bit_mphal.h +++ b/pic16bit/pic16bit_mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/argcheck.c b/py/argcheck.c index 9f225345d..22fd9cd2c 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmarm.c b/py/asmarm.c index ff22aba90..552fdfb34 100644 --- a/py/asmarm.c +++ b/py/asmarm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmarm.h b/py/asmarm.h index c5900925f..a302b1590 100644 --- a/py/asmarm.h +++ b/py/asmarm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmthumb.c b/py/asmthumb.c index 7e92e4de4..4360a6af9 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmthumb.h b/py/asmthumb.h index 589c481cd..7070e03ac 100644 --- a/py/asmthumb.h +++ b/py/asmthumb.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx64.c b/py/asmx64.c index 6775e8e93..aa2a8ec7c 100644 --- a/py/asmx64.c +++ b/py/asmx64.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx64.h b/py/asmx64.h index a384cca00..425bdf2d3 100644 --- a/py/asmx64.h +++ b/py/asmx64.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx86.c b/py/asmx86.c index dd3ad0224..6a78fbd5e 100644 --- a/py/asmx86.c +++ b/py/asmx86.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/asmx86.h b/py/asmx86.h index fd34228d1..0a00e2e7c 100644 --- a/py/asmx86.h +++ b/py/asmx86.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/bc.c b/py/bc.c index 2e481bce7..522eb0aeb 100644 --- a/py/bc.c +++ b/py/bc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/bc.h b/py/bc.h index c55d31fe4..69e213e42 100644 --- a/py/bc.h +++ b/py/bc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/bc0.h b/py/bc0.h index be8ac6c15..f671c5b5a 100644 --- a/py/bc0.h +++ b/py/bc0.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -26,7 +26,7 @@ #ifndef MICROPY_INCLUDED_PY_BC0_H #define MICROPY_INCLUDED_PY_BC0_H -// Micro Python byte-codes. +// MicroPython byte-codes. // The comment at the end of the line (if it exists) tells the arguments to the byte-code. #define MP_BC_LOAD_CONST_FALSE (0x10) diff --git a/py/binary.c b/py/binary.c index 8bedc42aa..63b7f9f90 100644 --- a/py/binary.c +++ b/py/binary.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/binary.h b/py/binary.h index 04cc6d83b..7b5c60f1a 100644 --- a/py/binary.h +++ b/py/binary.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/builtin.h b/py/builtin.h index 4915383f2..a637b6e22 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/builtinevex.c b/py/builtinevex.c index 4390d0cc7..ba8048f70 100644 --- a/py/builtinevex.c +++ b/py/builtinevex.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/builtinimport.c b/py/builtinimport.c index e42360c11..5cd111ed4 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/compile.c b/py/compile.c index d2e05d0b2..00052e190 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -569,7 +569,7 @@ STATIC void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int for (int j = 0; j < this_scope->id_info_len; j++) { id_info_t *id2 = &this_scope->id_info[j]; if (id2->kind == ID_INFO_KIND_FREE && id->qst == id2->qst) { - // in Micro Python we load closures using LOAD_FAST + // in MicroPython we load closures using LOAD_FAST EMIT_LOAD_FAST(id->qst, id->local_num); nfree += 1; } @@ -654,9 +654,9 @@ STATIC void compile_funcdef_lambdef_param(compiler_t *comp, mp_parse_node_t pn) if (comp->have_star) { comp->num_dict_params += 1; - // in Micro Python we put the default dict parameters into a dictionary using the bytecode + // in MicroPython we put the default dict parameters into a dictionary using the bytecode if (comp->num_dict_params == 1) { - // in Micro Python we put the default positional parameters into a tuple using the bytecode + // in MicroPython we put the default positional parameters into a tuple using the bytecode // we need to do this here before we start building the map for the default keywords if (comp->num_default_params > 0) { EMIT_ARG(build_tuple, comp->num_default_params); @@ -700,7 +700,7 @@ STATIC void compile_funcdef_lambdef(compiler_t *comp, scope_t *scope, mp_parse_n return; } - // in Micro Python we put the default positional parameters into a tuple using the bytecode + // in MicroPython we put the default positional parameters into a tuple using the bytecode // the default keywords args may have already made the tuple; if not, do it now if (comp->num_default_params > 0 && comp->num_dict_params == 0) { EMIT_ARG(build_tuple, comp->num_default_params); @@ -3275,7 +3275,7 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind #endif STATIC void scope_compute_things(scope_t *scope) { - // in Micro Python we put the *x parameter after all other parameters (except **y) + // in MicroPython we put the *x parameter after all other parameters (except **y) if (scope->scope_flags & MP_SCOPE_FLAG_VARARGS) { id_info_t *id_param = NULL; for (int i = scope->id_info_len - 1; i >= 0; i--) { @@ -3313,7 +3313,7 @@ STATIC void scope_compute_things(scope_t *scope) { // compute the index of cell vars for (int i = 0; i < scope->id_info_len; i++) { id_info_t *id = &scope->id_info[i]; - // in Micro Python the cells come right after the fast locals + // in MicroPython the cells come right after the fast locals // parameters are not counted here, since they remain at the start // of the locals, even if they are cell vars if (id->kind == ID_INFO_KIND_CELL && !(id->flags & ID_FLAG_IS_PARAM)) { @@ -3333,14 +3333,14 @@ STATIC void scope_compute_things(scope_t *scope) { id_info_t *id2 = &scope->id_info[j]; if (id2->kind == ID_INFO_KIND_FREE && id->qst == id2->qst) { assert(!(id2->flags & ID_FLAG_IS_PARAM)); // free vars should not be params - // in Micro Python the frees come first, before the params + // in MicroPython the frees come first, before the params id2->local_num = num_free; num_free += 1; } } } } - // in Micro Python shift all other locals after the free locals + // in MicroPython shift all other locals after the free locals if (num_free > 0) { for (int i = 0; i < scope->id_info_len; i++) { id_info_t *id = &scope->id_info[i]; diff --git a/py/compile.h b/py/compile.h index f6b262d18..3297e83ae 100644 --- a/py/compile.h +++ b/py/compile.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emit.h b/py/emit.h index a58e20e3d..2b2c904f6 100644 --- a/py/emit.h +++ b/py/emit.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitbc.c b/py/emitbc.c index 127bf0bf9..677020925 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitcommon.c b/py/emitcommon.c index e914431d3..07b1dbb4c 100644 --- a/py/emitcommon.c +++ b/py/emitcommon.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitglue.c b/py/emitglue.c index fb7a54926..383e6a136 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitglue.h b/py/emitglue.h index 309996596..43930333d 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c index c1a4eac5d..577f65672 100644 --- a/py/emitinlinethumb.c +++ b/py/emitinlinethumb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/emitnative.c b/py/emitnative.c index 99adc809c..5ed69ff9b 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/formatfloat.c b/py/formatfloat.c index 2f10d425a..4130e8b26 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/formatfloat.h b/py/formatfloat.h index 9c8d137bb..9a1643b4d 100644 --- a/py/formatfloat.h +++ b/py/formatfloat.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/frozenmod.c b/py/frozenmod.c index 1eaaf574a..06d4f84c8 100644 --- a/py/frozenmod.c +++ b/py/frozenmod.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/frozenmod.h b/py/frozenmod.h index 6993167ac..8cddef681 100644 --- a/py/frozenmod.h +++ b/py/frozenmod.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/gc.c b/py/gc.c index 2af886c56..7253b7db6 100644 --- a/py/gc.c +++ b/py/gc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/gc.h b/py/gc.h index 136695517..739349c1f 100644 --- a/py/gc.h +++ b/py/gc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/grammar.h b/py/grammar.h index 0b70538d4..6abb1de8c 100644 --- a/py/grammar.h +++ b/py/grammar.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -32,7 +32,7 @@ // # single_input is a single interactive statement; // # file_input is a module or sequence of commands read from an input file; // # eval_input is the input for the eval() functions. -// # NB: compound_stmt in single_input is followed by extra NEWLINE! --> not in Micro Python +// # NB: compound_stmt in single_input is followed by extra NEWLINE! --> not in MicroPython // single_input: NEWLINE | simple_stmt | compound_stmt // file_input: (NEWLINE | stmt)* ENDMARKER // eval_input: testlist NEWLINE* ENDMARKER diff --git a/py/lexer.c b/py/lexer.c index 6e5cc18f4..32b3567cc 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/lexer.h b/py/lexer.h index 435aa096b..a29709107 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -32,7 +32,7 @@ #include "py/qstr.h" #include "py/reader.h" -/* lexer.h -- simple tokeniser for Micro Python +/* lexer.h -- simple tokeniser for MicroPython * * Uses (byte) length instead of null termination. * Tokens are the same - UTF-8 with (byte) length. diff --git a/py/malloc.c b/py/malloc.c index f48cb8da4..e679e2092 100644 --- a/py/malloc.c +++ b/py/malloc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -46,7 +46,7 @@ #include "py/gc.h" // We redirect standard alloc functions to GC heap - just for the rest of -// this module. In the rest of micropython source, system malloc can be +// this module. In the rest of MicroPython source, system malloc can be // freely accessed - for interfacing with system and 3rd-party libs for // example. On the other hand, some (e.g. bare-metal) ports may use GC // heap as system heap, so, to avoid warnings, we do undef's first. diff --git a/py/map.c b/py/map.c index 50d74f38f..7f3c90059 100644 --- a/py/map.c +++ b/py/map.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/misc.h b/py/misc.h index cebbd38ea..71425b85e 100644 --- a/py/misc.h +++ b/py/misc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mkrules.mk b/py/mkrules.mk index e66082001..860074caa 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -47,7 +47,7 @@ $(BUILD)/%.o: %.c $(call compile_c) # List all native flags since the current build system doesn't have -# the micropython configuration available. However, these flags are +# the MicroPython configuration available. However, these flags are # needed to extract all qstrings QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB -DN_ARM -DN_XTENSA QSTR_GEN_EXTRA_CFLAGS += -I$(BUILD)/tmp diff --git a/py/modarray.c b/py/modarray.c index 356e48bee..c0cdca928 100644 --- a/py/modarray.c +++ b/py/modarray.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 8fbf4daeb..1711ae58b 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modcmath.c b/py/modcmath.c index 7ad8f5ad6..627a2cbad 100644 --- a/py/modcmath.c +++ b/py/modcmath.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modcollections.c b/py/modcollections.c index e610a28d2..1a1560387 100644 --- a/py/modcollections.c +++ b/py/modcollections.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modgc.c b/py/modgc.c index 24564622e..d45e007eb 100644 --- a/py/modgc.c +++ b/py/modgc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modio.c b/py/modio.c index a6a093278..353a00286 100644 --- a/py/modio.c +++ b/py/modio.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modmath.c b/py/modmath.c index d5d135fc1..c56056a5d 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modmicropython.c b/py/modmicropython.c index 46a3922e6..6fa3f9ad2 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modstruct.c b/py/modstruct.c index 3c99ef1d8..1daa33338 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/modsys.c b/py/modsys.c index 0a8f3cd50..ee6f8686e 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -87,7 +87,7 @@ STATIC const mp_rom_obj_tuple_t mp_sys_implementation_obj = { #undef I #ifdef MICROPY_PY_SYS_PLATFORM -/// \constant platform - the platform that Micro Python is running on +/// \constant platform - the platform that MicroPython is running on STATIC const MP_DEFINE_STR_OBJ(platform_obj, MICROPY_PY_SYS_PLATFORM); #endif diff --git a/py/mphal.h b/py/mphal.h index 93a0a40ce..92de01d08 100644 --- a/py/mphal.h +++ b/py/mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpprint.c b/py/mpprint.c index 0afd8ca3b..6c02d7cef 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpprint.h b/py/mpprint.h index 20bd875b4..07462bddc 100644 --- a/py/mpprint.h +++ b/py/mpprint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpstate.c b/py/mpstate.c index 4fc8bc506..6ce64adfd 100644 --- a/py/mpstate.c +++ b/py/mpstate.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpstate.h b/py/mpstate.h index b09ba08cf..eca14a9e4 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -36,7 +36,7 @@ #include "py/objlist.h" #include "py/objexcept.h" -// This file contains structures defining the state of the Micro Python +// This file contains structures defining the state of the MicroPython // memory system, runtime and virtual machine. The state is a global // variable, but in the future it is hoped that the state can become local. diff --git a/py/mpz.c b/py/mpz.c index f58e262e2..d300a8e5d 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/mpz.h b/py/mpz.h index 55967cc4c..e2d0c30aa 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/nativeglue.c b/py/nativeglue.c index c75e5ec04..46c6906d9 100644 --- a/py/nativeglue.c +++ b/py/nativeglue.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -42,7 +42,7 @@ #if MICROPY_EMIT_NATIVE -// convert a Micro Python object to a valid native value based on type +// convert a MicroPython object to a valid native value based on type mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) { DEBUG_printf("mp_convert_obj_to_native(%p, " UINT_FMT ")\n", obj, type); switch (type & 0xf) { @@ -66,7 +66,7 @@ mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) { #if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM -// convert a native value to a Micro Python object based on type +// convert a native value to a MicroPython object based on type mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type) { DEBUG_printf("mp_convert_native_to_obj(" UINT_FMT ", " UINT_FMT ")\n", val, type); switch (type & 0xf) { diff --git a/py/nlr.h b/py/nlr.h index 624e97307..63fe392d9 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/nlrsetjmp.c b/py/nlrsetjmp.c index c3873e0b6..1fb459440 100644 --- a/py/nlrsetjmp.c +++ b/py/nlrsetjmp.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/obj.c b/py/obj.c index 1238b7011..515a95b2e 100644 --- a/py/obj.c +++ b/py/obj.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/obj.h b/py/obj.h index f88c10004..22bfda0f9 100644 --- a/py/obj.h +++ b/py/obj.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objarray.c b/py/objarray.c index 21479a800..99146bd4c 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objattrtuple.c b/py/objattrtuple.c index 8c5e79575..3cc298d4e 100644 --- a/py/objattrtuple.c +++ b/py/objattrtuple.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objbool.c b/py/objbool.c index 5bc04bb6f..e5bc3c228 100644 --- a/py/objbool.c +++ b/py/objbool.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objboundmeth.c b/py/objboundmeth.c index 57be6a6cf..890f8b15b 100644 --- a/py/objboundmeth.c +++ b/py/objboundmeth.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objcell.c b/py/objcell.c index 06a88b954..111906412 100644 --- a/py/objcell.c +++ b/py/objcell.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objclosure.c b/py/objclosure.c index 3e12358bb..4eb9eb8b8 100644 --- a/py/objclosure.c +++ b/py/objclosure.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objcomplex.c b/py/objcomplex.c index e4fbed1e8..f945f3560 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objdict.c b/py/objdict.c index 23d3008b8..a272ebdb6 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objenumerate.c b/py/objenumerate.c index faae6516c..1a9d30f83 100644 --- a/py/objenumerate.c +++ b/py/objenumerate.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objexcept.c b/py/objexcept.c index 4722aca91..a9fe04094 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objexcept.h b/py/objexcept.h index 2232e1e21..f67651a7e 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objfilter.c b/py/objfilter.c index a655b8a78..cb965d8c3 100644 --- a/py/objfilter.c +++ b/py/objfilter.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objfloat.c b/py/objfloat.c index d0e616612..15edd810f 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objfun.c b/py/objfun.c index 9f3589124..eaba13129 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -480,7 +480,7 @@ typedef mp_uint_t (*inline_asm_fun_2_t)(mp_uint_t, mp_uint_t); typedef mp_uint_t (*inline_asm_fun_3_t)(mp_uint_t, mp_uint_t, mp_uint_t); typedef mp_uint_t (*inline_asm_fun_4_t)(mp_uint_t, mp_uint_t, mp_uint_t, mp_uint_t); -// convert a Micro Python object to a sensible value for inline asm +// convert a MicroPython object to a sensible value for inline asm STATIC mp_uint_t convert_obj_for_inline_asm(mp_obj_t obj) { // TODO for byte_array, pass pointer to the array if (MP_OBJ_IS_SMALL_INT(obj)) { diff --git a/py/objfun.h b/py/objfun.h index 450c98f76..fbb351626 100644 --- a/py/objfun.h +++ b/py/objfun.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objgenerator.c b/py/objgenerator.c index 9d6e636b3..2f39f3a52 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objgenerator.h b/py/objgenerator.h index d61332a20..80bf9cd86 100644 --- a/py/objgenerator.h +++ b/py/objgenerator.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objgetitemiter.c b/py/objgetitemiter.c index a3c754448..afd6fb22b 100644 --- a/py/objgetitemiter.c +++ b/py/objgetitemiter.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint.c b/py/objint.c index 2749ec51c..29d889629 100644 --- a/py/objint.c +++ b/py/objint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint.h b/py/objint.h index f341306ed..394c23714 100644 --- a/py/objint.h +++ b/py/objint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 1d184a7dc..02c005d2f 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objint_mpz.c b/py/objint_mpz.c index 26492aab4..0791a8af2 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objlist.c b/py/objlist.c index 45e69c8bc..ba1c50677 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objlist.h b/py/objlist.h index 740ba9fda..28b5495a9 100644 --- a/py/objlist.h +++ b/py/objlist.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objmap.c b/py/objmap.c index 111c964fd..908c61507 100644 --- a/py/objmap.c +++ b/py/objmap.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objmodule.c b/py/objmodule.c index 43bb36b98..fc8507c27 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objmodule.h b/py/objmodule.h index 5bfbe51d5..b5c07dc33 100644 --- a/py/objmodule.h +++ b/py/objmodule.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 7ec5c2f41..fb9d9f02c 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objnone.c b/py/objnone.c index 5d5b83540..cd7319bec 100644 --- a/py/objnone.c +++ b/py/objnone.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objobject.c b/py/objobject.c index f9a7d17c3..49d2ec62e 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objproperty.c b/py/objproperty.c index 8189935d2..0934fad05 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objrange.c b/py/objrange.c index 8c4e14f49..33b07a9d4 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objreversed.c b/py/objreversed.c index fc85e72bf..a596a2fde 100644 --- a/py/objreversed.c +++ b/py/objreversed.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objset.c b/py/objset.c index f74bc74a0..376439b73 100644 --- a/py/objset.c +++ b/py/objset.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objsingleton.c b/py/objsingleton.c index 394c12767..ea72ae38c 100644 --- a/py/objsingleton.c +++ b/py/objsingleton.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objslice.c b/py/objslice.c index 928be6dab..358c44d06 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstr.c b/py/objstr.c index cea10770c..ddad7d3bd 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstr.h b/py/objstr.h index 6fbed405a..3aef8c68e 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstringio.c b/py/objstringio.c index 645c441cb..046d32580 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objstrunicode.c b/py/objstrunicode.c index d53428586..0cf791ff7 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objtuple.c b/py/objtuple.c index eaf0e37f4..0b05755fb 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objtuple.h b/py/objtuple.h index 686702395..05c6490fe 100644 --- a/py/objtuple.h +++ b/py/objtuple.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objtype.c b/py/objtype.c index 0c0826cf9..a258915f3 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -917,8 +917,8 @@ const mp_obj_type_t mp_type_type = { }; mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict) { - assert(MP_OBJ_IS_TYPE(bases_tuple, &mp_type_tuple)); // Micro Python restriction, for now - assert(MP_OBJ_IS_TYPE(locals_dict, &mp_type_dict)); // Micro Python restriction, for now + assert(MP_OBJ_IS_TYPE(bases_tuple, &mp_type_tuple)); // MicroPython restriction, for now + assert(MP_OBJ_IS_TYPE(locals_dict, &mp_type_dict)); // MicroPython restriction, for now // TODO might need to make a copy of locals_dict; at least that's how CPython does it diff --git a/py/objtype.h b/py/objtype.h index 104b20aab..52419f3cd 100644 --- a/py/objtype.h +++ b/py/objtype.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/objzip.c b/py/objzip.c index 6f72d1595..0183925e3 100644 --- a/py/objzip.c +++ b/py/objzip.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/opmethods.c b/py/opmethods.c index 80a953fb8..1200ba39e 100644 --- a/py/opmethods.c +++ b/py/opmethods.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parse.c b/py/parse.c index 2f16748a6..e399aac53 100644 --- a/py/parse.c +++ b/py/parse.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parse.h b/py/parse.h index fec18825b..9a1a2b4dd 100644 --- a/py/parse.h +++ b/py/parse.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenum.c b/py/parsenum.c index 177118843..b62029f7c 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenum.h b/py/parsenum.h index 77fd0f4a5..a5bed731d 100644 --- a/py/parsenum.h +++ b/py/parsenum.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenumbase.c b/py/parsenumbase.c index 73a3372f0..ba1059122 100644 --- a/py/parsenumbase.c +++ b/py/parsenumbase.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/parsenumbase.h b/py/parsenumbase.h index 143796df4..3a525f993 100644 --- a/py/parsenumbase.h +++ b/py/parsenumbase.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/qstr.c b/py/qstr.c index 5aa161064..fdb38f1de 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/qstr.h b/py/qstr.h index 4116eb81d..e2bdcc351 100644 --- a/py/qstr.h +++ b/py/qstr.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 4581e5e1b..9375b9101 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/repl.c b/py/repl.c index 8e55eb017..7e8922e19 100644 --- a/py/repl.c +++ b/py/repl.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/repl.h b/py/repl.h index c2499a270..a7a4136ca 100644 --- a/py/repl.h +++ b/py/repl.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/runtime.c b/py/runtime.c index ecc3ae2f5..6a0db007e 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -1038,7 +1038,7 @@ void mp_load_method_maybe(mp_obj_t obj, qstr attr, mp_obj_t *dest) { } else if (type->locals_dict != NULL) { // generic method lookup // this is a lookup in the object (ie not class or type) - assert(type->locals_dict->base.type == &mp_type_dict); // Micro Python restriction, for now + assert(type->locals_dict->base.type == &mp_type_dict); // MicroPython restriction, for now mp_map_t *locals_map = &type->locals_dict->map; mp_map_elem_t *elem = mp_map_lookup(locals_map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP); if (elem != NULL) { diff --git a/py/runtime.h b/py/runtime.h index 0add564cc..fe492885b 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/runtime0.h b/py/runtime0.h index 060ee8c0a..d22c2fabe 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/runtime_utils.c b/py/runtime_utils.c index e0495495a..56a918064 100644 --- a/py/runtime_utils.c +++ b/py/runtime_utils.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/scope.c b/py/scope.c index 8fe6f960a..1a6ae7b8a 100644 --- a/py/scope.c +++ b/py/scope.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/scope.h b/py/scope.h index 4d0c1b1d9..e3b6a57c7 100644 --- a/py/scope.h +++ b/py/scope.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/sequence.c b/py/sequence.c index 32db640dc..0752ee109 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/showbc.c b/py/showbc.c index 0bccf8427..bb2b084ed 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/smallint.c b/py/smallint.c index 4c42ee0cc..aa542ca7b 100644 --- a/py/smallint.c +++ b/py/smallint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/smallint.h b/py/smallint.h index b2bfc6df9..42679a78f 100644 --- a/py/smallint.h +++ b/py/smallint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stackctrl.c b/py/stackctrl.c index 1843e7339..0bcd82f4f 100644 --- a/py/stackctrl.c +++ b/py/stackctrl.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stackctrl.h b/py/stackctrl.h index 84c0e1427..ff8da0ab1 100644 --- a/py/stackctrl.h +++ b/py/stackctrl.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stream.c b/py/stream.c index 018609903..5d1868153 100644 --- a/py/stream.c +++ b/py/stream.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/stream.h b/py/stream.h index 0b5fd7cc0..401ae313c 100644 --- a/py/stream.h +++ b/py/stream.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/unicode.c b/py/unicode.c index c6f872038..eddb007d5 100644 --- a/py/unicode.c +++ b/py/unicode.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/unicode.h b/py/unicode.h index f99c9705d..19487a65a 100644 --- a/py/unicode.h +++ b/py/unicode.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/vm.c b/py/vm.c index bb120e775..c7fc83d04 100644 --- a/py/vm.c +++ b/py/vm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/vmentrytable.h b/py/vmentrytable.h index dd9789e34..352a6dc31 100644 --- a/py/vmentrytable.h +++ b/py/vmentrytable.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/vstr.c b/py/vstr.c index f41bd2e23..8a00f6c6f 100644 --- a/py/vstr.c +++ b/py/vstr.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/py/warning.c b/py/warning.c index 4cdf3b3f1..46b31ecca 100644 --- a/py/warning.c +++ b/py/warning.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/qemu-arm/mpconfigport.h b/qemu-arm/mpconfigport.h index ebec027e8..87e537af7 100644 --- a/qemu-arm/mpconfigport.h +++ b/qemu-arm/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (512) #define MICROPY_EMIT_X64 (0) diff --git a/stmhal/accel.c b/stmhal/accel.c index 0e6eaf03d..512a6e313 100644 --- a/stmhal/accel.c +++ b/stmhal/accel.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -102,7 +102,7 @@ STATIC void accel_start(void) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ #define NUM_AXIS (3) #define FILT_DEPTH (4) diff --git a/stmhal/accel.h b/stmhal/accel.h index 42b156329..fc35f7775 100644 --- a/stmhal/accel.h +++ b/stmhal/accel.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/adc.c b/stmhal/adc.c index 6485e2ab7..dd59e29c8 100644 --- a/stmhal/adc.c +++ b/stmhal/adc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -263,7 +263,7 @@ STATIC uint32_t adc_read_channel(ADC_HandleTypeDef *adcHandle) { } /******************************************************************************/ -/* Micro Python bindings : adc object (single channel) */ +/* MicroPython bindings : adc object (single channel) */ STATIC void adc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_obj_adc_t *self = self_in; @@ -596,7 +596,7 @@ float adc_read_core_vref(ADC_HandleTypeDef *adcHandle) { #endif /******************************************************************************/ -/* Micro Python bindings : adc_all object */ +/* MicroPython bindings : adc_all object */ STATIC mp_obj_t adc_all_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { // check number of arguments diff --git a/stmhal/adc.h b/stmhal/adc.h index 6ec558464..c90e6b343 100644 --- a/stmhal/adc.h +++ b/stmhal/adc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/bufhelper.c b/stmhal/bufhelper.c index ca76e9496..79511969b 100644 --- a/stmhal/bufhelper.c +++ b/stmhal/bufhelper.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/bufhelper.h b/stmhal/bufhelper.h index 55f57be8e..c1967bf43 100644 --- a/stmhal/bufhelper.h +++ b/stmhal/bufhelper.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/can.c b/stmhal/can.c index 6152022b7..9047e78ca 100644 --- a/stmhal/can.c +++ b/stmhal/can.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -262,7 +262,7 @@ STATIC HAL_StatusTypeDef CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout) } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC void pyb_can_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_can_obj_t *self = self_in; diff --git a/stmhal/can.h b/stmhal/can.h index 7c40e9bf9..860012813 100644 --- a/stmhal/can.h +++ b/stmhal/can.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/dac.c b/stmhal/dac.c index 243aa08c3..cdb3a9bcd 100644 --- a/stmhal/dac.c +++ b/stmhal/dac.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -124,7 +124,7 @@ STATIC uint32_t TIMx_Config(mp_obj_t timer) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings typedef enum { DAC_STATE_RESET, diff --git a/stmhal/dac.h b/stmhal/dac.h index 93192c0fe..f487f52a9 100644 --- a/stmhal/dac.h +++ b/stmhal/dac.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/dma.c b/stmhal/dma.c index e43b67e73..df6275d65 100644 --- a/stmhal/dma.c +++ b/stmhal/dma.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/dma.h b/stmhal/dma.h index d8b11ca3a..55fb62175 100644 --- a/stmhal/dma.h +++ b/stmhal/dma.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/extint.c b/stmhal/extint.c index 70023557f..24a68c2a2 100644 --- a/stmhal/extint.c +++ b/stmhal/extint.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/extint.h b/stmhal/extint.h index 0eae8942c..846790b9b 100644 --- a/stmhal/extint.h +++ b/stmhal/extint.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/flash.c b/stmhal/flash.c index e374be0e5..bebb3a161 100644 --- a/stmhal/flash.c +++ b/stmhal/flash.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/flash.h b/stmhal/flash.h index c5b5bf352..688e70a3c 100644 --- a/stmhal/flash.h +++ b/stmhal/flash.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/font_petme128_8x8.h b/stmhal/font_petme128_8x8.h index f27277760..8b0cc9cb0 100644 --- a/stmhal/font_petme128_8x8.h +++ b/stmhal/font_petme128_8x8.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/gccollect.c b/stmhal/gccollect.c index d7223dedc..937fb6f36 100644 --- a/stmhal/gccollect.c +++ b/stmhal/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/gccollect.h b/stmhal/gccollect.h index 2cb32a8d4..1b64a51a6 100644 --- a/stmhal/gccollect.h +++ b/stmhal/gccollect.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h b/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h index b890c3d98..52ca6406b 100644 --- a/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h +++ b/stmhal/hal/l4/inc/stm32l4xx_hal_uart.h @@ -1370,7 +1370,7 @@ void UART_AdvFeatureConfig(UART_HandleTypeDef *huart); /** * @} */ -/* Functions added by micropython */ +/* Functions added by MicroPython */ uint32_t HAL_UART_CalcBrr(uint32_t fck, uint32_t baud); #ifdef __cplusplus diff --git a/stmhal/hal/l4/src/stm32l4xx_hal_uart.c b/stmhal/hal/l4/src/stm32l4xx_hal_uart.c index 2b0d76d30..adb3d79ab 100644 --- a/stmhal/hal/l4/src/stm32l4xx_hal_uart.c +++ b/stmhal/hal/l4/src/stm32l4xx_hal_uart.c @@ -2104,7 +2104,7 @@ static HAL_StatusTypeDef UART_Receive_IT(UART_HandleTypeDef *huart) /** * @brief Calculate register BRR value without using uint64. - * @note This function is added by the micropython project. + * @note This function is added by the MicroPython project. * @param fck: Input clock frequency to the uart block in Hz. * @param baud: baud rate should be one of {300, 600, 1200, 2400, 4800, 9600, 19200, 57600, 115200}. * @retval BRR value diff --git a/stmhal/help.c b/stmhal/help.c index 83ef7e596..87b2af526 100644 --- a/stmhal/help.c +++ b/stmhal/help.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/i2c.c b/stmhal/i2c.c index f77222715..f102fd0f2 100644 --- a/stmhal/i2c.c +++ b/stmhal/i2c.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -511,7 +511,7 @@ STATIC HAL_StatusTypeDef i2c_wait_dma_finished(I2C_HandleTypeDef *i2c, uint32_t } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; } diff --git a/stmhal/i2c.h b/stmhal/i2c.h index eda076e82..6affe3973 100644 --- a/stmhal/i2c.h +++ b/stmhal/i2c.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/irq.c b/stmhal/irq.c index 44758e11b..d6db8e83d 100644 --- a/stmhal/irq.c +++ b/stmhal/irq.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/irq.h b/stmhal/irq.h index 8d44b50ed..2cf58639e 100644 --- a/stmhal/irq.h +++ b/stmhal/irq.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/lcd.c b/stmhal/lcd.c index cdf9fa0d1..7368193cf 100644 --- a/stmhal/lcd.c +++ b/stmhal/lcd.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/lcd.h b/stmhal/lcd.h index be4f6ed25..c0d9bd97d 100644 --- a/stmhal/lcd.h +++ b/stmhal/lcd.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/led.c b/stmhal/led.c index 4b9895fc5..030a814dd 100644 --- a/stmhal/led.c +++ b/stmhal/led.c @@ -279,7 +279,7 @@ void led_debug(int n, int delay) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ void led_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_led_obj_t *self = self_in; diff --git a/stmhal/led.h b/stmhal/led.h index fc9348181..f1b05d1e2 100644 --- a/stmhal/led.h +++ b/stmhal/led.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/main.c b/stmhal/main.c index 566c2db07..056c590cd 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -511,7 +511,7 @@ int main(void) { // GC init gc_init(&_heap_start, &_heap_end); - // Micro Python init + // MicroPython init mp_init(); mp_obj_list_init(mp_sys_path, 0); mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script) diff --git a/stmhal/modnetwork.c b/stmhal/modnetwork.c index 09a80ef3c..6b4949a0d 100644 --- a/stmhal/modnetwork.c +++ b/stmhal/modnetwork.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modnetwork.h b/stmhal/modnetwork.h index 83e4255d5..ecda94da4 100644 --- a/stmhal/modnetwork.h +++ b/stmhal/modnetwork.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modnwcc3k.c b/stmhal/modnwcc3k.c index 957d74e6e..a04a2d260 100644 --- a/stmhal/modnwcc3k.c +++ b/stmhal/modnwcc3k.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -412,7 +412,7 @@ STATIC int cc3k_socket_ioctl(mod_network_socket_obj_t *socket, mp_uint_t request } /******************************************************************************/ -// Micro Python bindings; CC3K class +// MicroPython bindings; CC3K class typedef struct _cc3k_obj_t { mp_obj_base_t base; diff --git a/stmhal/modnwwiznet5k.c b/stmhal/modnwwiznet5k.c index 4752cdc0b..eb7eb8443 100644 --- a/stmhal/modnwwiznet5k.c +++ b/stmhal/modnwwiznet5k.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -314,7 +314,7 @@ STATIC mp_obj_t wiznet5k_socket_disconnect(mp_obj_t self_in) { #endif /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings /// \classmethod \constructor(spi, pin_cs, pin_rst) /// Create and return a WIZNET5K object. diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c index 7322c6a5b..5dc28e132 100644 --- a/stmhal/modpyb.c +++ b/stmhal/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modstm.c b/stmhal/modstm.c index eabbf08e4..2084c0aa0 100644 --- a/stmhal/modstm.c +++ b/stmhal/modstm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/moduos.c b/stmhal/moduos.c index ece6019fb..77a60c0cb 100644 --- a/stmhal/moduos.c +++ b/stmhal/moduos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modusocket.c b/stmhal/modusocket.c index 081a322ae..e1da53a4b 100644 --- a/stmhal/modusocket.c +++ b/stmhal/modusocket.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/modutime.c b/stmhal/modutime.c index 58c43a55e..fe13f80c0 100644 --- a/stmhal/modutime.c +++ b/stmhal/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pendsv.c b/stmhal/pendsv.c index 7b3906f25..00ea12f46 100644 --- a/stmhal/pendsv.c +++ b/stmhal/pendsv.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pendsv.h b/stmhal/pendsv.h index b64e61386..6a9eb0d79 100644 --- a/stmhal/pendsv.h +++ b/stmhal/pendsv.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin.c b/stmhal/pin.c index f30474e1f..0dce0c1c0 100644 --- a/stmhal/pin.c +++ b/stmhal/pin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin.h b/stmhal/pin.h index 1ec4bd6b8..90de79e5c 100644 --- a/stmhal/pin.h +++ b/stmhal/pin.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin_defs_stmhal.h b/stmhal/pin_defs_stmhal.h index d6a2ef424..6cf3b1b83 100644 --- a/stmhal/pin_defs_stmhal.h +++ b/stmhal/pin_defs_stmhal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/pin_named_pins.c b/stmhal/pin_named_pins.c index fac19ee97..726da54dd 100644 --- a/stmhal/pin_named_pins.c +++ b/stmhal/pin_named_pins.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/portmodules.h b/stmhal/portmodules.h index 4e892da96..b575109b8 100644 --- a/stmhal/portmodules.h +++ b/stmhal/portmodules.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/qstrdefsport.h b/stmhal/qstrdefsport.h index 1d83f43bd..31220c5a4 100644 --- a/stmhal/qstrdefsport.h +++ b/stmhal/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/rng.c b/stmhal/rng.c index a5a9874d1..c0c5e9aeb 100644 --- a/stmhal/rng.c +++ b/stmhal/rng.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/rng.h b/stmhal/rng.h index f022f3a67..43e49fe72 100644 --- a/stmhal/rng.h +++ b/stmhal/rng.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/rtc.c b/stmhal/rtc.c index 755684570..4efc56d5c 100644 --- a/stmhal/rtc.c +++ b/stmhal/rtc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -412,7 +412,7 @@ STATIC void RTC_CalendarConfig(void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings typedef struct _pyb_rtc_obj_t { mp_obj_base_t base; diff --git a/stmhal/rtc.h b/stmhal/rtc.h index f382fa6b6..09ab2aedf 100644 --- a/stmhal/rtc.h +++ b/stmhal/rtc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c index 5260e0a50..dfa7158a4 100644 --- a/stmhal/sdcard.c +++ b/stmhal/sdcard.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -356,7 +356,7 @@ mp_uint_t sdcard_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t n } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings // // Expose the SD card as an object with the block protocol. diff --git a/stmhal/sdcard.h b/stmhal/sdcard.h index d595f0f1a..8c698fc2f 100644 --- a/stmhal/sdcard.h +++ b/stmhal/sdcard.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/servo.c b/stmhal/servo.c index e4bcbc30e..fa39587a8 100644 --- a/stmhal/servo.c +++ b/stmhal/servo.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -147,7 +147,7 @@ STATIC void servo_init_channel(pyb_servo_obj_t *s) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings STATIC mp_obj_t pyb_servo_set(mp_obj_t port, mp_obj_t value) { int p = mp_obj_get_int(port); diff --git a/stmhal/servo.h b/stmhal/servo.h index 18fd493d5..c602a07da 100644 --- a/stmhal/servo.h +++ b/stmhal/servo.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/spi.c b/stmhal/spi.c index b710fc3a7..574fed073 100644 --- a/stmhal/spi.c +++ b/stmhal/spi.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/spi.h b/stmhal/spi.h index e6752fdd1..eda109a7e 100644 --- a/stmhal/spi.h +++ b/stmhal/spi.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/stm32_it.c b/stmhal/stm32_it.c index 357b6d79d..2111da1ae 100644 --- a/stmhal/stm32_it.c +++ b/stmhal/stm32_it.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Original template from ST Cube library. See below for header. * diff --git a/stmhal/stm32_it.h b/stmhal/stm32_it.h index d6ed1b2b9..b498dee8d 100644 --- a/stmhal/stm32_it.h +++ b/stmhal/stm32_it.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Original template from ST Cube library. See below for header. * diff --git a/stmhal/storage.c b/stmhal/storage.c index 1931cd607..6da1ba95c 100644 --- a/stmhal/storage.c +++ b/stmhal/storage.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/storage.h b/stmhal/storage.h index 0ecb5715a..291e09a9a 100644 --- a/stmhal/storage.h +++ b/stmhal/storage.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/system_stm32.c b/stmhal/system_stm32.c index a63bd3c57..7fc16b148 100644 --- a/stmhal/system_stm32.c +++ b/stmhal/system_stm32.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * Taken from ST Cube library and modified. See below for original header. * diff --git a/stmhal/systick.c b/stmhal/systick.c index 4eac583e2..c07d0fabc 100644 --- a/stmhal/systick.c +++ b/stmhal/systick.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/systick.h b/stmhal/systick.h index 524afae40..c1def50c2 100644 --- a/stmhal/systick.h +++ b/stmhal/systick.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/timer.c b/stmhal/timer.c index 6513f95d3..570558775 100644 --- a/stmhal/timer.c +++ b/stmhal/timer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -247,7 +247,7 @@ uint32_t timer_get_source_freq(uint32_t tim_id) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC const mp_obj_type_t pyb_timer_channel_type; diff --git a/stmhal/timer.h b/stmhal/timer.h index 72e461f2f..775accc3d 100644 --- a/stmhal/timer.h +++ b/stmhal/timer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/uart.c b/stmhal/uart.c index b4ff40e79..ddff8b9f2 100644 --- a/stmhal/uart.c +++ b/stmhal/uart.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -509,7 +509,7 @@ void uart_irq_handler(mp_uint_t uart_id) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_uart_obj_t *self = self_in; diff --git a/stmhal/uart.h b/stmhal/uart.h index 749530954..e96b25b5f 100644 --- a/stmhal/uart.h +++ b/stmhal/uart.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usb.c b/stmhal/usb.c index f70dea142..9bf351f49 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -169,7 +169,7 @@ void usb_vcp_send_strn_cooked(const char *str, int len) { } /******************************************************************************/ -// Micro Python bindings for USB +// MicroPython bindings for USB /* Philosophy of USB driver and Python API: pyb.usb_mode(...) configures the USB @@ -324,7 +324,7 @@ STATIC mp_obj_t pyb_usb_mode(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(pyb_usb_mode_obj, 0, pyb_usb_mode); /******************************************************************************/ -// Micro Python bindings for USB VCP +// MicroPython bindings for USB VCP /// \moduleref pyb /// \class USB_VCP - USB virtual comm port @@ -525,7 +525,7 @@ const mp_obj_type_t pyb_usb_vcp_type = { }; /******************************************************************************/ -// Micro Python bindings for USB HID +// MicroPython bindings for USB HID typedef struct _pyb_usb_hid_obj_t { mp_obj_base_t base; diff --git a/stmhal/usb.h b/stmhal/usb.h index e04fe70d7..d39f49a6c 100644 --- a/stmhal/usb.h +++ b/stmhal/usb.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbd_cdc_interface.h b/stmhal/usbd_cdc_interface.h index 6f9a1e8a3..811a28928 100644 --- a/stmhal/usbd_cdc_interface.h +++ b/stmhal/usbd_cdc_interface.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ #ifndef MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H #define MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H diff --git a/stmhal/usbd_conf.c b/stmhal/usbd_conf.c index e2bd6c949..d39144851 100644 --- a/stmhal/usbd_conf.c +++ b/stmhal/usbd_conf.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ /** diff --git a/stmhal/usbd_conf.h b/stmhal/usbd_conf.h index b69ba52c2..34ebe27b9 100644 --- a/stmhal/usbd_conf.h +++ b/stmhal/usbd_conf.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ /** diff --git a/stmhal/usbd_desc.c b/stmhal/usbd_desc.c index 1ad960b46..09e1608c8 100644 --- a/stmhal/usbd_desc.c +++ b/stmhal/usbd_desc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ */ /** diff --git a/stmhal/usbd_desc.h b/stmhal/usbd_desc.h index f48e364e1..05cbbe5b1 100644 --- a/stmhal/usbd_desc.h +++ b/stmhal/usbd_desc.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbd_msc_storage.h b/stmhal/usbd_msc_storage.h index a4bc8004a..6cc40d2d6 100644 --- a/stmhal/usbd_msc_storage.h +++ b/stmhal/usbd_msc_storage.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h index ec03c860a..08882bb1a 100644 --- a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h +++ b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c index e0edf1370..d61073f4d 100644 --- a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c +++ b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c index 63cd440d4..a7721ad77 100644 --- a/stmhal/usrsw.c +++ b/stmhal/usrsw.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -63,7 +63,7 @@ int switch_get(void) { } /******************************************************************************/ -// Micro Python bindings +// MicroPython bindings typedef struct _pyb_switch_obj_t { mp_obj_base_t base; diff --git a/stmhal/usrsw.h b/stmhal/usrsw.h index 9fbe6109d..d96e3c281 100644 --- a/stmhal/usrsw.h +++ b/stmhal/usrsw.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/hal_ftm.c b/teensy/hal_ftm.c index 28992881b..3c031bf6d 100644 --- a/teensy/hal_ftm.c +++ b/teensy/hal_ftm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/hal_ftm.h b/teensy/hal_ftm.h index ad627358b..84fae8312 100644 --- a/teensy/hal_ftm.h +++ b/teensy/hal_ftm.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/help.c b/teensy/help.c index 3b3916b94..ebe4bed6b 100644 --- a/teensy/help.c +++ b/teensy/help.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/led.c b/teensy/led.c index c7ac8be1f..c043e4399 100644 --- a/teensy/led.c +++ b/teensy/led.c @@ -81,7 +81,7 @@ void led_toggle(pyb_led_t led) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ void led_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_led_obj_t *self = self_in; diff --git a/teensy/main.c b/teensy/main.c index 41bbeb5d9..3edaa28a0 100644 --- a/teensy/main.c +++ b/teensy/main.c @@ -266,7 +266,7 @@ int main(void) { // GC init gc_init(&_heap_start, (void*)HEAP_END); - // Micro Python init + // MicroPython init mp_init(); mp_obj_list_init(mp_sys_path, 0); mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script) diff --git a/teensy/modpyb.c b/teensy/modpyb.c index 9f601e327..deb1f32f9 100644 --- a/teensy/modpyb.c +++ b/teensy/modpyb.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -154,7 +154,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_sync_obj, pyb_sync); /// \function millis() /// Returns the number of milliseconds since the board was last reset. /// -/// The result is always a micropython smallint (31-bit signed number), so +/// The result is always a MicroPython smallint (31-bit signed number), so /// after 2^30 milliseconds (about 12.4 days) this will start to return /// negative numbers. STATIC mp_obj_t pyb_millis(void) { @@ -185,7 +185,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_elapsed_millis_obj, pyb_elapsed_millis); /// \function micros() /// Returns the number of microseconds since the board was last reset. /// -/// The result is always a micropython smallint (31-bit signed number), so +/// The result is always a MicroPython smallint (31-bit signed number), so /// after 2^30 microseconds (about 17.8 minutes) this will start to return /// negative numbers. STATIC mp_obj_t pyb_micros(void) { diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h index de30924d9..69cd69d53 100644 --- a/teensy/mpconfigport.h +++ b/teensy/mpconfigport.h @@ -1,6 +1,6 @@ #include -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_PATH_MAX (128) #define MICROPY_EMIT_THUMB (1) diff --git a/teensy/timer.c b/teensy/timer.c index 45bcc2b8f..bc560d85e 100644 --- a/teensy/timer.c +++ b/teensy/timer.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -119,7 +119,7 @@ mp_uint_t get_prescaler_shift(mp_int_t prescaler) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC const mp_obj_type_t pyb_timer_channel_type; diff --git a/teensy/timer.h b/teensy/timer.h index 89095b076..75c2e654e 100644 --- a/teensy/timer.h +++ b/teensy/timer.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/teensy/uart.c b/teensy/uart.c index b4c0a4d5b..3dd2c5051 100644 --- a/teensy/uart.c +++ b/teensy/uart.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -221,7 +221,7 @@ void uart_tx_strn_cooked(pyb_uart_obj_t *uart_obj, const char *str, uint len) { } /******************************************************************************/ -/* Micro Python bindings */ +/* MicroPython bindings */ STATIC void pyb_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_uart_obj_t *self = self_in; diff --git a/tests/basics/bytearray_slice_assign.py b/tests/basics/bytearray_slice_assign.py index 48f5938a5..7f7d1d119 100644 --- a/tests/basics/bytearray_slice_assign.py +++ b/tests/basics/bytearray_slice_assign.py @@ -4,7 +4,7 @@ print("SKIP") raise SystemExit -# test slices; only 2 argument version supported by Micro Python at the moment +# test slices; only 2 argument version supported by MicroPython at the moment x = bytearray(range(10)) # Assignment diff --git a/tests/basics/list_slice_assign.py b/tests/basics/list_slice_assign.py index 1ad1ef27c..885615717 100644 --- a/tests/basics/list_slice_assign.py +++ b/tests/basics/list_slice_assign.py @@ -1,4 +1,4 @@ -# test slices; only 2 argument version supported by Micro Python at the moment +# test slices; only 2 argument version supported by MicroPython at the moment x = list(range(10)) # Assignment diff --git a/tests/io/stringio1.py b/tests/io/stringio1.py index fa50f282e..9f7c1e44e 100644 --- a/tests/io/stringio1.py +++ b/tests/io/stringio1.py @@ -36,7 +36,7 @@ a = io.StringIO() a.close() for f in [a.read, a.getvalue, lambda:a.write("")]: - # CPython throws for operations on closed I/O, micropython makes + # CPython throws for operations on closed I/O, MicroPython makes # the underlying string empty unless MICROPY_CPYTHON_COMPAT defined try: f() diff --git a/tests/run-bench-tests b/tests/run-bench-tests index 1e5e7804b..d48b4b7ec 100755 --- a/tests/run-bench-tests +++ b/tests/run-bench-tests @@ -26,7 +26,7 @@ def run_tests(pyb, test_dict): print(base_test + ":") for test_file in tests: - # run Micro Python + # run MicroPython if pyb is None: # run on PC try: diff --git a/tests/run-tests b/tests/run-tests index bd4a1363c..f9c26283d 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -388,7 +388,7 @@ def run_tests(pyb, tests, args, base_path="."): if args.write_exp: continue - # run Micro Python + # run MicroPython output_mupy = run_micropython(pyb, args, test_file) if output_mupy == b'SKIP\n': diff --git a/tools/gen-cpydiff.py b/tools/gen-cpydiff.py index 86ec816e9..aff5b56e7 100644 --- a/tools/gen-cpydiff.py +++ b/tools/gen-cpydiff.py @@ -33,7 +33,7 @@ import re from collections import namedtuple -# Micropython supports syntax of CPython 3.4 with some features from 3.5, and +# MicroPython supports syntax of CPython 3.4 with some features from 3.5, and # such version should be used to test for differences. If your default python3 # executable is of lower version, you can point MICROPY_CPYTHON3 environment var # to the correct executable. diff --git a/unix/Makefile b/unix/Makefile index 88e1c30a7..9eff02e07 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -74,7 +74,7 @@ CFLAGS += -U _FORTIFY_SOURCE endif # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. -# The unix port of micropython on OSX must be compiled with clang, +# The unix port of MicroPython on OSX must be compiled with clang, # while cross-compile ports require gcc, so we test here for OSX and # if necessary override the value of 'CC' set in py/mkenv.mk ifeq ($(UNAME_S),Darwin) diff --git a/unix/alloc.c b/unix/alloc.c index 54fc1d3c4..ca12d025b 100644 --- a/unix/alloc.c +++ b/unix/alloc.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/fdfile.h b/unix/fdfile.h index 591159deb..69a9b6be4 100644 --- a/unix/fdfile.h +++ b/unix/fdfile.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/file.c b/unix/file.c index a60840c81..f27e23547 100644 --- a/unix/file.c +++ b/unix/file.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/gccollect.c b/unix/gccollect.c index 4ec8c2bf5..02f6fc91a 100644 --- a/unix/gccollect.c +++ b/unix/gccollect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/input.c b/unix/input.c index 4b10350df..7d60b46cc 100644 --- a/unix/input.c +++ b/unix/input.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/main.c b/unix/main.c index 633144c86..e861d7f11 100644 --- a/unix/main.c +++ b/unix/main.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modffi.c b/unix/modffi.c index 8b392f1c3..6c5e4f22e 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modjni.c b/unix/modjni.c index 896f2f919..540964d44 100644 --- a/unix/modjni.c +++ b/unix/modjni.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modmachine.c b/unix/modmachine.c index 33a3b098e..48dddec0a 100644 --- a/unix/modmachine.c +++ b/unix/modmachine.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modos.c b/unix/modos.c index 4b4431e91..f096e88f5 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modsocket.c b/unix/modsocket.c index c1f88defc..c612f870d 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modtermios.c b/unix/modtermios.c index 5e82e772a..fe19aac83 100644 --- a/unix/modtermios.c +++ b/unix/modtermios.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/modtime.c b/unix/modtime.c index 2a6487df2..a74b81f37 100644 --- a/unix/modtime.c +++ b/unix/modtime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/moduselect.c b/unix/moduselect.c index 37a3a33b2..ba1c195ef 100644 --- a/unix/moduselect.c +++ b/unix/moduselect.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index a18a16e50..0d99bd5cd 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ENABLE_SCHEDULER (1) #define MICROPY_ALLOC_PATH_MAX (PATH_MAX) diff --git a/unix/mpconfigport_fast.h b/unix/mpconfigport_fast.h index b5be9f334..442159eb4 100644 --- a/unix/mpconfigport_fast.h +++ b/unix/mpconfigport_fast.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/mpconfigport_minimal.h b/unix/mpconfigport_minimal.h index b4d9f8143..e37605eab 100644 --- a/unix/mpconfigport_minimal.h +++ b/unix/mpconfigport_minimal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built #define MICROPY_ALLOC_QSTR_CHUNK_INIT (64) #define MICROPY_ALLOC_PARSE_RULE_INIT (8) diff --git a/unix/mphalport.h b/unix/mphalport.h index cf227872f..ff7a51567 100644 --- a/unix/mphalport.h +++ b/unix/mphalport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/qstrdefsport.h b/unix/qstrdefsport.h index 8ab2db58f..ebfaa6cca 100644 --- a/unix/qstrdefsport.h +++ b/unix/qstrdefsport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/unix/unix_mphal.c b/unix/unix_mphal.c index 800484498..02cdbea11 100644 --- a/unix/unix_mphal.c +++ b/unix/unix_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/init.c b/windows/init.c index 669092347..09fa10417 100644 --- a/windows/init.c +++ b/windows/init.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/init.h b/windows/init.h index 480befef6..c6fddb257 100644 --- a/windows/init.h +++ b/windows/init.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index f2f6cbd32..c4e6ba131 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// options to control how Micro Python is built +// options to control how MicroPython is built // Linking with GNU readline (MICROPY_USE_READLINE == 2) causes binary to be licensed under GPL #ifndef MICROPY_USE_READLINE diff --git a/windows/msvc/gettimeofday.c b/windows/msvc/gettimeofday.c index 6d7264ae7..5f816df70 100644 --- a/windows/msvc/gettimeofday.c +++ b/windows/msvc/gettimeofday.c @@ -1,5 +1,5 @@ /* -* This file is part of the Micro Python project, http://micropython.org/ +* This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/msvc/sys/time.h b/windows/msvc/sys/time.h index a36648beb..7c95d409e 100644 --- a/windows/msvc/sys/time.h +++ b/windows/msvc/sys/time.h @@ -1,5 +1,5 @@ /* -* This file is part of the Micro Python project, http://micropython.org/ +* This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/msvc/unistd.h b/windows/msvc/unistd.h index 87787c3d8..1a1629be4 100644 --- a/windows/msvc/unistd.h +++ b/windows/msvc/unistd.h @@ -1,5 +1,5 @@ /* -* This file is part of the Micro Python project, http://micropython.org/ +* This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/realpath.c b/windows/realpath.c index c0ed6b84d..ac9adf812 100644 --- a/windows/realpath.c +++ b/windows/realpath.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/realpath.h b/windows/realpath.h index c7bb3acd7..869fe80fa 100644 --- a/windows/realpath.h +++ b/windows/realpath.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/sleep.c b/windows/sleep.c index b8f0a2e9b..6043ec7b7 100644 --- a/windows/sleep.c +++ b/windows/sleep.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/sleep.h b/windows/sleep.h index 6c0c00332..430ec3a43 100644 --- a/windows/sleep.h +++ b/windows/sleep.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c index a73140e54..153b04423 100644 --- a/windows/windows_mphal.c +++ b/windows/windows_mphal.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/windows/windows_mphal.h b/windows/windows_mphal.h index 854e14a7a..5a93d4e18 100644 --- a/windows/windows_mphal.h +++ b/windows/windows_mphal.h @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/zephyr/machine_pin.c b/zephyr/machine_pin.c index 38971399c..c3722926a 100644 --- a/zephyr/machine_pin.c +++ b/zephyr/machine_pin.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * diff --git a/zephyr/modutime.c b/zephyr/modutime.c index 0c268046a..a5d32fe66 100644 --- a/zephyr/modutime.c +++ b/zephyr/modutime.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * From 4946054f05c65ed0ee35a37ecb83ba6f7655a16a Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 31 Jul 2017 22:38:37 +0300 Subject: [PATCH 335/403] extmod/modlwip: Implement setsockopt(IP_ADD_MEMBERSHIP). Allows to join multicast groups. --- extmod/modlwip.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 9d1a8c4d0..bde251cca 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -45,6 +45,7 @@ //#include "lwip/raw.h" #include "lwip/dns.h" #include "lwip/tcp_impl.h" +#include "lwip/igmp.h" #if 0 // print debugging info #define DEBUG_printf DEBUG_printf @@ -52,6 +53,10 @@ #define DEBUG_printf(...) (void)0 #endif +// All socket options should be globally distinct, +// because we ignore option levels for efficiency. +#define IP_ADD_MEMBERSHIP 0x400 + // For compatibilily with older lwIP versions. #ifndef ip_set_option #define ip_set_option(pcb, opt) ((pcb)->so_options |= (opt)) @@ -1079,10 +1084,10 @@ STATIC mp_obj_t lwip_socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) { return mp_const_none; } - // Integer options - mp_int_t val = mp_obj_get_int(args[3]); switch (opt) { - case SOF_REUSEADDR: + // level: SOL_SOCKET + case SOF_REUSEADDR: { + mp_int_t val = mp_obj_get_int(args[3]); // Options are common for UDP and TCP pcb's. if (val) { ip_set_option(socket->pcb.tcp, SOF_REUSEADDR); @@ -1090,6 +1095,24 @@ STATIC mp_obj_t lwip_socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) { ip_reset_option(socket->pcb.tcp, SOF_REUSEADDR); } break; + } + + // level: IPPROTO_IP + case IP_ADD_MEMBERSHIP: { + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ); + if (bufinfo.len != sizeof(ip_addr_t) * 2) { + mp_raise_ValueError(NULL); + } + + // POSIX setsockopt has order: group addr, if addr, lwIP has it vice-versa + err_t err = igmp_joingroup((ip_addr_t*)bufinfo.buf + 1, bufinfo.buf); + if (err != ERR_OK) { + mp_raise_OSError(error_lookup_table[-err]); + } + break; + } + default: printf("Warning: lwip.setsockopt() not implemented\n"); } @@ -1342,6 +1365,9 @@ STATIC const mp_rom_map_elem_t mp_module_lwip_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_ROM_INT(1) }, { MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_ROM_INT(SOF_REUSEADDR) }, + + { MP_ROM_QSTR(MP_QSTR_IPPROTO_IP), MP_ROM_INT(0) }, + { MP_ROM_QSTR(MP_QSTR_IP_ADD_MEMBERSHIP), MP_ROM_INT(IP_ADD_MEMBERSHIP) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_lwip_globals, mp_module_lwip_globals_table); From 05856f3d637f2fd7c565c5fb504a2cf7c8a1a6ae Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 2 Aug 2017 13:42:34 +1000 Subject: [PATCH 336/403] py,extmod,stmhal: Use "static inline" for funcs that should be inline. "STATIC inline" can expand to "inline" if STATIC is defined to nothing, and this case can lead to link errors. --- extmod/moductypes.c | 4 ++-- py/modbuiltins.c | 2 +- stmhal/i2c.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extmod/moductypes.c b/extmod/moductypes.c index 9678fd58f..c2d226562 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -281,13 +281,13 @@ STATIC mp_obj_t uctypes_struct_sizeof(mp_obj_t obj_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(uctypes_struct_sizeof_obj, uctypes_struct_sizeof); -STATIC inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) { +static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) { char struct_type = big_endian ? '>' : '<'; static const char type2char[16] = "BbHhIiQq------fd"; return mp_binary_get_val(struct_type, type2char[val_type], &p); } -STATIC inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) { +static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) { char struct_type = big_endian ? '>' : '<'; static const char type2char[16] = "BbHhIiQq------fd"; mp_binary_set_val(struct_type, type2char[val_type], val, &p); diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 1711ae58b..1c76b8073 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -540,7 +540,7 @@ STATIC mp_obj_t mp_builtin_sorted(size_t n_args, const mp_obj_t *args, mp_map_t MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj, 1, mp_builtin_sorted); // See mp_load_attr() if making any changes -STATIC inline mp_obj_t mp_load_attr_default(mp_obj_t base, qstr attr, mp_obj_t defval) { +static inline mp_obj_t mp_load_attr_default(mp_obj_t base, qstr attr, mp_obj_t defval) { mp_obj_t dest[2]; // use load_method, raising or not raising exception ((defval == MP_OBJ_NULL) ? mp_load_method : mp_load_method_maybe)(base, attr, dest); diff --git a/stmhal/i2c.c b/stmhal/i2c.c index f102fd0f2..3fcce327f 100644 --- a/stmhal/i2c.c +++ b/stmhal/i2c.c @@ -513,7 +513,7 @@ STATIC HAL_StatusTypeDef i2c_wait_dma_finished(I2C_HandleTypeDef *i2c, uint32_t /******************************************************************************/ /* MicroPython bindings */ -STATIC inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; } +static inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; } STATIC void pyb_i2c_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_i2c_obj_t *self = self_in; From a959ff99e305c9134d01d8128e01bcdf1223a053 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 3 Aug 2017 00:16:38 +0300 Subject: [PATCH 337/403] zephyr/Makefile: Explicitly define default target as "all". For some reason, with the latest Zephyr master, running just "make" led to executing Zephyr's "qemu" target. --- zephyr/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zephyr/Makefile b/zephyr/Makefile index c1337adf0..988b32fe8 100644 --- a/zephyr/Makefile +++ b/zephyr/Makefile @@ -17,6 +17,9 @@ OUTDIR_PREFIX = $(BOARD) MICROPY_HEAP_SIZE = 16384 FROZEN_DIR = scripts +# Default target +all: + # Zephyr (generated) config files - must be defined before include below Z_EXPORTS = outdir/$(OUTDIR_PREFIX)/Makefile.export ifneq ($(MAKECMDGOALS), clean) From 9f3e12a4c126728d6c1a9c609cc5e68e42f92f9d Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 6 Aug 2017 15:42:37 +0300 Subject: [PATCH 338/403] py/mkrules.mk: Show frozen modules sizes together with executable size. This works for Unix and similar ports so far. --- py/mkrules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index 860074caa..de2c92a3f 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -135,7 +135,7 @@ $(PROG): $(OBJ) ifndef DEBUG $(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG) endif - $(Q)$(SIZE) $(PROG) + $(Q)$(SIZE) $$(find $(BUILD)/build -name "frozen*.o") $(PROG) clean: clean-prog clean-prog: From e41582a803d1f6ba46478bfa405e640891cc9aaf Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 7 Aug 2017 21:36:57 +0300 Subject: [PATCH 339/403] zephyr/modusocket: Allow to use socketized net_context in upstream. Accesses recv_q, accept_q directly in net_context. --- zephyr/modusocket.c | 28 ++++++++++++++++++---------- zephyr/prj_base.conf | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index cec0eec7c..ebd516fa2 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -48,10 +48,12 @@ typedef struct _socket_obj_t { mp_obj_base_t base; struct net_context *ctx; + #ifndef CONFIG_NET_SOCKETS union { struct k_fifo recv_q; struct k_fifo accept_q; }; + #endif #define STATE_NEW 0 #define STATE_CONNECTING 1 @@ -62,6 +64,12 @@ typedef struct _socket_obj_t { STATIC const mp_obj_type_t socket_type; +#ifdef CONFIG_NET_SOCKETS +#define SOCK_FIELD(ptr, field) ((ptr)->ctx->field) +#else +#define SOCK_FIELD(ptr, field) ((ptr)->field) +#endif + // k_fifo extended API static inline void *_k_fifo_peek_head(struct k_fifo *fifo) @@ -171,10 +179,10 @@ static void sock_received_cb(struct net_context *context, struct net_pkt *pkt, i // if net_buf == NULL, EOF if (pkt == NULL) { - struct net_pkt *last_pkt = _k_fifo_peek_tail(&socket->recv_q); + struct net_pkt *last_pkt = _k_fifo_peek_tail(&SOCK_FIELD(socket, recv_q)); if (last_pkt == NULL) { socket->state = STATE_PEER_CLOSED; - k_fifo_cancel_wait(&socket->recv_q); + k_fifo_cancel_wait(&SOCK_FIELD(socket, recv_q)); DEBUG_printf("Marked socket %p as peer-closed\n", socket); } else { // We abuse "buf_sent" flag to store EOF flag @@ -191,7 +199,7 @@ static void sock_received_cb(struct net_context *context, struct net_pkt *pkt, i unsigned header_len = net_pkt_appdata(pkt) - pkt->frags->data; net_buf_pull(pkt->frags, header_len); - k_fifo_put(&socket->recv_q, pkt); + k_fifo_put(&SOCK_FIELD(socket, recv_q), pkt); } // Callback for incoming connections. @@ -200,13 +208,12 @@ static void sock_accepted_cb(struct net_context *new_ctx, struct sockaddr *addr, DEBUG_printf("accept cb: context: %p, status: %d, new ctx: %p\n", socket->ctx, status, new_ctx); DEBUG_printf("new_ctx ref_cnt: %d\n", new_ctx->refcount); - k_fifo_put(&socket->accept_q, new_ctx); + k_fifo_put(&SOCK_FIELD(socket, accept_q), new_ctx); } socket_obj_t *socket_new(void) { socket_obj_t *socket = m_new_obj_with_finaliser(socket_obj_t); socket->base.type = (mp_obj_t)&socket_type; - k_fifo_init(&socket->recv_q); socket->state = STATE_NEW; return socket; } @@ -250,6 +257,7 @@ STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t } RAISE_ERRNO(net_context_get(family, socktype, proto, &socket->ctx)); + k_fifo_init(&SOCK_FIELD(socket, recv_q)); return MP_OBJ_FROM_PTR(socket); } @@ -302,7 +310,7 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { socket_obj_t *socket = self_in; socket_check_closed(socket); - struct net_context *ctx = k_fifo_get(&socket->accept_q, K_FOREVER); + struct net_context *ctx = k_fifo_get(&SOCK_FIELD(socket, accept_q), K_FOREVER); // Was overwritten by fifo ctx->refcount = 1; @@ -375,7 +383,7 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * if (sock_type == SOCK_DGRAM) { - struct net_pkt *pkt = k_fifo_get(&socket->recv_q, K_FOREVER); + struct net_pkt *pkt = k_fifo_get(&SOCK_FIELD(socket, recv_q), K_FOREVER); recv_len = net_pkt_appdatalen(pkt); DEBUG_printf("recv: pkt=%p, appdatalen: %d\n", pkt, recv_len); @@ -395,8 +403,8 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * return 0; } - _k_fifo_wait_non_empty(&socket->recv_q, K_FOREVER); - struct net_pkt *pkt = _k_fifo_peek_head(&socket->recv_q); + _k_fifo_wait_non_empty(&SOCK_FIELD(socket, recv_q), K_FOREVER); + struct net_pkt *pkt = _k_fifo_peek_head(&SOCK_FIELD(socket, recv_q)); if (pkt == NULL) { DEBUG_printf("TCP recv: NULL return from fifo\n"); continue; @@ -426,7 +434,7 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * if (frag == NULL) { DEBUG_printf("Finished processing pkt %p\n", pkt); // Drop head packet from queue - k_fifo_get(&socket->recv_q, K_NO_WAIT); + k_fifo_get(&SOCK_FIELD(socket, recv_q), K_NO_WAIT); // If "sent" flag was set, it's last packet and we reached EOF if (net_pkt_sent(pkt)) { diff --git a/zephyr/prj_base.conf b/zephyr/prj_base.conf index 4346f20bf..50b195b2f 100644 --- a/zephyr/prj_base.conf +++ b/zephyr/prj_base.conf @@ -14,6 +14,7 @@ CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y CONFIG_NET_UDP=y CONFIG_NET_TCP=y +CONFIG_NET_SOCKETS=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_NBUF_RX_COUNT=5 From dd91ed253afbf08df37a2831a8c23155b85c9c92 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 7 Aug 2017 21:41:03 +0300 Subject: [PATCH 340/403] zephyr/modusocket: socket, close: Switch to native Zephyr socket calls. --- zephyr/modusocket.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index ebd516fa2..ff82ab67c 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -37,6 +37,9 @@ #include #include #include +#ifdef CONFIG_NET_SOCKETS +#include +#endif #define DEBUG_PRINT 0 #if DEBUG_PRINT // print debugging info @@ -103,6 +106,7 @@ static inline void _k_fifo_wait_non_empty(struct k_fifo *fifo, int32_t timeout) // Helper functions #define RAISE_ERRNO(x) { int _err = x; if (_err < 0) mp_raise_OSError(-_err); } +#define RAISE_SOCK_ERRNO(x) { if ((int)(x) == -1) mp_raise_OSError(errno); } STATIC void socket_check_closed(socket_obj_t *socket) { if (socket->ctx == NULL) { @@ -256,8 +260,13 @@ STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t } } + #ifdef CONFIG_NET_SOCKETS + socket->ctx = (void*)zsock_socket(family, socktype, proto); + RAISE_SOCK_ERRNO(socket->ctx); + #else RAISE_ERRNO(net_context_get(family, socktype, proto, &socket->ctx)); k_fifo_init(&SOCK_FIELD(socket, recv_q)); + #endif return MP_OBJ_FROM_PTR(socket); } @@ -491,9 +500,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_makefile_obj, 1, 3, socket_mak STATIC mp_obj_t socket_close(mp_obj_t self_in) { socket_obj_t *socket = self_in; - if (socket->ctx != NULL) { - RAISE_ERRNO(net_context_put(socket->ctx)); - socket->ctx = NULL; + if (socket->ctx != -1) { + int res = zsock_close(socket->ctx); + RAISE_SOCK_ERRNO(res); + socket->ctx = -1; } return mp_const_none; } From 4c096657bc7f8d5b763a469a1e31fd911298274a Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 8 Aug 2017 12:31:59 +0300 Subject: [PATCH 341/403] zephyr/modusocket: bind, connect, listen, accept: Swtich to native sockets. --- zephyr/modusocket.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index ff82ab67c..080e6b275 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -278,7 +278,9 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { struct sockaddr sockaddr; parse_inet_addr(socket, addr_in, &sockaddr); - RAISE_ERRNO(net_context_bind(socket->ctx, &sockaddr, sizeof(sockaddr))); + int res = zsock_bind(socket->ctx, &sockaddr, sizeof(sockaddr)); + RAISE_SOCK_ERRNO(res); + // For DGRAM socket, we expect to receive packets after call to bind(), // but for STREAM socket, next expected operation is listen(), which // doesn't work if recv callback is set. @@ -297,7 +299,9 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { struct sockaddr sockaddr; parse_inet_addr(socket, addr_in, &sockaddr); - RAISE_ERRNO(net_context_connect(socket->ctx, &sockaddr, sizeof(sockaddr), NULL, K_FOREVER, NULL)); + int res = zsock_connect(socket->ctx, &sockaddr, sizeof(sockaddr)); + RAISE_SOCK_ERRNO(res); + DEBUG_printf("Setting recv cb after connect()\n"); RAISE_ERRNO(net_context_recv(socket->ctx, sock_received_cb, K_NO_WAIT, socket)); return mp_const_none; @@ -309,8 +313,9 @@ STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog_in) { socket_check_closed(socket); mp_int_t backlog = mp_obj_get_int(backlog_in); - RAISE_ERRNO(net_context_listen(socket->ctx, backlog)); - RAISE_ERRNO(net_context_accept(socket->ctx, sock_accepted_cb, K_NO_WAIT, socket)); + int res = zsock_listen(socket->ctx, backlog); + RAISE_SOCK_ERRNO(res); + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); @@ -319,9 +324,9 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { socket_obj_t *socket = self_in; socket_check_closed(socket); - struct net_context *ctx = k_fifo_get(&SOCK_FIELD(socket, accept_q), K_FOREVER); - // Was overwritten by fifo - ctx->refcount = 1; + struct sockaddr sockaddr; + socklen_t addrlen = sizeof(sockaddr); + void *ctx = zsock_accept(socket->ctx, &sockaddr, &addrlen); socket_obj_t *socket2 = socket_new(); socket2->ctx = ctx; From 9400fb23ee58bc7fde857937665096f744019ec6 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 9 Aug 2017 10:17:15 +0300 Subject: [PATCH 342/403] zephyr/modusocket: send: Switch to native sockets. --- zephyr/modusocket.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index 080e6b275..bcf2caee7 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -344,28 +344,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); STATIC mp_uint_t sock_write(mp_obj_t self_in, const void *buf, mp_uint_t size, int *errcode) { socket_obj_t *socket = self_in; - if (socket->ctx == NULL) { + if (socket->ctx == -1) { // already closed *errcode = EBADF; return MP_STREAM_ERROR; } - struct net_pkt *send_pkt = net_pkt_get_tx(socket->ctx, K_FOREVER); - - unsigned len = net_if_get_mtu(net_context_get_iface(socket->ctx)); - // Arbitrary value to account for protocol headers - len -= 64; - if (len > size) { - len = size; - } - - // TODO: Return value of 0 is a hard case (as we wait forever, should - // not happen). - len = net_pkt_append(send_pkt, len, buf, K_FOREVER); - - int err = net_context_send(send_pkt, /*cb*/NULL, K_FOREVER, NULL, NULL); - if (err < 0) { - *errcode = -err; + ssize_t len = zsock_send(socket->ctx, buf, size, 0); + if (len == -1) { + *errcode = errno; return MP_STREAM_ERROR; } From 6cf1ce9552ca0ed24544028dc90fd93fb370a43c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 9 Aug 2017 10:22:41 +0300 Subject: [PATCH 343/403] zephyr/modusocket: recv: Switch to native sockets. --- zephyr/modusocket.c | 73 +++------------------------------------------ 1 file changed, 4 insertions(+), 69 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index bcf2caee7..7dc44c79c 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -379,75 +379,10 @@ STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int * return MP_STREAM_ERROR; } - enum net_sock_type sock_type = net_context_get_type(socket->ctx); - unsigned recv_len; - - if (sock_type == SOCK_DGRAM) { - - struct net_pkt *pkt = k_fifo_get(&SOCK_FIELD(socket, recv_q), K_FOREVER); - - recv_len = net_pkt_appdatalen(pkt); - DEBUG_printf("recv: pkt=%p, appdatalen: %d\n", pkt, recv_len); - - if (recv_len > max_len) { - recv_len = max_len; - } - - net_pkt_gather(pkt, buf, recv_len); - net_pkt_unref(pkt); - - } else if (sock_type == SOCK_STREAM) { - - do { - - if (socket->state == STATE_PEER_CLOSED) { - return 0; - } - - _k_fifo_wait_non_empty(&SOCK_FIELD(socket, recv_q), K_FOREVER); - struct net_pkt *pkt = _k_fifo_peek_head(&SOCK_FIELD(socket, recv_q)); - if (pkt == NULL) { - DEBUG_printf("TCP recv: NULL return from fifo\n"); - continue; - } - - DEBUG_printf("TCP recv: cur_pkt: %p\n", pkt); - - struct net_buf *frag = pkt->frags; - if (frag == NULL) { - printf("net_pkt has empty fragments on start!\n"); - assert(0); - } - - unsigned frag_len = frag->len; - recv_len = frag_len; - if (recv_len > max_len) { - recv_len = max_len; - } - DEBUG_printf("%d data bytes in head frag, going to read %d\n", frag_len, recv_len); - - memcpy(buf, frag->data, recv_len); - - if (recv_len != frag_len) { - net_buf_pull(frag, recv_len); - } else { - frag = net_pkt_frag_del(pkt, NULL, frag); - if (frag == NULL) { - DEBUG_printf("Finished processing pkt %p\n", pkt); - // Drop head packet from queue - k_fifo_get(&SOCK_FIELD(socket, recv_q), K_NO_WAIT); - - // If "sent" flag was set, it's last packet and we reached EOF - if (net_pkt_sent(pkt)) { - socket->state = STATE_PEER_CLOSED; - } - net_pkt_unref(pkt); - } - } - // Keep repeating while we're getting empty fragments - // Zephyr IP stack appears to have fed empty net_buf's with empty - // frags for various TCP control packets - in previous versions. - } while (recv_len == 0); + ssize_t recv_len = zsock_recv(socket->ctx, buf, max_len, 0); + if (recv_len == -1) { + *errcode = errno; + return MP_STREAM_ERROR; } return recv_len; From ce49a3071cd56afae11f0cd9780ee8d20eddd1e2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 9 Aug 2017 21:20:42 +1000 Subject: [PATCH 344/403] py/objtuple: Allow to use inplace-multiplication operator on tuples. --- py/objtuple.c | 3 ++- tests/basics/tuple_mult.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/py/objtuple.c b/py/objtuple.c index 0b05755fb..cbe645494 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -148,7 +148,8 @@ mp_obj_t mp_obj_tuple_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) { mp_seq_cat(s->items, o->items, o->len, p->items, p->len, mp_obj_t); return MP_OBJ_FROM_PTR(s); } - case MP_BINARY_OP_MULTIPLY: { + case MP_BINARY_OP_MULTIPLY: + case MP_BINARY_OP_INPLACE_MULTIPLY: { mp_int_t n; if (!mp_obj_get_int_maybe(rhs, &n)) { return MP_OBJ_NULL; // op not supported diff --git a/tests/basics/tuple_mult.py b/tests/basics/tuple_mult.py index b128b2968..cac95185a 100644 --- a/tests/basics/tuple_mult.py +++ b/tests/basics/tuple_mult.py @@ -11,6 +11,11 @@ c = a * 3 print(a, c) +# inplace multiplication +a = (1, 2) +a *= 2 +print(a) + # unsupported type on RHS try: () * None From 9bf98655a1e7ae9f8b85cd5d38bd71fdfe1e3593 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 9 Aug 2017 21:25:48 +1000 Subject: [PATCH 345/403] py/objstr: Raise an exception for wrong type on RHS of str binary op. The main case to catch is invalid types for the containment operator, of the form str.__contains__(non-str). --- py/objstr.c | 5 +++-- tests/basics/containment.py | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/py/objstr.c b/py/objstr.c index ddad7d3bd..cc3dda59e 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -347,8 +347,9 @@ mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { rhs_data = bufinfo.buf; rhs_len = bufinfo.len; } else { - // incompatible types - return MP_OBJ_NULL; // op not supported + // LHS is str and RHS has an incompatible type + // (except if operation is EQUAL, but that's handled by mp_obj_equal) + bad_implicit_conversion(rhs_in); } switch (op) { diff --git a/tests/basics/containment.py b/tests/basics/containment.py index bae366113..4c94a9bae 100644 --- a/tests/basics/containment.py +++ b/tests/basics/containment.py @@ -16,6 +16,17 @@ print(haystack, "in", needle, "::", haystack in needle) print(haystack, "not in", needle, "::", haystack not in needle) +# containment of bytes/ints in bytes +print(b'' in b'123') +print(b'0' in b'123', b'1' in b'123') +print(48 in b'123', 49 in b'123') + +# containment of int in str is an error +try: + 1 in '123' +except TypeError: + print('TypeError') + # until here, the tests would work without the 'second attempt' iteration thing. for i in 1, 2: From 76cf4296813b309f1127ed336bfae6c0bff171b1 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 9 Aug 2017 13:19:22 +0300 Subject: [PATCH 346/403] zephyr/modusocket: Fully switch to native Zephyr sockets. --- zephyr/modusocket.c | 142 +++----------------------------------------- 1 file changed, 8 insertions(+), 134 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index 7dc44c79c..f8d668a70 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -50,13 +50,7 @@ typedef struct _socket_obj_t { mp_obj_base_t base; - struct net_context *ctx; - #ifndef CONFIG_NET_SOCKETS - union { - struct k_fifo recv_q; - struct k_fifo accept_q; - }; - #endif + int ctx; #define STATE_NEW 0 #define STATE_CONNECTING 1 @@ -67,49 +61,13 @@ typedef struct _socket_obj_t { STATIC const mp_obj_type_t socket_type; -#ifdef CONFIG_NET_SOCKETS -#define SOCK_FIELD(ptr, field) ((ptr)->ctx->field) -#else -#define SOCK_FIELD(ptr, field) ((ptr)->field) -#endif - -// k_fifo extended API - -static inline void *_k_fifo_peek_head(struct k_fifo *fifo) -{ -#if KERNEL_VERSION_NUMBER < 0x010763 /* 1.7.99 */ - return sys_slist_peek_head(&fifo->data_q); -#else - return sys_slist_peek_head(&fifo->_queue.data_q); -#endif -} - -static inline void *_k_fifo_peek_tail(struct k_fifo *fifo) -{ -#if KERNEL_VERSION_NUMBER < 0x010763 /* 1.7.99 */ - return sys_slist_peek_tail(&fifo->data_q); -#else - return sys_slist_peek_tail(&fifo->_queue.data_q); -#endif -} - -static inline void _k_fifo_wait_non_empty(struct k_fifo *fifo, int32_t timeout) -{ - struct k_poll_event events[] = { - K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_FIFO_DATA_AVAILABLE, K_POLL_MODE_NOTIFY_ONLY, fifo), - }; - - k_poll(events, MP_ARRAY_SIZE(events), timeout); - DEBUG_printf("poll res: %d\n", events[0].state); -} - // Helper functions #define RAISE_ERRNO(x) { int _err = x; if (_err < 0) mp_raise_OSError(-_err); } #define RAISE_SOCK_ERRNO(x) { if ((int)(x) == -1) mp_raise_OSError(errno); } STATIC void socket_check_closed(socket_obj_t *socket) { - if (socket->ctx == NULL) { + if (socket->ctx == -1) { // already closed mp_raise_OSError(EBADF); } @@ -121,7 +79,7 @@ STATIC void parse_inet_addr(socket_obj_t *socket, mp_obj_t addr_in, struct socka mp_obj_t *addr_items; mp_obj_get_array_fixed_n(addr_in, 2, &addr_items); - sockaddr_in->sin_family = net_context_get_family(socket->ctx); + sockaddr_in->sin_family = net_context_get_family((void*)socket->ctx); RAISE_ERRNO(net_addr_pton(sockaddr_in->sin_family, mp_obj_str_get_str(addr_items[0]), &sockaddr_in->sin_addr)); sockaddr_in->sin_port = htons(mp_obj_get_int(addr_items[1])); } @@ -147,74 +105,6 @@ STATIC mp_obj_t format_inet_addr(struct sockaddr *addr, mp_obj_t port) { return MP_OBJ_FROM_PTR(tuple); } -// Copy data from Zephyr net_buf chain into linear buffer. -// We don't use net_pkt_read(), because it's weird (e.g., we'd like to -// free processed data fragment ASAP, while net_pkt_read() holds onto -// the whole fragment chain to do its deeds, and that's minor comparing -// to the fact that it copies data byte by byte). -static char *net_pkt_gather(struct net_pkt *pkt, char *to, unsigned max_len) { - struct net_buf *tmp = pkt->frags; - - while (tmp && max_len) { - unsigned len = tmp->len; - if (len > max_len) { - len = max_len; - } - memcpy(to, tmp->data, len); - to += len; - max_len -= len; - tmp = net_pkt_frag_del(pkt, NULL, tmp); - } - - return to; -} - -// Callback for incoming packets. -static void sock_received_cb(struct net_context *context, struct net_pkt *pkt, int status, void *user_data) { - socket_obj_t *socket = (socket_obj_t*)user_data; - DEBUG_printf("recv cb: context: %p, status: %d, pkt: %p", context, status, pkt); - if (pkt) { - DEBUG_printf(" (appdatalen=%d), token: %p", pkt->appdatalen, net_pkt_token(pkt)); - } - DEBUG_printf("\n"); - #if DEBUG_PRINT > 1 - net_pkt_print_frags(pkt); - #endif - - // if net_buf == NULL, EOF - if (pkt == NULL) { - struct net_pkt *last_pkt = _k_fifo_peek_tail(&SOCK_FIELD(socket, recv_q)); - if (last_pkt == NULL) { - socket->state = STATE_PEER_CLOSED; - k_fifo_cancel_wait(&SOCK_FIELD(socket, recv_q)); - DEBUG_printf("Marked socket %p as peer-closed\n", socket); - } else { - // We abuse "buf_sent" flag to store EOF flag - net_pkt_set_sent(last_pkt, true); - DEBUG_printf("Set EOF flag on %p\n", last_pkt); - } - return; - } - - // Make sure that "EOF flag" is not set - net_pkt_set_sent(pkt, false); - - // We don't care about packet header, so get rid of it asap - unsigned header_len = net_pkt_appdata(pkt) - pkt->frags->data; - net_buf_pull(pkt->frags, header_len); - - k_fifo_put(&SOCK_FIELD(socket, recv_q), pkt); -} - -// Callback for incoming connections. -static void sock_accepted_cb(struct net_context *new_ctx, struct sockaddr *addr, socklen_t addrlen, int status, void *user_data) { - socket_obj_t *socket = (socket_obj_t*)user_data; - DEBUG_printf("accept cb: context: %p, status: %d, new ctx: %p\n", socket->ctx, status, new_ctx); - DEBUG_printf("new_ctx ref_cnt: %d\n", new_ctx->refcount); - - k_fifo_put(&SOCK_FIELD(socket, accept_q), new_ctx); -} - socket_obj_t *socket_new(void) { socket_obj_t *socket = m_new_obj_with_finaliser(socket_obj_t); socket->base.type = (mp_obj_t)&socket_type; @@ -226,10 +116,10 @@ socket_obj_t *socket_new(void) { STATIC void socket_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { socket_obj_t *self = self_in; - if (self->ctx == NULL) { + if (self->ctx == -1) { mp_printf(print, ""); } else { - struct net_context *ctx = self->ctx; + struct net_context *ctx = (void*)self->ctx; mp_printf(print, "", ctx, net_context_get_type(ctx)); } } @@ -260,13 +150,8 @@ STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t } } - #ifdef CONFIG_NET_SOCKETS - socket->ctx = (void*)zsock_socket(family, socktype, proto); + socket->ctx = zsock_socket(family, socktype, proto); RAISE_SOCK_ERRNO(socket->ctx); - #else - RAISE_ERRNO(net_context_get(family, socktype, proto, &socket->ctx)); - k_fifo_init(&SOCK_FIELD(socket, recv_q)); - #endif return MP_OBJ_FROM_PTR(socket); } @@ -281,13 +166,6 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { int res = zsock_bind(socket->ctx, &sockaddr, sizeof(sockaddr)); RAISE_SOCK_ERRNO(res); - // For DGRAM socket, we expect to receive packets after call to bind(), - // but for STREAM socket, next expected operation is listen(), which - // doesn't work if recv callback is set. - if (net_context_get_type(socket->ctx) == SOCK_DGRAM) { - DEBUG_printf("Setting recv cb after bind\n"); - RAISE_ERRNO(net_context_recv(socket->ctx, sock_received_cb, K_NO_WAIT, socket)); - } return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); @@ -302,8 +180,6 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { int res = zsock_connect(socket->ctx, &sockaddr, sizeof(sockaddr)); RAISE_SOCK_ERRNO(res); - DEBUG_printf("Setting recv cb after connect()\n"); - RAISE_ERRNO(net_context_recv(socket->ctx, sock_received_cb, K_NO_WAIT, socket)); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); @@ -326,12 +202,10 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { struct sockaddr sockaddr; socklen_t addrlen = sizeof(sockaddr); - void *ctx = zsock_accept(socket->ctx, &sockaddr, &addrlen); + int ctx = zsock_accept(socket->ctx, &sockaddr, &addrlen); socket_obj_t *socket2 = socket_new(); socket2->ctx = ctx; - DEBUG_printf("Setting recv cb after accept()\n"); - RAISE_ERRNO(net_context_recv(ctx, sock_received_cb, K_NO_WAIT, socket2)); mp_obj_tuple_t *client = mp_obj_new_tuple(2, NULL); client->items[0] = MP_OBJ_FROM_PTR(socket2); @@ -373,7 +247,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_send_obj, socket_send); STATIC mp_uint_t sock_read(mp_obj_t self_in, void *buf, mp_uint_t max_len, int *errcode) { socket_obj_t *socket = self_in; - if (socket->ctx == NULL) { + if (socket->ctx == -1) { // already closed *errcode = EBADF; return MP_STREAM_ERROR; From e927aa27720bfa26e6177cda5c3be6ba9051fe68 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Aug 2017 12:17:47 +1000 Subject: [PATCH 347/403] minimal,esp8266,pic16bit: Remove unused stmhal include from Makefile. --- esp8266/Makefile | 1 - minimal/Makefile | 1 - pic16bit/Makefile | 1 - 3 files changed, 3 deletions(-) diff --git a/esp8266/Makefile b/esp8266/Makefile index 1c169862e..452efb2cd 100644 --- a/esp8266/Makefile +++ b/esp8266/Makefile @@ -24,7 +24,6 @@ ESP_SDK = $(shell $(CC) -print-sysroot)/usr INC += -I. INC += -I.. -INC += -I../stmhal INC += -I$(BUILD) INC += -I$(ESP_SDK)/include diff --git a/minimal/Makefile b/minimal/Makefile index 994d26880..0fc919438 100644 --- a/minimal/Makefile +++ b/minimal/Makefile @@ -14,7 +14,6 @@ endif INC += -I. INC += -I.. -INC += -I../stmhal INC += -I$(BUILD) ifeq ($(CROSS), 1) diff --git a/pic16bit/Makefile b/pic16bit/Makefile index 1da444952..b953612fd 100644 --- a/pic16bit/Makefile +++ b/pic16bit/Makefile @@ -14,7 +14,6 @@ PART = 33FJ256GP506 INC += -I. INC += -I.. -INC += -I../stmhal INC += -I$(BUILD) INC += -I$(XC16)/include INC += -I$(XC16)/support/$(PARTFAMILY)/h From b6acbbf8dd67563d2ea40b154a037acc8d0280c8 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Aug 2017 12:22:19 +1000 Subject: [PATCH 348/403] all: Make use of $(TOP) variable in Makefiles, instead of "..". $(TOP) is defined in py/mkenv.mk and should be used to refer to the top level of this repository. --- bare-arm/Makefile | 6 ++--- cc3200/Makefile | 4 +-- cc3200/application.mk | 6 ++--- cc3200/bootmgr/bootloader.mk | 4 +-- esp8266/Makefile | 16 +++++------ minimal/Makefile | 12 ++++----- mpy-cross/Makefile | 6 ++--- pic16bit/Makefile | 6 ++--- py/py.mk | 10 +++---- qemu-arm/Makefile | 12 ++++----- stmhal/Makefile | 16 +++++------ teensy/Makefile | 10 +++---- unix/Makefile | 52 ++++++++++++++++++------------------ windows/Makefile | 6 ++--- zephyr/Makefile | 8 +++--- 15 files changed, 87 insertions(+), 87 deletions(-) diff --git a/bare-arm/Makefile b/bare-arm/Makefile index cfd427c60..90c13de11 100644 --- a/bare-arm/Makefile +++ b/bare-arm/Makefile @@ -4,12 +4,12 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk CROSS_COMPILE = arm-none-eabi- INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion @@ -45,4 +45,4 @@ $(BUILD)/firmware.elf: $(OBJ) $(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS) $(Q)$(SIZE) $@ -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/cc3200/Makefile b/cc3200/Makefile index 663496435..4c8b0b832 100644 --- a/cc3200/Makefile +++ b/cc3200/Makefile @@ -34,7 +34,7 @@ ifeq ($(BTARGET), application) # qstr definitions (must come before including py.mk) QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h # include MicroPython make definitions -include ../py/py.mk +include $(TOP)/py/py.mk include application.mk else ifeq ($(BTARGET), bootloader) @@ -45,7 +45,7 @@ endif endif # always include MicroPython make rules -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk erase: cc3200tool -p $(PORT) format_flash --size $(FLASH_SIZE_$(BOARD)) diff --git a/cc3200/application.mk b/cc3200/application.mk index c6b91ed0e..3ac28823a 100644 --- a/cc3200/application.mk +++ b/cc3200/application.mk @@ -1,5 +1,5 @@ APP_INC = -I. -APP_INC += -I.. +APP_INC += -I$(TOP) APP_INC += -Ifatfs/src APP_INC += -Ifatfs/src/drivers APP_INC += -IFreeRTOS @@ -10,7 +10,7 @@ APP_INC += -Ihal APP_INC += -Ihal/inc APP_INC += -Imisc APP_INC += -Imods -APP_INC += -I../drivers/cc3100/inc +APP_INC += -I$(TOP)/drivers/cc3100/inc APP_INC += -Isimplelink APP_INC += -Isimplelink/oslib APP_INC += -Itelnet @@ -18,7 +18,7 @@ APP_INC += -Iutil APP_INC += -Ibootmgr APP_INC += -I$(BUILD) APP_INC += -I$(BUILD)/genhdr -APP_INC += -I../stmhal +APP_INC += -I$(TOP)/stmhal APP_CPPDEFINES = -Dgcc -DTARGET_IS_CC3200 -DSL_FULL -DUSE_FREERTOS diff --git a/cc3200/bootmgr/bootloader.mk b/cc3200/bootmgr/bootloader.mk index ee5236913..b8aa9082c 100644 --- a/cc3200/bootmgr/bootloader.mk +++ b/cc3200/bootmgr/bootloader.mk @@ -4,13 +4,13 @@ BOOT_INC = -Ibootmgr BOOT_INC += -Ibootmgr/sl BOOT_INC += -Ihal BOOT_INC += -Ihal/inc -BOOT_INC += -I../drivers/cc3100/inc +BOOT_INC += -I$(TOP)/drivers/cc3100/inc BOOT_INC += -Imisc BOOT_INC += -Imods BOOT_INC += -Isimplelink BOOT_INC += -Isimplelink/oslib BOOT_INC += -Iutil -BOOT_INC += -I.. +BOOT_INC += -I$(TOP) BOOT_INC += -I. BOOT_INC += -I$(BUILD) diff --git a/esp8266/Makefile b/esp8266/Makefile index 452efb2cd..fce11a7d4 100644 --- a/esp8266/Makefile +++ b/esp8266/Makefile @@ -12,7 +12,7 @@ FROZEN_DIR ?= scripts FROZEN_MPY_DIR ?= modules # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk FWBIN = $(BUILD)/firmware-combined.bin PORT ?= /dev/ttyACM0 @@ -23,7 +23,7 @@ CROSS_COMPILE = xtensa-lx106-elf- ESP_SDK = $(shell $(CC) -print-sysroot)/usr INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) INC += -I$(ESP_SDK)/include @@ -220,16 +220,16 @@ ota: #$(BUILD)/pins_$(BOARD).o: $(BUILD)/pins_$(BOARD).c # $(call compile_c) -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk axtls: $(BUILD)/libaxtls.a $(BUILD)/libaxtls.a: - cd ../lib/axtls; cp config/upyconfig config/.config - cd ../lib/axtls; $(MAKE) oldconfig -B - cd ../lib/axtls; $(MAKE) clean - cd ../lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" AR="$(AR)" CFLAGS_EXTRA="$(CFLAGS_XTENSA) -Dabort=abort_ -DRT_MAX_PLAIN_LENGTH=1024 -DRT_EXTRA=4096" - cp ../lib/axtls/_stage/libaxtls.a $@ + cd $(TOP)/lib/axtls; cp config/upyconfig config/.config + cd $(TOP)/lib/axtls; $(MAKE) oldconfig -B + cd $(TOP)/lib/axtls; $(MAKE) clean + cd $(TOP)/lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" AR="$(AR)" CFLAGS_EXTRA="$(CFLAGS_XTENSA) -Dabort=abort_ -DRT_MAX_PLAIN_LENGTH=1024 -DRT_EXTRA=4096" + cp $(TOP)/lib/axtls/_stage/libaxtls.a $@ clean-modules: git clean -f -d modules diff --git a/minimal/Makefile b/minimal/Makefile index 0fc919438..c95d639af 100644 --- a/minimal/Makefile +++ b/minimal/Makefile @@ -6,19 +6,19 @@ CROSS = 0 QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk ifeq ($(CROSS), 1) CROSS_COMPILE = arm-none-eabi- endif INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) ifeq ($(CROSS), 1) -DFU = ../tools/dfu.py -PYDFU = ../tools/pydfu.py +DFU = $(TOP)/tools/dfu.py +PYDFU = $(TOP)/tools/pydfu.py CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT) LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref --gc-sections @@ -57,7 +57,7 @@ endif $(BUILD)/_frozen_mpy.c: frozentest.mpy $(BUILD)/genhdr/qstrdefs.generated.h $(ECHO) "MISC freezing bytecode" - $(Q)../tools/mpy-tool.py -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h -mlongint-impl=none $< > $@ + $(Q)$(TOP)/tools/mpy-tool.py -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h -mlongint-impl=none $< > $@ $(BUILD)/firmware.elf: $(OBJ) $(ECHO) "LINK $@" @@ -87,4 +87,4 @@ run: test: $(BUILD)/firmware.elf $(Q)/bin/echo -e "print('hello world!', list(x+1 for x in range(10)), end='eol\\\\n')\\r\\n\\x04" | $(BUILD)/firmware.elf | tail -n2 | grep "^hello world! \\[1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\]eol" -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile index cdec130ee..5399b5ae7 100644 --- a/mpy-cross/Makefile +++ b/mpy-cross/Makefile @@ -23,10 +23,10 @@ QSTR_DEFS = qstrdefsport.h UNAME_S := $(shell uname -s) # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) # compiler settings @@ -71,4 +71,4 @@ endif OBJ = $(PY_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/pic16bit/Makefile b/pic16bit/Makefile index b953612fd..ebf4fc2e8 100644 --- a/pic16bit/Makefile +++ b/pic16bit/Makefile @@ -4,7 +4,7 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk XC16 = /opt/microchip/xc16/v1.24 CROSS_COMPILE = $(XC16)/bin/xc16- @@ -13,7 +13,7 @@ PARTFAMILY = dsPIC33F PART = 33FJ256GP506 INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) INC += -I$(XC16)/include INC += -I$(XC16)/support/$(PARTFAMILY)/h @@ -67,4 +67,4 @@ $(BUILD)/firmware.elf: $(OBJ) $(PY_BUILD)/gc.o: CFLAGS += -O1 $(PY_BUILD)/vm.o: CFLAGS += -O1 -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/py/py.mk b/py/py.mk index ff18f30be..fff6a0813 100644 --- a/py/py.mk +++ b/py/py.mk @@ -22,13 +22,13 @@ CFLAGS_MOD += -DFFCONF_H=\"lib/oofatfs/ffconf.h\" ifeq ($(MICROPY_PY_USSL),1) CFLAGS_MOD += -DMICROPY_PY_USSL=1 ifeq ($(MICROPY_SSL_AXTLS),1) -CFLAGS_MOD += -DMICROPY_SSL_AXTLS=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config +CFLAGS_MOD += -DMICROPY_SSL_AXTLS=1 -I$(TOP)/lib/axtls/ssl -I$(TOP)/lib/axtls/crypto -I$(TOP)/lib/axtls/config LDFLAGS_MOD += -Lbuild -laxtls else ifeq ($(MICROPY_SSL_MBEDTLS),1) # Can be overridden by ports which have "builtin" mbedTLS -MICROPY_SSL_MBEDTLS_INCLUDE ?= ../lib/mbedtls/include +MICROPY_SSL_MBEDTLS_INCLUDE ?= $(TOP)/lib/mbedtls/include CFLAGS_MOD += -DMICROPY_SSL_MBEDTLS=1 -I$(MICROPY_SSL_MBEDTLS_INCLUDE) -LDFLAGS_MOD += -L../lib/mbedtls/library -lmbedx509 -lmbedtls -lmbedcrypto +LDFLAGS_MOD += -L$(TOP)/lib/mbedtls/library -lmbedx509 -lmbedtls -lmbedcrypto endif endif @@ -38,7 +38,7 @@ endif ifeq ($(MICROPY_PY_LWIP),1) LWIP_DIR = lib/lwip/src -INC += -I../lib/lwip/src/include -I../lib/lwip/src/include/ipv4 -I../extmod/lwip-include +INC += -I$(TOP)/lib/lwip/src/include -I$(TOP)/lib/lwip/src/include/ipv4 -I$(TOP)/extmod/lwip-include CFLAGS_MOD += -DMICROPY_PY_LWIP=1 SRC_MOD += extmod/modlwip.c lib/netutils/netutils.c SRC_MOD += $(addprefix $(LWIP_DIR)/,\ @@ -75,7 +75,7 @@ endif ifeq ($(MICROPY_PY_BTREE),1) BTREE_DIR = lib/berkeley-db-1.xx BTREE_DEFS = -D__DBINTERFACE_PRIVATE=1 -Dmpool_error=printf -Dabort=abort_ -Dvirt_fd_t=mp_obj_t "-DVIRT_FD_T_HEADER=" -INC += -I../$(BTREE_DIR)/PORT/include +INC += -I$(TOP)/$(BTREE_DIR)/PORT/include SRC_MOD += extmod/modbtree.c SRC_MOD += $(addprefix $(BTREE_DIR)/,\ btree/bt_close.c \ diff --git a/qemu-arm/Makefile b/qemu-arm/Makefile index 743b6683a..71403cb5e 100644 --- a/qemu-arm/Makefile +++ b/qemu-arm/Makefile @@ -5,14 +5,14 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk CROSS_COMPILE = arm-none-eabi- INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) -INC += -I../tools/tinytest/ +INC += -I$(TOP)/tools/tinytest/ CFLAGS_CORTEX_M3 = -mthumb -mcpu=cortex-m3 -mfloat-abi=soft CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -std=gnu99 $(CFLAGS_CORTEX_M3) $(COPT) \ @@ -98,10 +98,10 @@ test: $(BUILD)/firmware-test.elf $(BUILD)/test_main.o: $(BUILD)/genhdr/tests.h $(BUILD)/genhdr/tests.h: - $(Q)echo "Generating $@";(cd ../tests; ../tools/tinytest-codegen.py) > $@ + $(Q)echo "Generating $@";(cd $(TOP)/tests; ../tools/tinytest-codegen.py) > $@ $(BUILD)/tinytest.o: - $(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c ../tools/tinytest/tinytest.c + $(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c $(TOP)/tools/tinytest/tinytest.c ## `$(LD)` doesn't seem to like `--specs` for some reason, but we can just use `$(CC)` here. $(BUILD)/firmware.elf: $(OBJ_COMMON) $(OBJ_RUN) @@ -112,4 +112,4 @@ $(BUILD)/firmware-test.elf: $(OBJ_COMMON) $(OBJ_TEST) $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(Q)$(SIZE) $@ -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/stmhal/Makefile b/stmhal/Makefile index ae1db2ae9..8735d84c3 100644 --- a/stmhal/Makefile +++ b/stmhal/Makefile @@ -19,7 +19,7 @@ QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h $(BUILD)/modstm_qstr.h FROZEN_MPY_DIR ?= modules # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk LD_DIR=boards CMSIS_DIR=cmsis @@ -27,10 +27,10 @@ HAL_DIR=hal/$(MCU_SERIES) USBDEV_DIR=usbdev #USBHOST_DIR=usbhost FATFS_DIR=lib/oofatfs -DFU=../tools/dfu.py +DFU=$(TOP)/tools/dfu.py # may need to prefix dfu-util with sudo USE_PYDFU ?= 1 -PYDFU ?= ../tools/pydfu.py +PYDFU ?= $(TOP)/tools/pydfu.py DFU_UTIL ?= dfu-util DEVICE=0483:df11 STFLASH ?= st-flash @@ -40,9 +40,9 @@ OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg CROSS_COMPILE = arm-none-eabi- INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) -INC += -I../lib/cmsis/inc +INC += -I$(TOP)/lib/cmsis/inc INC += -I$(CMSIS_DIR)/ INC += -I$(HAL_DIR)/inc INC += -I$(USBDEV_DIR)/core/inc -I$(USBDEV_DIR)/class/inc @@ -406,8 +406,8 @@ GEN_PINS_QSTR = $(BUILD)/pins_qstr.h GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h GEN_PINS_AF_PY = $(BUILD)/pins_af.py -INSERT_USB_IDS = ../tools/insert-usb-ids.py -FILE2H = ../tools/file2h.py +INSERT_USB_IDS = $(TOP)/tools/insert-usb-ids.py +FILE2H = $(TOP)/tools/file2h.py USB_IDS_FILE = usb.h CDCINF_TEMPLATE = pybcdc.inf_template @@ -464,4 +464,4 @@ $(GEN_CDCINF_FILE): $(CDCINF_TEMPLATE) $(INSERT_USB_IDS) $(USB_IDS_FILE) | $(HEA $(ECHO) "Create $@" $(Q)$(PYTHON) $(INSERT_USB_IDS) $(USB_IDS_FILE) $< > $@ -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/teensy/Makefile b/teensy/Makefile index 575e15e54..944e281a4 100644 --- a/teensy/Makefile +++ b/teensy/Makefile @@ -4,7 +4,7 @@ include ../py/mkenv.mk QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk # If you set USE_ARDUINO_TOOLCHAIN=1 then this makefile will attempt to use # the toolchain that comes with Teensyduino @@ -30,8 +30,8 @@ CFLAGS_TEENSY = -DF_CPU=96000000 -DUSB_SERIAL -D__MK20DX256__ CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float -mfloat-abi=soft -fsingle-precision-constant -Wdouble-promotion $(CFLAGS_TEENSY) INC += -I. -INC += -I.. -INC += -I../stmhal +INC += -I$(TOP) +INC += -I$(TOP)/stmhal INC += -I$(BUILD) INC += -Icore @@ -135,7 +135,7 @@ SRC_C += \ OBJ += $(BUILD)/memzip-files.o -MAKE_MEMZIP = ../lib/memzip/make-memzip.py +MAKE_MEMZIP = $(TOP)/lib/memzip/make-memzip.py ifeq ($(MEMZIP_DIR),) MEMZIP_DIR = memzip_files endif @@ -232,4 +232,4 @@ $(BUILD)/%.pp: $(BUILD)/%.c $(ECHO) "PreProcess $<" $(Q)$(CC) $(CFLAGS) -E -Wp,-C,-dD,-dI -o $@ $< -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/unix/Makefile b/unix/Makefile index 9eff02e07..aecd1f7d8 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -14,13 +14,13 @@ QSTR_DEFS = qstrdefsport.h UNAME_S := $(shell uname -s) # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk ESPIDF = $(IDF_PATH) ESPCOMP = $(ESPIDF)/components INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) INC += -I../../components/ugfx-glue INC += -I../../components/badge @@ -102,7 +102,7 @@ endif endif ifeq ($(MICROPY_USE_READLINE),1) -INC += -I../lib/mp-readline +INC += -I$(TOP)/lib/mp-readline CFLAGS_MOD += -DMICROPY_USE_READLINE=1 LIB_SRC_C_EXTRA += mp-readline/readline.c endif @@ -122,11 +122,11 @@ endif ifeq ($(MICROPY_PY_FFI),1) ifeq ($(MICROPY_STANDALONE),1) -LIBFFI_CFLAGS_MOD := -I$(shell ls -1d ../lib/libffi/build_dir/out/lib/libffi-*/include) +LIBFFI_CFLAGS_MOD := -I$(shell ls -1d $(TOP)/lib/libffi/build_dir/out/lib/libffi-*/include) ifeq ($(MICROPY_FORCE_32BIT),1) - LIBFFI_LDFLAGS_MOD = ../lib/libffi/build_dir/out/lib32/libffi.a + LIBFFI_LDFLAGS_MOD = $(TOP)/lib/libffi/build_dir/out/lib32/libffi.a else - LIBFFI_LDFLAGS_MOD = ../lib/libffi/build_dir/out/lib/libffi.a + LIBFFI_LDFLAGS_MOD = $(TOP)/lib/libffi/build_dir/out/lib/libffi.a endif else LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi) @@ -232,13 +232,13 @@ MPY_CROSS_FLAGS += -mcache-lookup-bc endif -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk .PHONY: test -test: $(PROG) ../tests/run-tests +test: $(PROG) $(TOP)/tests/run-tests $(eval DIRNAME=$(notdir $(CURDIR))) - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(PROG) ./run-tests + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(PROG) ./run-tests # install micropython in /usr/local/bin TARGET = micropython @@ -303,12 +303,12 @@ coverage: coverage_test: coverage $(eval DIRNAME=$(notdir $(CURDIR))) - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests -d thread - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --emit native - cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --via-mpy -d basics float - gcov -o build-coverage/py ../py/*.c - gcov -o build-coverage/extmod ../extmod/*.c + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests -d thread + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --emit native + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --via-mpy -d basics float + gcov -o build-coverage/py $(TOP)/py/*.c + gcov -o build-coverage/extmod $(TOP)/extmod/*.c # Value of configure's --host= option (required for cross-compilation). # Deduce it from CROSS_COMPILE by default, but can be overridden. @@ -323,21 +323,21 @@ deplibs: libffi axtls # install-exec-recursive & install-data-am targets are used to avoid building # docs and depending on makeinfo libffi: - cd ../lib/libffi; git clean -d -x -f - cd ../lib/libffi; ./autogen.sh - mkdir -p ../lib/libffi/build_dir; cd ../lib/libffi/build_dir; \ + cd $(TOP)/lib/libffi; git clean -d -x -f + cd $(TOP)/lib/libffi; ./autogen.sh + mkdir -p $(TOP)/lib/libffi/build_dir; cd $(TOP)/lib/libffi/build_dir; \ ../configure $(CROSS_COMPILE_HOST) --prefix=$$PWD/out --disable-structs CC="$(CC)" CXX="$(CXX)" LD="$(LD)" CFLAGS="-Os -fomit-frame-pointer -fstrict-aliasing -ffast-math -fno-exceptions"; \ $(MAKE) install-exec-recursive; $(MAKE) -C include install-data-am axtls: $(BUILD)/libaxtls.a -$(BUILD)/libaxtls.a: ../lib/axtls/README | $(OBJ_DIRS) - cd ../lib/axtls; cp config/upyconfig config/.config - cd ../lib/axtls; $(MAKE) oldconfig -B - cd ../lib/axtls; $(MAKE) clean - cd ../lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" - cp ../lib/axtls/_stage/libaxtls.a $@ +$(BUILD)/libaxtls.a: $(TOP)/lib/axtls/README | $(OBJ_DIRS) + cd $(TOP)/lib/axtls; cp config/upyconfig config/.config + cd $(TOP)/lib/axtls; $(MAKE) oldconfig -B + cd $(TOP)/lib/axtls; $(MAKE) clean + cd $(TOP)/lib/axtls; $(MAKE) all CC="$(CC)" LD="$(LD)" + cp $(TOP)/lib/axtls/_stage/libaxtls.a $@ -../lib/axtls/README: +$(TOP)/lib/axtls/README: @echo "You cloned without --recursive, fetching submodules for you." - (cd ..; git submodule update --init --recursive) + (cd $(TOP); git submodule update --init --recursive) diff --git a/windows/Makefile b/windows/Makefile index 72c97381b..a39d34826 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -8,10 +8,10 @@ PROG = micropython.exe QSTR_DEFS = ../unix/qstrdefsport.h # include py core make definitions -include ../py/py.mk +include $(TOP)/py/py.mk INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) # compiler settings @@ -62,4 +62,4 @@ SRC_QSTR += $(SRC_C) # SRC_QSTR SRC_QSTR_AUTO_DEPS += -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk diff --git a/zephyr/Makefile b/zephyr/Makefile index 988b32fe8..5840cc47e 100644 --- a/zephyr/Makefile +++ b/zephyr/Makefile @@ -27,10 +27,10 @@ include $(Z_EXPORTS) endif include ../py/mkenv.mk -include ../py/py.mk +include $(TOP)/py/py.mk INC += -I. -INC += -I.. +INC += -I$(TOP) INC += -I$(BUILD) INC += -I$(ZEPHYR_BASE)/net/ip INC += -I$(ZEPHYR_BASE)/net/ip/contiki @@ -59,7 +59,7 @@ OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) CFLAGS = $(KBUILD_CFLAGS) $(NOSTDINC_FLAGS) $(ZEPHYRINCLUDE) \ -std=gnu99 -fomit-frame-pointer -DNDEBUG -DMICROPY_HEAP_SIZE=$(MICROPY_HEAP_SIZE) $(CFLAGS_EXTRA) $(INC) -include ../py/mkrules.mk +include $(TOP)/py/mkrules.mk # We use single target here ($(Z_EXPORTS)) for simplicity, but actually # number of things get generated here: 'initconfig' generates C header for @@ -102,4 +102,4 @@ prj_$(BOARD)_merged.conf: prj_base.conf prj_$(BOARD).conf $(PYTHON) makeprj.py prj_base.conf prj_$(BOARD).conf $@ test: - cd ../tests && ./run-tests --target minimal --device "execpty:make -C ../zephyr run BOARD=$(BOARD) QEMU_PTY=1" + cd $(TOP)/tests && ./run-tests --target minimal --device "execpty:make -C ../zephyr run BOARD=$(BOARD) QEMU_PTY=1" From 4672804631cdd01b5d0687c67498e5145f6f0df0 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 11 Aug 2017 09:42:39 +0300 Subject: [PATCH 349/403] py/modsys: Initial implementation of sys.getsizeof(). Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and instances. --- py/modsys.c | 12 ++++++++++++ py/mpconfig.h | 5 +++++ py/objdict.c | 6 ++++++ py/objlist.c | 6 ++++++ py/objtype.c | 16 ++++++++++++++++ py/runtime0.h | 1 + tests/unix/extra_coverage.py.exp | 3 ++- unix/mpconfigport_coverage.h | 1 + 8 files changed, 49 insertions(+), 1 deletion(-) diff --git a/py/modsys.c b/py/modsys.c index ee6f8686e..b7d55fdcc 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2014-2017 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,8 +32,11 @@ #include "py/objtuple.h" #include "py/objstr.h" #include "py/objint.h" +#include "py/objtype.h" #include "py/stream.h" #include "py/smallint.h" +#include "py/runtime0.h" +#include "py/runtime.h" #if MICROPY_PY_SYS @@ -143,6 +147,11 @@ STATIC mp_obj_t mp_sys_exc_info(void) { MP_DEFINE_CONST_FUN_OBJ_0(mp_sys_exc_info_obj, mp_sys_exc_info); #endif +STATIC mp_obj_t mp_sys_getsizeof(mp_obj_t obj) { + return mp_unary_op(MP_UNARY_OP_SIZEOF, obj); +} +MP_DEFINE_CONST_FUN_OBJ_1(mp_sys_getsizeof_obj, mp_sys_getsizeof); + STATIC const mp_rom_map_elem_t mp_module_sys_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sys) }, @@ -192,6 +201,9 @@ STATIC const mp_rom_map_elem_t mp_module_sys_globals_table[] = { #if MICROPY_PY_SYS_EXC_INFO { 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) }, + #endif /* * Extensions to CPython diff --git a/py/mpconfig.h b/py/mpconfig.h index fb507a503..0e76a1ff5 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -944,6 +944,11 @@ typedef double mp_float_t; #define MICROPY_PY_SYS_EXIT (1) #endif +// Whether to provide "sys.getsizeof" function +#ifndef MICROPY_PY_SYS_GETSIZEOF +#define MICROPY_PY_SYS_GETSIZEOF (0) +#endif + // Whether to provide sys.{stdin,stdout,stderr} objects #ifndef MICROPY_PY_SYS_STDFILES #define MICROPY_PY_SYS_STDFILES (0) diff --git a/py/objdict.c b/py/objdict.c index a272ebdb6..f6357a905 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -105,6 +105,12 @@ STATIC mp_obj_t dict_unary_op(mp_uint_t op, mp_obj_t self_in) { switch (op) { case MP_UNARY_OP_BOOL: return mp_obj_new_bool(self->map.used != 0); case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(self->map.used); + #if MICROPY_PY_SYS_GETSIZEOF + case MP_UNARY_OP_SIZEOF: { + size_t sz = sizeof(*self) + sizeof(*self->map.table) * self->map.alloc; + return MP_OBJ_NEW_SMALL_INT(sz); + } + #endif default: return MP_OBJ_NULL; // op not supported } } diff --git a/py/objlist.c b/py/objlist.c index ba1c50677..5957c9d4a 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -104,6 +104,12 @@ STATIC mp_obj_t list_unary_op(mp_uint_t op, mp_obj_t self_in) { switch (op) { case MP_UNARY_OP_BOOL: return mp_obj_new_bool(self->len != 0); case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(self->len); + #if MICROPY_PY_SYS_GETSIZEOF + case MP_UNARY_OP_SIZEOF: { + size_t sz = sizeof(*self) + sizeof(mp_obj_t) * self->alloc; + return MP_OBJ_NEW_SMALL_INT(sz); + } + #endif default: return MP_OBJ_NULL; // op not supported } } diff --git a/py/objtype.c b/py/objtype.c index a258915f3..87c0cc9e5 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -339,11 +339,27 @@ const qstr mp_unary_op_method_name[] = { [MP_UNARY_OP_NEGATIVE] = MP_QSTR___neg__, [MP_UNARY_OP_INVERT] = MP_QSTR___invert__, #endif + #if MICROPY_PY_SYS_GETSIZEOF + [MP_UNARY_OP_SIZEOF] = MP_QSTR_getsizeof, + #endif [MP_UNARY_OP_NOT] = MP_QSTR_, // don't need to implement this, used to make sure array has full size }; STATIC mp_obj_t instance_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_instance_t *self = MP_OBJ_TO_PTR(self_in); + + #if MICROPY_PY_SYS_GETSIZEOF + if (MP_UNLIKELY(op == MP_UNARY_OP_SIZEOF)) { + // TODO: This doesn't count inherited objects (self->subobj) + const mp_obj_type_t *native_base; + size_t num_native_bases = instance_count_native_bases(mp_obj_get_type(self_in), &native_base); + + size_t sz = sizeof(*self) + sizeof(*self->subobj) * num_native_bases + + sizeof(*self->members.table) * self->members.alloc; + return MP_OBJ_NEW_SMALL_INT(sz); + } + #endif + qstr op_name = mp_unary_op_method_name[op]; /* Still try to lookup native slot if (op_name == 0) { diff --git a/py/runtime0.h b/py/runtime0.h index d22c2fabe..703c950f2 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -50,6 +50,7 @@ typedef enum { MP_UNARY_OP_NEGATIVE, MP_UNARY_OP_INVERT, MP_UNARY_OP_NOT, + MP_UNARY_OP_SIZEOF, // for sys.getsizeof() } mp_unary_op_t; typedef enum { diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 390ff1669..ab638a632 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -25,7 +25,8 @@ ame__ __name__ path argv version version_info implementation platform byteorder maxsize exit stdin stdout -stderr modules exc_info print_exception +stderr modules exc_info getsizeof +print_exception ementation # attrtuple (start=1, stop=2, step=3) diff --git a/unix/mpconfigport_coverage.h b/unix/mpconfigport_coverage.h index 5fc8d7107..a9e0a38fa 100644 --- a/unix/mpconfigport_coverage.h +++ b/unix/mpconfigport_coverage.h @@ -37,6 +37,7 @@ #define MICROPY_PY_DELATTR_SETATTR (1) #define MICROPY_PY_BUILTINS_HELP (1) #define MICROPY_PY_BUILTINS_HELP_MODULES (1) +#define MICROPY_PY_SYS_GETSIZEOF (1) #define MICROPY_PY_URANDOM_EXTRA_FUNCS (1) #define MICROPY_PY_IO_BUFFEREDWRITER (1) #undef MICROPY_VFS_FAT From d5191edf7ff81f5f07243cb2a318508c1e9cc5df Mon Sep 17 00:00:00 2001 From: Eric Poulsen Date: Tue, 15 Aug 2017 07:49:11 -0700 Subject: [PATCH 350/403] extmod/modussl_mbedtls.c: Add ussl.getpeercert() method. Behaviour is as per CPython but only the binary form is implemented here. A test is included. --- extmod/modussl_mbedtls.c | 12 ++++++++++++ tests/net_hosted/ssl_getpeercert.py | 21 +++++++++++++++++++++ tests/net_hosted/ssl_getpeercert.py.exp | 1 + 3 files changed, 34 insertions(+) create mode 100644 tests/net_hosted/ssl_getpeercert.py create mode 100644 tests/net_hosted/ssl_getpeercert.py.exp diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index 597eaee73..12ec60a75 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -34,6 +34,7 @@ #include "py/nlr.h" #include "py/runtime.h" #include "py/stream.h" +#include "py/obj.h" // mbedtls_time_t #include "mbedtls/platform.h" @@ -189,6 +190,16 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { return o; } +STATIC mp_obj_t mod_ssl_getpeercert(mp_obj_t o_in, mp_obj_t binary_form) { + mp_obj_ssl_socket_t *o = MP_OBJ_TO_PTR(o_in); + if (!mp_obj_is_true(binary_form)) { + mp_raise_NotImplementedError(NULL); + } + const mbedtls_x509_crt* peer_cert = mbedtls_ssl_get_peer_cert(&o->ssl); + return mp_obj_new_bytes(peer_cert->raw.p, peer_cert->raw.len); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_ssl_getpeercert_obj, mod_ssl_getpeercert); + STATIC void socket_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { (void)kind; mp_obj_ssl_socket_t *self = MP_OBJ_TO_PTR(self_in); @@ -259,6 +270,7 @@ STATIC const mp_rom_map_elem_t ussl_socket_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socket_setblocking_obj) }, { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&socket_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_getpeercert), MP_ROM_PTR(&mod_ssl_getpeercert_obj) }, }; STATIC MP_DEFINE_CONST_DICT(ussl_socket_locals_dict, ussl_socket_locals_dict_table); diff --git a/tests/net_hosted/ssl_getpeercert.py b/tests/net_hosted/ssl_getpeercert.py new file mode 100644 index 000000000..e265c830d --- /dev/null +++ b/tests/net_hosted/ssl_getpeercert.py @@ -0,0 +1,21 @@ +# test ssl.getpeercert() method + +try: + import usocket as socket + import ussl as ssl +except: + import socket + import ssl + + +def test(peer_addr): + s = socket.socket() + s.connect(peer_addr) + s = ssl.wrap_socket(s) + cert = s.getpeercert(True) + print(type(cert), len(cert) > 100) + s.close() + + +if __name__ == "__main__": + test(socket.getaddrinfo('micropython.org', 443)[0][-1]) diff --git a/tests/net_hosted/ssl_getpeercert.py.exp b/tests/net_hosted/ssl_getpeercert.py.exp new file mode 100644 index 000000000..ff7ef5adf --- /dev/null +++ b/tests/net_hosted/ssl_getpeercert.py.exp @@ -0,0 +1 @@ + True From ad937c49aa10e038dacbf27560ce34b76d84f861 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 16 Aug 2017 09:17:33 +0300 Subject: [PATCH 351/403] zephyr/modzephyr: Add current_tid() and stacks_analyze() functions. current_tid() returns current thread ID. stacks_analyze() calls k_call_stacks_analyze() which, with CONFIG_INIT_STACKS enabled, will print stack usage for some well-known threads in the system. --- zephyr/modzephyr.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zephyr/modzephyr.c b/zephyr/modzephyr.c index 4bac5c970..37c788ba4 100644 --- a/zephyr/modzephyr.c +++ b/zephyr/modzephyr.c @@ -28,6 +28,7 @@ #if MICROPY_PY_ZEPHYR #include +#include #include "py/runtime.h" @@ -36,9 +37,22 @@ STATIC mp_obj_t mod_is_preempt_thread(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_is_preempt_thread_obj, mod_is_preempt_thread); +STATIC mp_obj_t mod_current_tid(void) { + return MP_OBJ_NEW_SMALL_INT(k_current_get()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_current_tid_obj, mod_current_tid); + +STATIC mp_obj_t mod_stacks_analyze(void) { + k_call_stacks_analyze(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_stacks_analyze_obj, mod_stacks_analyze); + STATIC const mp_rom_map_elem_t mp_module_time_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_zephyr) }, { MP_ROM_QSTR(MP_QSTR_is_preempt_thread), MP_ROM_PTR(&mod_is_preempt_thread_obj) }, + { MP_ROM_QSTR(MP_QSTR_current_tid), MP_ROM_PTR(&mod_current_tid_obj) }, + { MP_ROM_QSTR(MP_QSTR_stacks_analyze), MP_ROM_PTR(&mod_stacks_analyze_obj) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_time_globals, mp_module_time_globals_table); From 9404093606c3c8c45f497a80789ee9ac21040751 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 16 Aug 2017 09:22:30 +0300 Subject: [PATCH 352/403] zephyr/prj_base.conf: Enable CONFIG_INIT_STACKS. As required for zephyr.stack_analyze(). --- zephyr/prj_base.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zephyr/prj_base.conf b/zephyr/prj_base.conf index 50b195b2f..4f3ff5035 100644 --- a/zephyr/prj_base.conf +++ b/zephyr/prj_base.conf @@ -24,6 +24,11 @@ CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES=2 CONFIG_DNS_SERVER_IP_ADDRESSES=y CONFIG_DNS_SERVER1="192.0.2.2" +# Diagnostics and debugging + +# Required for zephyr.stack_analyze() +CONFIG_INIT_STACKS=y + # Required for usocket.pkt_get_info() CONFIG_NET_BUF_POOL_USAGE=y From e4ab404780dfa194864c579407a054cf6c75db3a Mon Sep 17 00:00:00 2001 From: stijn Date: Wed, 16 Aug 2017 10:37:00 +0200 Subject: [PATCH 353/403] tools/mpy-tool.py: Fix missing argument in dump() function This makes the -d commandline argument usable again. Pass empty string as parent name as listing starts from the root. --- tools/mpy-tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index 887b3f516..ded962487 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -239,7 +239,7 @@ def _unpack_qstr(self, ip): def dump(self): # dump children first for rc in self.raw_codes: - rc.freeze() + rc.freeze('') # TODO def freeze(self, parent_name): From 65ca2d4886ea4036b37ae5233a5e5ee11ef9fdc5 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 16 Aug 2017 21:45:22 +0200 Subject: [PATCH 354/403] add badge.eink_png_info(filename or bytestring) --- esp32/modbadge.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 3e336909a..e342d37fe 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -370,6 +370,75 @@ STATIC mp_obj_t badge_eink_png(mp_obj_t obj_x, mp_obj_t obj_y, mp_obj_t obj_file } STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_eink_png_obj, badge_eink_png); +STATIC mp_obj_t badge_eink_png_info(mp_obj_t obj_filename) +{ + lib_reader_read_t reader; + void * reader_p; + + bool is_bytes = MP_OBJ_IS_TYPE(obj_filename, &mp_type_bytes); + + if (is_bytes) { + size_t len; + const uint8_t* png_data = (const uint8_t *) mp_obj_str_get_data(obj_filename, &len); + struct lib_mem_reader *mr = lib_mem_new(png_data, len); + if (mr == NULL) + { + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "out of memory!")); + return mp_const_none; + } + reader = (lib_reader_read_t) &lib_mem_read; + reader_p = mr; + + } else { + const char* filename = mp_obj_str_get_str(obj_filename); + struct lib_file_reader *fr = lib_file_new(filename, 1024); + if (fr == NULL) + { + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "Could not open file '%s'!",filename)); + return mp_const_none; + } + reader = (lib_reader_read_t) &lib_file_read; + reader_p = fr; + } + + struct lib_png_reader *pr = lib_png_new(reader, reader_p); + if (pr == NULL) + { + if (is_bytes) { + lib_mem_destroy(reader_p); + } else { + lib_file_destroy(reader_p); + } + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "out of memory.")); + return mp_const_none; + } + + int res = lib_png_read_header(pr); + + mp_obj_t tuple[4]; + if (res >= 0) { + tuple[0] = mp_obj_new_int(pr->ihdr.width); + tuple[1] = mp_obj_new_int(pr->ihdr.height); + tuple[2] = mp_obj_new_int(pr->ihdr.bit_depth); + tuple[3] = mp_obj_new_int(pr->ihdr.color_type); + } + + lib_png_destroy(pr); + if (is_bytes) { + lib_mem_destroy(reader_p); + } else { + lib_file_destroy(reader_p); + } + + if (res < 0) + { + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "failed to load image: res = %d", res)); + } + + return mp_obj_new_tuple(4, tuple); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(badge_eink_png_info_obj, badge_eink_png_info); + /* END OF PNG READER TEST */ @@ -675,6 +744,7 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_eink_busy_wait), MP_ROM_PTR(&badge_eink_busy_wait_obj)}, {MP_ROM_QSTR(MP_QSTR_eink_png), MP_ROM_PTR(&badge_eink_png_obj)}, + {MP_ROM_QSTR(MP_QSTR_eink_png_info), MP_ROM_PTR(&badge_eink_png_info_obj)}, {MP_ROM_QSTR(MP_QSTR_eink_display_raw), MP_ROM_PTR(&badge_eink_display_raw_obj)}, /* From 03345e3cdb45c41daef269e14f341825a913a0a6 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 16 Aug 2017 21:48:02 +0200 Subject: [PATCH 355/403] add badge.i2c_read_reg() and badge.i2c_write_reg() badge.i2c_read_reg(i2c_addr, reg_idx, data_len) badge.i2c_write_reg(i2c_addr, reg_idx, bytestring) --- esp32/modbadge.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 3e336909a..e7e39b11b 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -38,6 +38,7 @@ #include "bpp_init.h" +#include "badge_i2c.h" #include "badge_mpr121.h" #include "py/mperrno.h" @@ -213,6 +214,69 @@ STATIC mp_obj_t badge_nvs_set_u16_(mp_obj_t _namespace, mp_obj_t _key, mp_obj_t STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); +// I2C (badge_i2c.h) +STATIC mp_obj_t badge_i2c_read_reg_(mp_obj_t _addr, mp_obj_t _reg, mp_obj_t _len) { + int addr = mp_obj_get_int(_addr); + int reg = mp_obj_get_int(_reg); + int len = mp_obj_get_int(_len); + + if (addr < 0 || addr > 127) { + mp_raise_msg(&mp_type_AttributeError, "I2C address out of range"); + } + + if (reg < 0 || reg > 255) { + mp_raise_msg(&mp_type_AttributeError, "I2C register out of range"); + } + + if (len < 0) { + mp_raise_msg(&mp_type_AttributeError, "requested negative amount of bytes"); + } + + vstr_t vstr; + vstr_init_len(&vstr, len); + + esp_err_t res = badge_i2c_read_reg(addr, reg, (uint8_t *) vstr.buf, len); + if (res != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + + return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_i2c_read_reg_obj, badge_i2c_read_reg_); + +STATIC mp_obj_t badge_i2c_write_reg_(mp_obj_t _addr, mp_obj_t _reg, mp_obj_t _data) { + int addr = mp_obj_get_int(_addr); + int reg = mp_obj_get_int(_reg); + mp_uint_t data_len; + uint8_t *data = (uint8_t *) mp_obj_str_get_data(_data, &data_len); + + if (addr < 0 || addr > 127) { + mp_raise_msg(&mp_type_AttributeError, "I2C address out of range"); + } + + if (reg < 0 || reg > 255) { + mp_raise_msg(&mp_type_AttributeError, "I2C register out of range"); + } + + bool is_bytes = MP_OBJ_IS_TYPE(_data, &mp_type_bytes); + if (!is_bytes) { + mp_raise_msg(&mp_type_AttributeError, "Data should be a bytestring"); + } + + if (data_len != 1) { + mp_raise_msg(&mp_type_AttributeError, "Data-lengths other than 1 byte are not supported"); + } + + esp_err_t res = badge_i2c_write_reg(addr, reg, data[0]); + if (res != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_i2c_write_reg_obj, badge_i2c_write_reg_); + + // Mpr121 (badge_mpr121.h) #ifdef I2C_MPR121_ADDR #define store_dict_int(dict, field, contents) mp_obj_dict_store(dict, mp_obj_new_str(field, strlen(field), false), mp_obj_new_int(contents)); @@ -628,6 +692,10 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&badge_init_obj)}, + // I2C + {MP_ROM_QSTR(MP_QSTR_i2c_read_reg), MP_ROM_PTR(&badge_i2c_read_reg_obj)}, + {MP_ROM_QSTR(MP_QSTR_i2c_write_reg), MP_ROM_PTR(&badge_i2c_write_reg_obj)}, + // Mpr121 #ifdef I2C_MPR121_ADDR {MP_ROM_QSTR(MP_QSTR_mpr121_get_touch_info), MP_ROM_PTR(&badge_mpr121_get_touch_info_obj)}, From 025e5f2b339377ebc54ebc9cab2612946145a6fa Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 17 Aug 2017 16:16:11 +1000 Subject: [PATCH 356/403] py/binary: Change internal bytearray typecode from 0 to 1. The value of 0 can't be used because otherwise mp_binary_get_size will let a null byte through as the type code (intepreted as byterray). This can lead to invalid type-specifier strings being let through without an error in the struct module, and even buffer overruns. --- py/binary.h | 5 +++-- tests/basics/struct2.py | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/py/binary.h b/py/binary.h index 7b5c60f1a..0dae6a29e 100644 --- a/py/binary.h +++ b/py/binary.h @@ -29,8 +29,9 @@ #include "py/obj.h" // Use special typecode to differentiate repr() of bytearray vs array.array('B') -// (underlyingly they're same). -#define BYTEARRAY_TYPECODE 0 +// (underlyingly they're same). Can't use 0 here because that's used to detect +// type-specification errors due to end-of-string. +#define BYTEARRAY_TYPECODE 1 size_t mp_binary_get_size(char struct_type, char val_type, mp_uint_t *palign); mp_obj_t mp_binary_get_val_array(char typecode, void *p, mp_uint_t index); diff --git a/tests/basics/struct2.py b/tests/basics/struct2.py index d8234d0d3..3b9dd5c1f 100644 --- a/tests/basics/struct2.py +++ b/tests/basics/struct2.py @@ -40,3 +40,30 @@ struct.calcsize('0z') except: print('Exception') + +# check that a count without a type specifier raises an exception + +try: + struct.calcsize('1') +except: + print('Exception') + +try: + struct.pack('1') +except: + print('Exception') + +try: + struct.pack_into('1', bytearray(4), 0, 'xx') +except: + print('Exception') + +try: + struct.unpack('1', 'xx') +except: + print('Exception') + +try: + struct.unpack_from('1', 'xx') +except: + print('Exception') From c89254fd0f7f4517163e095f144bfe154f47758a Mon Sep 17 00:00:00 2001 From: Alex Robbins Date: Fri, 4 Aug 2017 17:30:34 -0500 Subject: [PATCH 357/403] extmod/modubinascii: Rewrite mod_binascii_a2b_base64. This implementation ignores invalid characters in the input. This allows it to decode the output of b2a_base64, and also mimics the behavior of CPython. --- extmod/modubinascii.c | 86 ++++++++++++++++------------ tests/extmod/ubinascii_a2b_base64.py | 7 +++ 2 files changed, 55 insertions(+), 38 deletions(-) diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index d3092a4df..b02d83318 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -105,54 +105,64 @@ mp_obj_t mod_binascii_unhexlify(mp_obj_t data) { } MP_DEFINE_CONST_FUN_OBJ_1(mod_binascii_unhexlify_obj, mod_binascii_unhexlify); +// If ch is a character in the base64 alphabet, and is not a pad character, then +// the corresponding integer between 0 and 63, inclusively, is returned. +// Otherwise, -1 is returned. +static int mod_binascii_sextet(byte ch) { + if (ch >= 'A' && ch <= 'Z') { + return ch - 'A'; + } else if (ch >= 'a' && ch <= 'z') { + return ch - 'a' + 26; + } else if (ch >= '0' && ch <= '9') { + return ch - '0' + 52; + } else if (ch == '+') { + return 62; + } else if (ch == '/') { + return 63; + } else { + return -1; + } +} + mp_obj_t mod_binascii_a2b_base64(mp_obj_t data) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ); - if (bufinfo.len % 4 != 0) { - mp_raise_ValueError("incorrect padding"); - } + byte *in = bufinfo.buf; vstr_t vstr; - byte *in = bufinfo.buf; - if (bufinfo.len == 0) { - vstr_init_len(&vstr, 0); - } - else { - vstr_init_len(&vstr, ((bufinfo.len / 4) * 3) - ((in[bufinfo.len-1] == '=') ? ((in[bufinfo.len-2] == '=') ? 2 : 1 ) : 0)); - } - byte *out = (byte*)vstr.buf; - for (mp_uint_t i = bufinfo.len; i; i -= 4) { - char hold[4]; - for (int j = 4; j--;) { - if (in[j] >= 'A' && in[j] <= 'Z') { - hold[j] = in[j] - 'A'; - } else if (in[j] >= 'a' && in[j] <= 'z') { - hold[j] = in[j] - 'a' + 26; - } else if (in[j] >= '0' && in[j] <= '9') { - hold[j] = in[j] - '0' + 52; - } else if (in[j] == '+') { - hold[j] = 62; - } else if (in[j] == '/') { - hold[j] = 63; - } else if (in[j] == '=') { - if (j < 2 || i > 4) { - mp_raise_ValueError("incorrect padding"); - } - hold[j] = 64; - } else { - mp_raise_ValueError("invalid character"); + vstr_init(&vstr, (bufinfo.len / 4) * 3 + 1); // Potentially over-allocate + byte *out = (byte *)vstr.buf; + + uint shift = 0; + int nbits = 0; // Number of meaningful bits in shift + bool hadpad = false; // Had a pad character since last valid character + for (size_t i = 0; i < bufinfo.len; i++) { + if (in[i] == '=') { + if ((nbits == 2) || ((nbits == 4) && hadpad)) { + nbits = 0; + break; } + hadpad = true; } - in += 4; - *out++ = (hold[0]) << 2 | (hold[1]) >> 4; - if (hold[2] != 64) { - *out++ = (hold[1] & 0x0F) << 4 | hold[2] >> 2; - if (hold[3] != 64) { - *out++ = (hold[2] & 0x03) << 6 | hold[3]; - } + int sextet = mod_binascii_sextet(in[i]); + if (sextet == -1) { + continue; + } + hadpad = false; + shift = (shift << 6) | sextet; + nbits += 6; + + if (nbits >= 8) { + nbits -= 8; + out[vstr.len++] = (shift >> nbits) & 0xFF; } } + + if (nbits) { + mp_raise_ValueError("incorrect padding"); + } + return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); } MP_DEFINE_CONST_FUN_OBJ_1(mod_binascii_a2b_base64_obj, mod_binascii_a2b_base64); diff --git a/tests/extmod/ubinascii_a2b_base64.py b/tests/extmod/ubinascii_a2b_base64.py index b35f26591..05a3169f3 100644 --- a/tests/extmod/ubinascii_a2b_base64.py +++ b/tests/extmod/ubinascii_a2b_base64.py @@ -21,6 +21,13 @@ print(binascii.a2b_base64(b'f4D+')) # convert '+' print(binascii.a2b_base64(b'MTIzNEFCQ0RhYmNk')) +# Ignore invalid characters and pad sequences +print(binascii.a2b_base64(b'Zm9v\n')) +print(binascii.a2b_base64(b'Zm\x009v\n')) +print(binascii.a2b_base64(b'Zm9v==')) +print(binascii.a2b_base64(b'Zm9v===')) +print(binascii.a2b_base64(b'Zm9v===YmFy')) + try: print(binascii.a2b_base64(b'abc')) except ValueError: From 0aa1d3f4477f56faf3bfc2891be627b86d87a63b Mon Sep 17 00:00:00 2001 From: Alex Robbins Date: Fri, 4 Aug 2017 18:01:35 -0500 Subject: [PATCH 358/403] docs/library/ubinascii: Update base64 docs. This clarifies return values and the handling of invalid (e.g. newline) characters. Encoding conforms to RFC 3548, but decoding does not, as it ignores invalid characters in base64 input. Instead, it conforms to MIME handling of base64 (RFC 2045). Note that CPython doesn't document handling of invalid characters in a2b_base64() docs: https://docs.python.org/3/library/binascii.html#binascii.a2b_base64 , so we specify it more explicitly than it, based on CPython's actual behavior (with which MicroPython now compliant). --- docs/library/ubinascii.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/library/ubinascii.rst b/docs/library/ubinascii.rst index 0664d5b09..192d34514 100644 --- a/docs/library/ubinascii.rst +++ b/docs/library/ubinascii.rst @@ -29,8 +29,12 @@ Functions .. function:: a2b_base64(data) - Convert Base64-encoded data to binary representation. Returns bytes string. + Decode base64-encoded data, ignoring invalid characters in the input. + Conforms to `RFC 2045 s.6.8 `_. + Returns a bytes object. .. function:: b2a_base64(data) - Encode binary data in Base64 format. Returns string. + Encode binary data in base64 format, as in `RFC 3548 + `_. Returns the encoded data + followed by a newline character, as a bytes object. From 09b561f108965565986a17ded3c4b869ee09fc14 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 19 Aug 2017 11:45:21 +0300 Subject: [PATCH 359/403] zephyr/modusocket: Update struct sockaddr family field name. Was changed to "sa_family" for POSIX compatibility. --- zephyr/modusocket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index f8d668a70..9319f4f98 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -88,8 +88,8 @@ STATIC mp_obj_t format_inet_addr(struct sockaddr *addr, mp_obj_t port) { // We employ the fact that port and address offsets are the same for IPv4 & IPv6 struct sockaddr_in6 *sockaddr_in6 = (struct sockaddr_in6*)addr; char buf[40]; - net_addr_ntop(addr->family, &sockaddr_in6->sin6_addr, buf, sizeof(buf)); - mp_obj_tuple_t *tuple = mp_obj_new_tuple(addr->family == AF_INET ? 2 : 4, NULL); + net_addr_ntop(addr->sa_family, &sockaddr_in6->sin6_addr, buf, sizeof(buf)); + mp_obj_tuple_t *tuple = mp_obj_new_tuple(addr->sa_family == AF_INET ? 2 : 4, NULL); tuple->items[0] = mp_obj_new_str(buf, strlen(buf), false); // We employ the fact that port offset is the same for IPv4 & IPv6 @@ -97,7 +97,7 @@ STATIC mp_obj_t format_inet_addr(struct sockaddr *addr, mp_obj_t port) { //tuple->items[1] = mp_obj_new_int(ntohs(((struct sockaddr_in*)addr)->sin_port)); tuple->items[1] = port; - if (addr->family == AF_INET6) { + if (addr->sa_family == AF_INET6) { tuple->items[2] = MP_OBJ_NEW_SMALL_INT(0); // flow_info tuple->items[3] = MP_OBJ_NEW_SMALL_INT(sockaddr_in6->sin6_scope_id); } From 394c5366758bf7b77174750007c020075e2507f4 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 19 Aug 2017 11:55:18 +0300 Subject: [PATCH 360/403] zephyr/prj_96b_carbon.conf: Re-enable networking on Carbon. The original issue leading to crash on startup if no default network interface was presented, was resolved some time ago. Note that this enables generic networking subsystem, not networking on Carbon. --- zephyr/prj_96b_carbon.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/prj_96b_carbon.conf b/zephyr/prj_96b_carbon.conf index 3e41e2532..40b57e69c 100644 --- a/zephyr/prj_96b_carbon.conf +++ b/zephyr/prj_96b_carbon.conf @@ -1,2 +1,2 @@ # TODO: Enable networking -CONFIG_NETWORKING=n +CONFIG_NETWORKING=y From 162bf53624998f0e809e0c52a60382909e976e38 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 19 Aug 2017 21:03:30 +0200 Subject: [PATCH 361/403] Run applications from bpp and sdcard as well. - Add /bpp/lib and /sdcard/lib to sys.path - Add 'bpp ' and 'sdcard ' prefix to mount bpp or sdcard on boot. --- esp32/main.c | 7 ++++++- esp32/modules/boot.py | 6 ++++++ esp32/qstrdefsport.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/esp32/main.c b/esp32/main.c index 575ca750a..03271a863 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -88,7 +88,9 @@ mp_import_stat_t mp_import_stat(const char *path) { if (in_safe_mode) { // be more strict in which modules we would like to load - if (strncmp(path, "/lib/", 5) != 0) { + if (strncmp(path, "/lib/", 5) != 0 + && strncmp(path, "/bpp/lib/", 9) != 0 + && strncmp(path, "/sdcard/lib/", 12) != 0) { return MP_IMPORT_STAT_NO_EXIST; } @@ -129,8 +131,11 @@ void mp_task(void *pvParameter) { gc_init(mp_task_heap, mp_task_heap + sizeof(mp_task_heap)); mp_init(); mp_obj_list_init(mp_sys_path, 0); + // library-path '' is needed for the internal modules. mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_lib)); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_bpp_slash_lib)); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_sdcard_slash_lib)); mp_obj_list_init(mp_sys_argv, 0); readline_init0(); diff --git a/esp32/modules/boot.py b/esp32/modules/boot.py index b0b522f13..fa735421a 100644 --- a/esp32/modules/boot.py +++ b/esp32/modules/boot.py @@ -27,6 +27,12 @@ try: if not splash=="shell": + if splash.startswith('bpp '): + splash = splash[4:len(splash)] + badge.mount_bpp() + elif splash.startswith('sdcard '): + splash = splash[7:len(splash)] + badge.mount_sdcard() __import__(splash) else: ugfx.clear(ugfx.WHITE) diff --git a/esp32/qstrdefsport.h b/esp32/qstrdefsport.h index ff6c2cc42..20454dcab 100644 --- a/esp32/qstrdefsport.h +++ b/esp32/qstrdefsport.h @@ -28,3 +28,5 @@ // Entries for sys.path Q(/lib) +Q(/bpp/lib) +Q(/sdcard/lib) From 478887c62ffae50cbb8e60e24405e2a4eae7b322 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 20 Aug 2017 08:45:00 +0300 Subject: [PATCH 362/403] zephyr/modzephyr: Add shell_net_iface() function. Calls out to Zephyr's shell, submodule "net", command "iface", and shows network interface information (if CONFIG_NET_SHELL is enabled). --- zephyr/modzephyr.c | 16 ++++++++++++++++ zephyr/prj_base.conf | 3 +++ 2 files changed, 19 insertions(+) diff --git a/zephyr/modzephyr.c b/zephyr/modzephyr.c index 37c788ba4..265fc882d 100644 --- a/zephyr/modzephyr.c +++ b/zephyr/modzephyr.c @@ -48,11 +48,27 @@ STATIC mp_obj_t mod_stacks_analyze(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_stacks_analyze_obj, mod_stacks_analyze); +#ifdef CONFIG_NET_SHELL + +//int net_shell_cmd_iface(int argc, char *argv[]); + +STATIC mp_obj_t mod_shell_net_iface(void) { + net_shell_cmd_iface(0, NULL); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_shell_net_iface_obj, mod_shell_net_iface); + +#endif // CONFIG_NET_SHELL + STATIC const mp_rom_map_elem_t mp_module_time_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_zephyr) }, { MP_ROM_QSTR(MP_QSTR_is_preempt_thread), MP_ROM_PTR(&mod_is_preempt_thread_obj) }, { MP_ROM_QSTR(MP_QSTR_current_tid), MP_ROM_PTR(&mod_current_tid_obj) }, { MP_ROM_QSTR(MP_QSTR_stacks_analyze), MP_ROM_PTR(&mod_stacks_analyze_obj) }, + + #ifdef CONFIG_NET_SHELL + { MP_ROM_QSTR(MP_QSTR_shell_net_iface), MP_ROM_PTR(&mod_shell_net_iface_obj) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(mp_module_time_globals, mp_module_time_globals_table); diff --git a/zephyr/prj_base.conf b/zephyr/prj_base.conf index 4f3ff5035..c3ba2812f 100644 --- a/zephyr/prj_base.conf +++ b/zephyr/prj_base.conf @@ -32,6 +32,9 @@ CONFIG_INIT_STACKS=y # Required for usocket.pkt_get_info() CONFIG_NET_BUF_POOL_USAGE=y +# Required for usocket.shell_*() +#CONFIG_NET_SHELL=y + # Uncomment to enable "INFO" level net_buf logging #CONFIG_NET_LOG=y #CONFIG_NET_DEBUG_NET_BUF=y From ccaad5327087eb93c3c5329b02ba7c11d95c0487 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 20 Aug 2017 09:04:48 +0300 Subject: [PATCH 363/403] docs/library/usocket: Move socket.error to its own section. It's too minor a point to start the module description with it. --- docs/library/usocket.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/library/usocket.rst b/docs/library/usocket.rst index 70d4f49fc..18a8f8fcd 100644 --- a/docs/library/usocket.rst +++ b/docs/library/usocket.rst @@ -9,12 +9,6 @@ This module provides access to the BSD socket interface. -.. admonition:: Difference to CPython - :class: attention - - CPython used to have a ``socket.error`` exception which is now deprecated, - and is an alias of `OSError`. In MicroPython, use `OSError` directly. - .. admonition:: Difference to CPython :class: attention @@ -250,3 +244,13 @@ Methods the length of *buf*. Return value: number of bytes written. + +.. exception:: socket.error + + MicroPython does NOT have this exception. + + .. admonition:: Difference to CPython + :class: attention + + CPython used to have a ``socket.error`` exception which is now deprecated, + and is an alias of `OSError`. In MicroPython, use `OSError` directly. From 3f915704833e2bf8b2d8b977640e8c630c5c5ef7 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 20 Aug 2017 09:49:12 +0300 Subject: [PATCH 364/403] docs/library/usocket: Describe complete information on address formats. Describe that the only portable way to deal with addresses is by using getaddrinfo(). Describe that some ports may support tuple addresses using "socket" module (vs "usocket" of native MicroPython). --- docs/library/usocket.rst | 46 +++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/docs/library/usocket.rst b/docs/library/usocket.rst index 18a8f8fcd..65e24e266 100644 --- a/docs/library/usocket.rst +++ b/docs/library/usocket.rst @@ -21,11 +21,47 @@ This module provides access to the BSD socket interface. Socket address format(s) ------------------------ -The functions below which expect a network address, accept it in the format of -*(ipv4_address, port)*, where *ipv4_address* is a string with dot-notation numeric -IPv4 address, e.g. ``"8.8.8.8"``, and port is integer port number in the range -1-65535. Note the domain names are not accepted as *ipv4_address*, they should be -resolved first using `usocket.getaddrinfo()`. +The native socket address format of the ``usocket`` module is an opaque data type +returned by `getaddrinfo` function, which must be used to resolve textual address +(including numeric addresses):: + + sockaddr = usocket.getaddrinfo('www.micropython.org', 80)[0][-1] + # You must use getaddrinfo() even for numeric addresses + sockaddr = usocket.getaddrinfo('127.0.0.1', 80)[0][-1] + # Now you can use that address + sock.connect(addr) + +Using `getaddrinfo` is the most efficient (both in terms of memory and processing +power) and portable way to work with addresses. + +However, ``socket`` module (note the difference with native MicroPython +``usocket`` module described here) provides CPython-compatible way to specify +addresses using tuples, as described below. Note that depending on a +`MicroPython port`, ``socket`` module can be builtin or need to be +installed from `micropython-lib` (as in the case of `MicroPython Unix port`), +and some ports still accept only numeric addresses in the tuple format, +and require to use `getaddrinfo` function to resolve domain names. + +Summing up: + +* Always use `getaddrinfo` when writing portable applications. +* Tuple addresses described below can be used as a shortcut for + quick hacks and interactive use, if your port supports them. + +Tuple address format for ``socket`` module: + +* IPv4: *(ipv4_address, port)*, where *ipv4_address* is a string with + dot-notation numeric IPv4 address, e.g. ``"8.8.8.8"``, and *port* is and + integer port number in the range 1-65535. Note the domain names are not + accepted as *ipv4_address*, they should be resolved first using + `usocket.getaddrinfo()`. +* IPv6: *(ipv6_address, port, flowinfo, scopeid)*, where *ipv6_address* + is a string with colon-notation numeric IPv6 address, e.g. ``"2001:db8::1"``, + and *port* is an integer port number in the range 1-65535. *flowinfo* + must be 0. *scopeid* is the interface scope identifier for link-local + addresses. Note the domain names are not accepted as *ipv6_address*, + they should be resolved first using `usocket.getaddrinfo()`. Availability + of IPv6 support depends on a `MicroPython port`. Functions --------- From 46583e905771222d7b8395e4c33569e2624f1943 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 20 Aug 2017 10:11:44 +0300 Subject: [PATCH 365/403] docs/glossary: Elaborate on possible MicroPython port differences. State that this doc describes generic, "core" MicroPython functionality, any particular port may diverge in both directions, by both omitting some functionality, and adding more, both cases described outside the generic documentation. --- docs/reference/glossary.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/reference/glossary.rst b/docs/reference/glossary.rst index 4099ae951..0f93fff23 100644 --- a/docs/reference/glossary.rst +++ b/docs/reference/glossary.rst @@ -68,7 +68,13 @@ Glossary MicroPython supports different :term:`boards `, RTOSes, and OSes, and can be relatively easily adapted to new systems. MicroPython with support for a particular system is called a - "port" to that system. + "port" to that system. Different ports may have widely different + functionality. This documentation is intended to be a reference + of the generic APIs available across different ports ("MicroPython + core"). Note that some ports may still omit some APIs described + here (e.g. due to resource constraints). Any such differences, + and port-specific extensions beyond MicroPython core functionality, + would be described in the separate port-specific documentation. MicroPython Unix port Unix port is one of the major :term:`MicroPython ports `. From 387a8d26f9b54b37928aa08641b159334b669219 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 20 Aug 2017 10:44:02 +0300 Subject: [PATCH 366/403] docs/glossary: Fix typos in micropython-lib paragraph. --- docs/reference/glossary.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/glossary.rst b/docs/reference/glossary.rst index 0f93fff23..98979afa9 100644 --- a/docs/reference/glossary.rst +++ b/docs/reference/glossary.rst @@ -54,10 +54,10 @@ Glossary separate project `micropython-lib `_ which provides implementations for many modules from CPython's - standard library. However, large subset of these modules required + standard library. However, large subset of these modules require POSIX-like environment (Linux, MacOS, Windows may be partially supported), and thus would work or make sense only with MicroPython - Unix port. Some subset of modules however usable for baremetal ports + Unix port. Some subset of modules is however usable for baremetal ports too. Unlike monolithic :term:`CPython` stdlib, micropython-lib modules From ea090617d0921254b85404fae2958f9ba94d4185 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 20 Aug 2017 13:43:42 +0200 Subject: [PATCH 367/403] Fix indenting in esp32/main.c --- esp32/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 03271a863..89ff38aa0 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -213,10 +213,10 @@ void app_main(void) { printf("Starting bpp.\n"); do_bpp_bgnd(); } else { - printf("Touch wake after bpp.\n"); - xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, - &mp_task_stack[0], &mp_task_tcb, 0); - } + printf("Touch wake after bpp.\n"); + xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, + &mp_task_stack[0], &mp_task_tcb, 0); + } break; #endif From f811ffd6cb8bd27a1133123984f71d91c06fed69 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 20 Aug 2017 13:49:38 +0200 Subject: [PATCH 368/403] Be more verbose on disabling custom splash screen. --- esp32/modules/boot.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/esp32/modules/boot.py b/esp32/modules/boot.py index fa735421a..20fd742bd 100644 --- a/esp32/modules/boot.py +++ b/esp32/modules/boot.py @@ -38,15 +38,18 @@ ugfx.clear(ugfx.WHITE) ugfx.flush(ugfx.LUT_FULL) except BaseException as e: + sys.print_exception(e) + import easydraw + easydraw.msg("A fatal error occured!","Still Crashing Anyway", True) + easydraw.msg("") + # if we started the splash screen and it is not the default splash screen, # then revert to original splash screen. if splash == badge.nvs_get_str('boot', 'splash', 'splash') and splash != 'splash': + easydraw.msg("Disabling custom splash screen.") + easydraw.msg("") badge.nvs_erase_key('boot', 'splash') - sys.print_exception(e) - import easydraw - easydraw.msg("A fatal error occured!","Still Crashing Anyway", True) - easydraw.msg("") easydraw.msg("Guru meditation:") easydraw.msg(str(e)) easydraw.msg("") From 6a012c8181673e5fb5f0e8f1b6e6181e73d396a8 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 20 Aug 2017 15:15:19 +0200 Subject: [PATCH 369/403] fixup Makefile --- esp32/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index e97a21959..10975033c 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := f13b5966d82ccb7c907d7ea1fa7eaf22335c104b +ESPIDF_SUPHASH := 525ee784af5f1131969a40c56434a92b93e34be2 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) @@ -298,6 +298,7 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\ intr_alloc.o \ dport_access.o \ brownout.o \ + fast_crypto_ops.o \ ) ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\ @@ -632,6 +633,10 @@ ESPIDF_WPA_SUPPLICANT_O = $(addprefix $(ESPCOMP)/wpa_supplicant/,\ src/crypto/bignum.o \ src/crypto/crypto_internal-modexp.o \ src/crypto/crypto_internal-cipher.o \ + src/fast_crypto/fast_sha256.o \ + src/fast_crypto/fast_sha256-internal.o \ + src/fast_crypto/fast_aes-wrap.o \ + src/fast_crypto/fast_aes-unwrap.o \ port/os_xtensa.o \ ) From 5677ea199106c39fd8104f3c6112be3fadd8eb4f Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 20 Aug 2017 15:22:37 +0200 Subject: [PATCH 370/403] bump version --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index dae04cf08..f98bcbf73 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 10 -name = "Blinkende Boemerang" +build = 11 +name = "Verdwenen Verteller" From 796b6f449daa7dec49328017dd80e194bba2b1c1 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 20 Aug 2017 15:35:22 +0200 Subject: [PATCH 371/403] fix leds-availability check --- esp32/modbadge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 221bb2c8e..fb1fce4e5 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -581,7 +581,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_power_sdcard_disable_obj, badge_power_sdc // LEDs -#if defined(PIN_NUM_LED) || defined(MPR121_PIN_NUM_LEDS) +#if defined(PIN_NUM_LEDS) STATIC mp_obj_t badge_leds_init_() { badge_leds_init(); return mp_const_none; @@ -795,7 +795,7 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_nvs_get_u16), MP_ROM_PTR(&badge_nvs_get_u16_obj)}, {MP_ROM_QSTR(MP_QSTR_nvs_set_u16), MP_ROM_PTR(&badge_nvs_set_u16_obj)}, -#if defined(PIN_NUM_LED) || defined(MPR121_PIN_NUM_LEDS) +#if defined(PIN_NUM_LEDS) // LEDs {MP_OBJ_NEW_QSTR(MP_QSTR_leds_init), (mp_obj_t)&badge_leds_init_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_leds_enable), (mp_obj_t)&badge_leds_enable_obj}, From 62a4719224f29cf9285bf8cd577d1623871f7e1a Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Sun, 20 Aug 2017 23:38:56 +0200 Subject: [PATCH 372/403] Updated CHANGELOG --- CHANGELOG.md | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f30f98b49..2b6764971 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,155 @@ ## [Unreleased](https://github.com/SHA2017-badge/micropython-esp32/tree/HEAD) -[Full Changelog](https://github.com/SHA2017-badge/micropython-esp32/compare/v1.9.1...HEAD) +[Full Changelog](https://github.com/SHA2017-badge/micropython-esp32/compare/sha2...HEAD) + +**Implemented enhancements:** + +- add badge.mpr121\_get\_touch\_info\(\) [\#175](https://github.com/SHA2017-badge/micropython-esp32/pull/175) ([basvs](https://github.com/basvs)) +- Fix msg function as per roosteds request [\#144](https://github.com/SHA2017-badge/micropython-esp32/pull/144) ([rnplus](https://github.com/rnplus)) + +**Fixed bugs:** + +- Launcher reset index switching category [\#140](https://github.com/SHA2017-badge/micropython-esp32/issues/140) +- Compensation for bad battery voltage measurements [\#94](https://github.com/SHA2017-badge/micropython-esp32/issues/94) + +**Closed issues:** + +- Some NVS settings are unreachable [\#209](https://github.com/SHA2017-badge/micropython-esp32/issues/209) +- Flipping the screen doesn't work as expected [\#206](https://github.com/SHA2017-badge/micropython-esp32/issues/206) +- When waking up from touch interrupt, the information about the touch event is lost [\#154](https://github.com/SHA2017-badge/micropython-esp32/issues/154) +- Splash does too many refreshes [\#149](https://github.com/SHA2017-badge/micropython-esp32/issues/149) +- Leaving badge in launcher or installer accidentally drains battery fast [\#148](https://github.com/SHA2017-badge/micropython-esp32/issues/148) +- open\(\) does not allow binary IO [\#146](https://github.com/SHA2017-badge/micropython-esp32/issues/146) +- Lots of ghosting after initial boot & sponsor app [\#137](https://github.com/SHA2017-badge/micropython-esp32/issues/137) +- boot.py not update-able via OTA [\#115](https://github.com/SHA2017-badge/micropython-esp32/issues/115) +- Put peripherals to sleep on deepsleep [\#114](https://github.com/SHA2017-badge/micropython-esp32/issues/114) +- Choose your own \(fancy nick etc\) screensaver [\#110](https://github.com/SHA2017-badge/micropython-esp32/issues/110) +- missing uos.urandom\(n\) in emulator [\#108](https://github.com/SHA2017-badge/micropython-esp32/issues/108) +- If battery is almost empty, nick is not visible anymore [\#96](https://github.com/SHA2017-badge/micropython-esp32/issues/96) +- Battery does not last half a day [\#95](https://github.com/SHA2017-badge/micropython-esp32/issues/95) +- No folders / categories in the launcher and installer [\#91](https://github.com/SHA2017-badge/micropython-esp32/issues/91) +- 'enter' on the OSK should submit the prompt [\#48](https://github.com/SHA2017-badge/micropython-esp32/issues/48) + +**Merged pull requests:** + +- Run applications from bpp and sdcard as well. [\#228](https://github.com/SHA2017-badge/micropython-esp32/pull/228) ([basvs](https://github.com/basvs)) +- add badge.i2c\_read\_reg\(\) and badge.i2c\_write\_reg\(\) [\#226](https://github.com/SHA2017-badge/micropython-esp32/pull/226) ([basvs](https://github.com/basvs)) +- add badge.eink\_png\_info\(filename or bytestring\) [\#225](https://github.com/SHA2017-badge/micropython-esp32/pull/225) ([basvs](https://github.com/basvs)) +- when the splash screen doesn't start, revert to default splash screen. [\#223](https://github.com/SHA2017-badge/micropython-esp32/pull/223) ([basvs](https://github.com/basvs)) +- add justifyTop when drawing text in an ugfx list item. [\#222](https://github.com/SHA2017-badge/micropython-esp32/pull/222) ([basvs](https://github.com/basvs)) +- move tm12x6\_font terminus font to read-only memory. [\#220](https://github.com/SHA2017-badge/micropython-esp32/pull/220) ([basvs](https://github.com/basvs)) +- Remove badge-event-reminder [\#219](https://github.com/SHA2017-badge/micropython-esp32/pull/219) ([basvs](https://github.com/basvs)) +- Add/fixup timezone support [\#218](https://github.com/SHA2017-badge/micropython-esp32/pull/218) ([basvs](https://github.com/basvs)) +- Merge upstream [\#217](https://github.com/SHA2017-badge/micropython-esp32/pull/217) ([basvs](https://github.com/basvs)) +- work around time.time\(\) brokenness [\#215](https://github.com/SHA2017-badge/micropython-esp32/pull/215) ([basvs](https://github.com/basvs)) +- Stop the badge waking up every few tens of seconds [\#213](https://github.com/SHA2017-badge/micropython-esp32/pull/213) ([gavanfantom](https://github.com/gavanfantom)) +- allow chdir to mountpoints \('/', '/sdcard' and '/bpp'\) [\#212](https://github.com/SHA2017-badge/micropython-esp32/pull/212) ([basvs](https://github.com/basvs)) +- Introduce ugfx\_screen\_flipped in the emulator, too [\#211](https://github.com/SHA2017-badge/micropython-esp32/pull/211) ([raboof](https://github.com/raboof)) +- rewrite set\_orientation to use the ugfx\_screen\_flip for rotations \>= … [\#210](https://github.com/SHA2017-badge/micropython-esp32/pull/210) ([basvs](https://github.com/basvs)) +- Added small, simple alternative GUI library \(freedomgfx\), which respects all four freedoms [\#208](https://github.com/SHA2017-badge/micropython-esp32/pull/208) ([chca42](https://github.com/chca42)) +- update event time and room [\#207](https://github.com/SHA2017-badge/micropython-esp32/pull/207) ([basvs](https://github.com/basvs)) +- Safe mode to allow recovery from malware [\#205](https://github.com/SHA2017-badge/micropython-esp32/pull/205) ([gavanfantom](https://github.com/gavanfantom)) +- push sponsors app [\#204](https://github.com/SHA2017-badge/micropython-esp32/pull/204) ([basvs](https://github.com/basvs)) +- soft reboot in raw REPL mode skips boot.py \(for ampy, pyboard\) [\#203](https://github.com/SHA2017-badge/micropython-esp32/pull/203) ([projectgus](https://github.com/projectgus)) +- Read PNG files directly from byte-string. [\#202](https://github.com/SHA2017-badge/micropython-esp32/pull/202) ([basvs](https://github.com/basvs)) +- update esp-idf git hash [\#201](https://github.com/SHA2017-badge/micropython-esp32/pull/201) ([basvs](https://github.com/basvs)) +- fix update all; update next egg if update failed. [\#200](https://github.com/SHA2017-badge/micropython-esp32/pull/200) ([basvs](https://github.com/basvs)) +- add option to stay awake on usb; suppress debug logging [\#199](https://github.com/SHA2017-badge/micropython-esp32/pull/199) ([basvs](https://github.com/basvs)) +- Suppress vfs\_native\_file open file error [\#198](https://github.com/SHA2017-badge/micropython-esp32/pull/198) ([basvs](https://github.com/basvs)) +- fix max open file descriptors in woezel [\#197](https://github.com/SHA2017-badge/micropython-esp32/pull/197) ([basvs](https://github.com/basvs)) +- If a package fails to install, report this to the user. If the reason [\#196](https://github.com/SHA2017-badge/micropython-esp32/pull/196) ([gavanfantom](https://github.com/gavanfantom)) +- Erase the otadata partition when flashing firmware, so that we can be… [\#195](https://github.com/SHA2017-badge/micropython-esp32/pull/195) ([gavanfantom](https://github.com/gavanfantom)) +- Use a timeout on fetching data, and handle failures gracefully. [\#194](https://github.com/SHA2017-badge/micropython-esp32/pull/194) ([gavanfantom](https://github.com/gavanfantom)) +- Use 'with open\(\) as f:' instead of 'f = open\(\)' [\#193](https://github.com/SHA2017-badge/micropython-esp32/pull/193) ([basvs](https://github.com/basvs)) +- Revert "Upy use powerdown mgr" [\#191](https://github.com/SHA2017-badge/micropython-esp32/pull/191) ([basvs](https://github.com/basvs)) +- fix big-endian packing to 8 bytes [\#190](https://github.com/SHA2017-badge/micropython-esp32/pull/190) ([basvs](https://github.com/basvs)) +- Make Jan Henk again. [\#189](https://github.com/SHA2017-badge/micropython-esp32/pull/189) ([ranzbak](https://github.com/ranzbak)) +- Change lipo bat indicator voltages [\#188](https://github.com/SHA2017-badge/micropython-esp32/pull/188) ([Roosted7](https://github.com/Roosted7)) +- Add make flash to makefile [\#187](https://github.com/SHA2017-badge/micropython-esp32/pull/187) ([Roosted7](https://github.com/Roosted7)) +- add experimental temperature sensor and hall sensor. [\#186](https://github.com/SHA2017-badge/micropython-esp32/pull/186) ([basvs](https://github.com/basvs)) +- Add a new optional argument to the draw\(\) function in a service, whic… [\#185](https://github.com/SHA2017-badge/micropython-esp32/pull/185) ([gavanfantom](https://github.com/gavanfantom)) +- Fix redraw loop when idle [\#184](https://github.com/SHA2017-badge/micropython-esp32/pull/184) ([gavanfantom](https://github.com/gavanfantom)) +- Add time to OTA check [\#182](https://github.com/SHA2017-badge/micropython-esp32/pull/182) ([rnplus](https://github.com/rnplus)) +- Allow services to execute a special draw function just before sleeping [\#181](https://github.com/SHA2017-badge/micropython-esp32/pull/181) ([rnplus](https://github.com/rnplus)) +- Exception reporting and post OTA update script [\#180](https://github.com/SHA2017-badge/micropython-esp32/pull/180) ([rnplus](https://github.com/rnplus)) +- add wrapper around badge\_eink\_display\(\) method [\#179](https://github.com/SHA2017-badge/micropython-esp32/pull/179) ([basvs](https://github.com/basvs)) +- New launcher [\#178](https://github.com/SHA2017-badge/micropython-esp32/pull/178) ([rnplus](https://github.com/rnplus)) +- add simple wrapper for low-level bpp flash data [\#177](https://github.com/SHA2017-badge/micropython-esp32/pull/177) ([basvs](https://github.com/basvs)) +- do not re-install the gpio-isr-service. it's already installed. [\#176](https://github.com/SHA2017-badge/micropython-esp32/pull/176) ([basvs](https://github.com/basvs)) +- Add set\_timeout to power management [\#174](https://github.com/SHA2017-badge/micropython-esp32/pull/174) ([rnplus](https://github.com/rnplus)) +- Add update all app to firmware [\#173](https://github.com/SHA2017-badge/micropython-esp32/pull/173) ([rnplus](https://github.com/rnplus)) +- Add power management to launcher [\#172](https://github.com/SHA2017-badge/micropython-esp32/pull/172) ([rnplus](https://github.com/rnplus)) +- Move mount-code to modbadge; add sdcard support [\#171](https://github.com/SHA2017-badge/micropython-esp32/pull/171) ([basvs](https://github.com/basvs)) +- Change led brightness for event reminder and make rtc mandatory again [\#170](https://github.com/SHA2017-badge/micropython-esp32/pull/170) ([rnplus](https://github.com/rnplus)) +- Fixed a couple of small bugs [\#169](https://github.com/SHA2017-badge/micropython-esp32/pull/169) ([rnplus](https://github.com/rnplus)) +- Add some sugar and spice to make things nice [\#168](https://github.com/SHA2017-badge/micropython-esp32/pull/168) ([rnplus](https://github.com/rnplus)) +- Renze cleanup [\#167](https://github.com/SHA2017-badge/micropython-esp32/pull/167) ([rnplus](https://github.com/rnplus)) +- set type after determining type.. [\#166](https://github.com/SHA2017-badge/micropython-esp32/pull/166) ([basvs](https://github.com/basvs)) +- Add nice change by raboof [\#165](https://github.com/SHA2017-badge/micropython-esp32/pull/165) ([rnplus](https://github.com/rnplus)) +- Working services [\#164](https://github.com/SHA2017-badge/micropython-esp32/pull/164) ([rnplus](https://github.com/rnplus)) +- Add some warning notes when using badge.leds\_send\_data\(\) incorrectly [\#163](https://github.com/SHA2017-badge/micropython-esp32/pull/163) ([basvs](https://github.com/basvs)) +- Add optional timestamp argument to easyrtc.string\(\) [\#160](https://github.com/SHA2017-badge/micropython-esp32/pull/160) ([rnplus](https://github.com/rnplus)) +- Upy use powerdown mgr [\#159](https://github.com/SHA2017-badge/micropython-esp32/pull/159) ([Spritetm](https://github.com/Spritetm)) +- Service api v2 [\#158](https://github.com/SHA2017-badge/micropython-esp32/pull/158) ([rnplus](https://github.com/rnplus)) +- Lower loglevel of wifi at runtime [\#157](https://github.com/SHA2017-badge/micropython-esp32/pull/157) ([Roosted7](https://github.com/Roosted7)) +- Fix errors introduced by changing easydraw.msg\(\) function [\#155](https://github.com/SHA2017-badge/micropython-esp32/pull/155) ([rnplus](https://github.com/rnplus)) +- add badge.eink\_deep\_sleep\(\) and badge.eink\_wakeup\(\) [\#153](https://github.com/SHA2017-badge/micropython-esp32/pull/153) ([basvs](https://github.com/basvs)) +- Add more badge\_power hooks. [\#151](https://github.com/SHA2017-badge/micropython-esp32/pull/151) ([basvs](https://github.com/basvs)) +- add badge.GREYSCALE const. [\#150](https://github.com/SHA2017-badge/micropython-esp32/pull/150) ([basvs](https://github.com/basvs)) +- initialize with default eink type. \(as configured in make menuconfig\) [\#145](https://github.com/SHA2017-badge/micropython-esp32/pull/145) ([basvs](https://github.com/basvs)) +- Fix a big bug and a little bit of cleaning [\#143](https://github.com/SHA2017-badge/micropython-esp32/pull/143) ([rnplus](https://github.com/rnplus)) +- Split splash into smaller parts, thereby creating helper files for some functions [\#142](https://github.com/SHA2017-badge/micropython-esp32/pull/142) ([rnplus](https://github.com/rnplus)) +- Makefile improvements [\#141](https://github.com/SHA2017-badge/micropython-esp32/pull/141) ([basvs](https://github.com/basvs)) +- Bugfixes for splash [\#139](https://github.com/SHA2017-badge/micropython-esp32/pull/139) ([rnplus](https://github.com/rnplus)) +- Updated splash code and try to mount bpp [\#138](https://github.com/SHA2017-badge/micropython-esp32/pull/138) ([rnplus](https://github.com/rnplus)) +- Up installer WiFi timeout from 4s to 15s [\#136](https://github.com/SHA2017-badge/micropython-esp32/pull/136) ([niekproductions](https://github.com/niekproductions)) +- Update demo.py [\#135](https://github.com/SHA2017-badge/micropython-esp32/pull/135) ([powermik](https://github.com/powermik)) +- renamed badge\_portexp to badge\_fxl6408 [\#134](https://github.com/SHA2017-badge/micropython-esp32/pull/134) ([basvs](https://github.com/basvs)) +- Pull changes from upstream [\#133](https://github.com/SHA2017-badge/micropython-esp32/pull/133) ([Roosted7](https://github.com/Roosted7)) +- badge\_touch -\> badge\_cpt112s [\#132](https://github.com/SHA2017-badge/micropython-esp32/pull/132) ([basvs](https://github.com/basvs)) +- uos.urandom\(\) bugfix. [\#131](https://github.com/SHA2017-badge/micropython-esp32/pull/131) ([basvs](https://github.com/basvs)) +- Added gfx\_userfs glue to micropython build [\#130](https://github.com/SHA2017-badge/micropython-esp32/pull/130) ([aczid](https://github.com/aczid)) +- Add support for removal of NVS page [\#129](https://github.com/SHA2017-badge/micropython-esp32/pull/129) ([Roosted7](https://github.com/Roosted7)) +- Added a urandom port for Unix build [\#127](https://github.com/SHA2017-badge/micropython-esp32/pull/127) ([aczid](https://github.com/aczid)) + +## [sha2](https://github.com/SHA2017-badge/micropython-esp32/tree/sha2) (2017-07-26) +[Full Changelog](https://github.com/SHA2017-badge/micropython-esp32/compare/sha1...sha2) + +**Implemented enhancements:** + +- Installer rewrite w/ category support [\#120](https://github.com/SHA2017-badge/micropython-esp32/pull/120) ([niekproductions](https://github.com/niekproductions)) +- Launcher UX fixes [\#107](https://github.com/SHA2017-badge/micropython-esp32/pull/107) ([niekproductions](https://github.com/niekproductions)) + +**Closed issues:** + +- Led driver not working properly above Hex 0x7F [\#119](https://github.com/SHA2017-badge/micropython-esp32/issues/119) +- ugfx.init\(\) flashes screen [\#112](https://github.com/SHA2017-badge/micropython-esp32/issues/112) +- rtcmem: check if offset is valid [\#111](https://github.com/SHA2017-badge/micropython-esp32/issues/111) +- 'Flash' button not used [\#99](https://github.com/SHA2017-badge/micropython-esp32/issues/99) +- nvs\_\[get/set\]\_u\[8/16\] not working [\#93](https://github.com/SHA2017-badge/micropython-esp32/issues/93) +- woezel unzip dict size [\#82](https://github.com/SHA2017-badge/micropython-esp32/issues/82) +- Sponsor app not working [\#78](https://github.com/SHA2017-badge/micropython-esp32/issues/78) + +**Merged pull requests:** + +- Consistent UI and updated installer [\#126](https://github.com/SHA2017-badge/micropython-esp32/pull/126) ([Roosted7](https://github.com/Roosted7)) +- use input framework to check for waiting input. [\#125](https://github.com/SHA2017-badge/micropython-esp32/pull/125) ([basvs](https://github.com/basvs)) +- New setup and default name [\#124](https://github.com/SHA2017-badge/micropython-esp32/pull/124) ([Roosted7](https://github.com/Roosted7)) +- support negative offsets in png image loading [\#122](https://github.com/SHA2017-badge/micropython-esp32/pull/122) ([annejan](https://github.com/annejan)) +- cleanup esp-rtcmem code. throw out-of-range exceptions. [\#121](https://github.com/SHA2017-badge/micropython-esp32/pull/121) ([basvs](https://github.com/basvs)) +- Update makefile: faster boot and flash [\#118](https://github.com/SHA2017-badge/micropython-esp32/pull/118) ([Roosted7](https://github.com/Roosted7)) +- Major python code change [\#116](https://github.com/SHA2017-badge/micropython-esp32/pull/116) ([Roosted7](https://github.com/Roosted7)) +- Added extra urandom functions [\#109](https://github.com/SHA2017-badge/micropython-esp32/pull/109) ([aczid](https://github.com/aczid)) +- lower max\_files from 8 to 3. [\#106](https://github.com/SHA2017-badge/micropython-esp32/pull/106) ([basvs](https://github.com/basvs)) +- Remove deprecated led function [\#105](https://github.com/SHA2017-badge/micropython-esp32/pull/105) ([Roosted7](https://github.com/Roosted7)) +- expose badge.nvs\_erase\_key\(\) [\#103](https://github.com/SHA2017-badge/micropython-esp32/pull/103) ([basvs](https://github.com/basvs)) +- Code cleanup of the badge.nvs\_\* code. [\#102](https://github.com/SHA2017-badge/micropython-esp32/pull/102) ([basvs](https://github.com/basvs)) +- Setup.state as u8 and shorter keys [\#101](https://github.com/SHA2017-badge/micropython-esp32/pull/101) ([rnplus](https://github.com/rnplus)) +- report tls error messages instead of crashing. [\#100](https://github.com/SHA2017-badge/micropython-esp32/pull/100) ([basvs](https://github.com/basvs)) + +## [sha1](https://github.com/SHA2017-badge/micropython-esp32/tree/sha1) (2017-07-21) +[Full Changelog](https://github.com/SHA2017-badge/micropython-esp32/compare/v1.9.1...sha1) **Implemented enhancements:** @@ -16,6 +164,12 @@ **Merged pull requests:** +- Zo is ie mooier. [\#88](https://github.com/SHA2017-badge/micropython-esp32/pull/88) ([rnplus](https://github.com/rnplus)) +- About [\#87](https://github.com/SHA2017-badge/micropython-esp32/pull/87) ([rnplus](https://github.com/rnplus)) +- OTA check + Other fixes [\#86](https://github.com/SHA2017-badge/micropython-esp32/pull/86) ([rnplus](https://github.com/rnplus)) +- dump esp heap info. [\#85](https://github.com/SHA2017-badge/micropython-esp32/pull/85) ([basvs](https://github.com/basvs)) +- Basvs ugfx greyscale [\#84](https://github.com/SHA2017-badge/micropython-esp32/pull/84) ([annejan](https://github.com/annejan)) +- Basvs preseed unzip [\#83](https://github.com/SHA2017-badge/micropython-esp32/pull/83) ([annejan](https://github.com/annejan)) - update wifiSetup [\#81](https://github.com/SHA2017-badge/micropython-esp32/pull/81) ([Roosted7](https://github.com/Roosted7)) - Add static wifiSetup module [\#79](https://github.com/SHA2017-badge/micropython-esp32/pull/79) ([Roosted7](https://github.com/Roosted7)) - Remove flashing script from upy dir [\#77](https://github.com/SHA2017-badge/micropython-esp32/pull/77) ([Roosted7](https://github.com/Roosted7)) From f0b517690b92702f9c30c5b6a4255c8655ed13ee Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 23 Aug 2017 23:39:41 +0200 Subject: [PATCH 373/403] update Makefile to build with newer esp-idf lib --- esp32/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index 10975033c..46e194340 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 525ee784af5f1131969a40c56434a92b93e34be2 +ESPIDF_SUPHASH := fdcf2ba393eb7a91196882ef995bd6e9f64565e5 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) @@ -299,6 +299,7 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\ dport_access.o \ brownout.o \ fast_crypto_ops.o \ + wifi_init.o \ ) ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\ From 6216d0453fa0ea147a7e9b41ae3798d90ca86633 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 27 Jan 2018 20:41:36 +0100 Subject: [PATCH 374/403] fix compatibilities with newer esp-idf --- esp32/Makefile | 25 +++++++++++++++------ esp32/esp32.custom_common.ld | 43 ++++++++++++++++++++++-------------- esp32/modmachine.c | 8 +++---- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index 46e194340..4eb8da82f 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := fdcf2ba393eb7a91196882ef995bd6e9f64565e5 +ESPIDF_SUPHASH := 2ce9a383d326c2b2c29f0e7c87ce44db04d60c51 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) @@ -125,7 +125,7 @@ LDFLAGS = -nostdlib -Map=$(@:.elf=.map) --cref LDFLAGS += --gc-sections -static -EL LDFLAGS += -u call_user_start_cpu0 -u uxTopUsedPriority LDFLAGS += -u __cxa_guard_dummy # so that implementation of static guards is taken from cxx_guards.o instead of libstdc++.a -LDFLAGS += -L$(ESPCOMP)/esp32/ld -T $(BUILD)/esp32_out.ld -T ./esp32.custom_common.ld -T esp32.rom.ld -T esp32.rom.spiflash.ld -T esp32.peripherals.ld +LDFLAGS += -L$(ESPCOMP)/esp32/ld -T $(BUILD)/esp32_out.ld -T ./esp32.custom_common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld LIBGCC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) LIBSTDCXX_FILE_NAME = $(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a) @@ -284,7 +284,6 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\ cpu_start.o \ gdbstub.o \ crosscore_int.o \ - deep_sleep.o \ ipc.o \ int_wdt.o \ event_loop.o \ @@ -300,6 +299,16 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\ brownout.o \ fast_crypto_ops.o \ wifi_init.o \ + wifi_internal.o \ + sleep_modes.o \ + esp_timer.o \ + esp_timer_esp32.o \ + ets_timer_legacy.o \ + ) + +ESPIDF_PTHREAD_O = $(addprefix $(ESPCOMP)/pthread/,\ + pthread.o \ + pthread_local_storage.o \ ) ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\ @@ -530,11 +539,11 @@ ESPIDF_LWIP_O = $(addprefix $(ESPCOMP)/lwip/,\ port/freertos/sys_arch.o \ port/netif/wlanif.o \ port/netif/ethernetif.o \ + port/vfs_lwip.o \ ) ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\ library/entropy.o \ - library/net.o \ library/pkcs12.o \ library/ccm.o \ library/pk.o \ @@ -603,7 +612,7 @@ ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\ library/ctr_drbg.o \ library/x509write_crt.o \ library/pk_wrap.o \ - port/net.o \ + port/net_sockets.o \ port/esp_bignum.o \ port/esp_hardware.o \ port/esp_sha1.o \ @@ -645,6 +654,7 @@ OBJ_ESPIDF = OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_NEWLIB_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_DRIVER_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_ESP32_O)) +OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_PTHREAD_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SOC_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_CXX_O)) @@ -760,11 +770,12 @@ APP_LD_ARGS += $(LDFLAGS_MOD) APP_LD_ARGS += --start-group APP_LD_ARGS += -L$(dir $(LIBGCC_FILE_NAME)) -lgcc APP_LD_ARGS += -L$(dir $(LIBSTDCXX_FILE_NAME)) -lstdc++ +APP_LD_ARGS += -lgcov APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a APP_LD_ARGS += $(BADGE_LIBS) -APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lsmartconfig -lcoexist +APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist APP_LD_ARGS += $(OBJ) APP_LD_ARGS += --end-group @@ -836,7 +847,7 @@ BOOTLOADER_LDFLAGS += -Wl,-Map=$(@:.elf=.map) -Wl,--cref BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.ld BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.rom.ld BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.ld -BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.spiflash.ld +BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.spiram_incompatible_fns.ld BOOTLOADER_OBJ_DIRS = $(sort $(dir $(BOOTLOADER_OBJ))) $(BOOTLOADER_OBJ): | $(BOOTLOADER_OBJ_DIRS) diff --git a/esp32/esp32.custom_common.ld b/esp32/esp32.custom_common.ld index 363b6b53c..5e5f864d7 100644 --- a/esp32/esp32.custom_common.ld +++ b/esp32/esp32.custom_common.ld @@ -83,37 +83,46 @@ SECTIONS _iram_text_start = ABSOLUTE(.); *(.iram1 .iram1.*) *freertos/*(.literal .text .literal.* .text.*) + *heap/multi_heap.o(.literal .text .literal.* .text.*) + *heap/multi_heap_poisoning.o(.literal .text .literal.* .text.*) *esp32/panic.o(.literal .text .literal.* .text.*) *esp32/core_dump.o(.literal .text .literal.* .text.*) - *esp32/heap_alloc_caps.o(.literal .text .literal.* .text.*) - *esp32/app_trace.o(.literal .text .literal.* .text.*) + *app_trace/*(.literal .text .literal.* .text.*) + *xtensa-debug-module/eri.o(.literal .text .literal.* .text.*) *libphy.a:(.literal .text .literal.* .text.*) *librtc.a:(.literal .text .literal.* .text.*) *libsoc.a:(.literal .text .literal.* .text.*) *libhal.a:(.literal .text .literal.* .text.*) + *libgcc.a:lib2funcs.o(.literal .text .literal.* .text.*) *spi_flash/spi_flash_rom_patch.o(.literal .text .literal.* .text.*) + *libgcov.a:(.literal .text .literal.* .text.*) *py/scheduler.o*(.literal .text .literal.* .text.*) + INCLUDE esp32.spiram.rom-functions-iram.ld _iram_text_end = ABSOLUTE(.); } > iram0_0_seg .dram0.data : { _data_start = ABSOLUTE(.); - KEEP(*(.data)) - KEEP(*(.data.*)) - KEEP(*(.gnu.linkonce.d.*)) - KEEP(*(.data1)) - KEEP(*(.sdata)) - KEEP(*(.sdata.*)) - KEEP(*(.gnu.linkonce.s.*)) - KEEP(*(.sdata2)) - KEEP(*(.sdata2.*)) - KEEP(*(.gnu.linkonce.s2.*)) - KEEP(*(.jcr)) + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + *(.data1) + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + *(.sdata2) + *(.sdata2.*) + *(.gnu.linkonce.s2.*) + *(.jcr) *(.dram1 .dram1.*) *esp32/panic.o(.rodata .rodata.*) - *esp32/app_trace.o(.rodata .rodata.*) *libphy.a:(.rodata .rodata.*) + *app_trace/*(.rodata .rodata.*) + *libgcov.a:(.rodata .rodata.*) + *heap/multi_heap.o(.rodata .rodata.*) + *heap/multi_heap_poisoning.o(.rodata .rodata.*) + INCLUDE esp32.spiram.rom-functions-dram.ld _data_end = ABSOLUTE(.); . = ALIGN(4); } >dram0_0_seg @@ -152,11 +161,13 @@ SECTIONS *(.rodata1) __XT_EXCEPTION_TABLE_ = ABSOLUTE(.); *(.xt_except_table) - *(.gcc_except_table) + *(.gcc_except_table .gcc_except_table.*) *(.gnu.linkonce.e.*) *(.gnu.version_r) - *(.eh_frame) . = (. + 3) & ~ 3; + __eh_frame = ABSOLUTE(.); + KEEP(*(.eh_frame)) + . = (. + 7) & ~ 3; /* C++ constructor and destructor tables, properly ordered: */ __init_array_start = ABSOLUTE(.); KEEP (*crtbegin.o(.ctors)) diff --git a/esp32/modmachine.c b/esp32/modmachine.c index 09a1dbc7c..f3aa75125 100644 --- a/esp32/modmachine.c +++ b/esp32/modmachine.c @@ -90,21 +90,21 @@ STATIC mp_obj_t machine_deepsleep(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_int_t expiry = args[ARG_sleep_ms].u_int; if (expiry != 0) { - esp_deep_sleep_enable_timer_wakeup(expiry * 1000); + esp_sleep_enable_timer_wakeup(expiry * 1000); } if (machine_rtc_config.ext0_pin != -1) { - esp_deep_sleep_enable_ext0_wakeup(machine_rtc_config.ext0_pin, machine_rtc_config.ext0_level ? 1 : 0); + esp_sleep_enable_ext0_wakeup(machine_rtc_config.ext0_pin, machine_rtc_config.ext0_level ? 1 : 0); } if (machine_rtc_config.ext1_pins != 0) { - esp_deep_sleep_enable_ext1_wakeup( + esp_sleep_enable_ext1_wakeup( machine_rtc_config.ext1_pins, machine_rtc_config.ext1_level ? ESP_EXT1_WAKEUP_ANY_HIGH : ESP_EXT1_WAKEUP_ALL_LOW); } if (machine_rtc_config.wake_on_touch) { - esp_deep_sleep_enable_touchpad_wakeup(); + esp_sleep_enable_touchpad_wakeup(); } esp_deep_sleep_start(); From cc9a68cccc3170d60ee95ac9aba4cc7d136c68a2 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Fri, 16 Feb 2018 00:12:37 +0100 Subject: [PATCH 375/403] make compatible with esp-idf commit cf2600ad --- esp32/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index 4eb8da82f..8bbc99f27 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 2ce9a383d326c2b2c29f0e7c87ce44db04d60c51 +ESPIDF_SUPHASH := 223ef05fb57ba3312a1ee4d76f1f1ba53e41ac12 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) @@ -234,8 +234,8 @@ LIB_SRC_C += \ $(ESPCOMP)/fatfs/src/vfs_fat_sdmmc.c \ $(ESPCOMP)/fatfs/src/vfs_fat_spiflash.c \ $(ESPCOMP)/fatfs/src/vfs_fat.c \ - $(ESPCOMP)/fatfs/src/option/syscall.c \ - $(ESPCOMP)/fatfs/src/option/unicode.c + $(ESPCOMP)/fatfs/src/ffunicode.c \ + $(ESPCOMP)/fatfs/src/ffsystem.c endif DRIVERS_SRC_C = $(addprefix drivers/,\ @@ -399,8 +399,8 @@ ESPIDF_VFS_O = $(addprefix $(ESPCOMP)/vfs/,\ ) ESPIDF_JSON_O = $(addprefix $(ESPCOMP)/json/,\ - library/cJSON.o \ - port/cJSON_Utils.o \ + cJSON/cJSON.o \ + cJSON/cJSON_Utils.o \ ) ESPIDF_LOG_O = $(addprefix $(ESPCOMP)/log/,\ @@ -815,6 +815,7 @@ BOOTLOADER_OBJ = $(addprefix $(BUILD)/bootloader/$(ESPCOMP)/,\ bootloader_support/src/bootloader_flash.o \ bootloader_support/src/bootloader_sha.o \ bootloader_support/src/bootloader_random.o \ + bootloader_support/src/bootloader_clock.o \ bootloader_support/src/secure_boot_signatures.o \ bootloader_support/src/secure_boot.o \ bootloader_support/src/esp_image_format.o \ @@ -824,6 +825,7 @@ BOOTLOADER_OBJ = $(addprefix $(BUILD)/bootloader/$(ESPCOMP)/,\ spi_flash/spi_flash_rom_patch.o \ soc/esp32/rtc_clk.o \ soc/esp32/rtc_time.o \ + soc/esp32/rtc_init.o \ micro-ecc/micro-ecc/uECC.o \ bootloader/subproject/main/bootloader_start.o \ ) From 2fff51426d3738dfb9fd8a088ea99e95e92d99ab Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Fri, 16 Feb 2018 14:54:38 +0100 Subject: [PATCH 376/403] fixup ESPIDF_SUPHASH --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index 8bbc99f27..11d2de0eb 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 223ef05fb57ba3312a1ee4d76f1f1ba53e41ac12 +ESPIDF_SUPHASH := 297018a7780969c04d7783754ee479ef6b6707c1 ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) From 9014e30876eaf42773f2ba4f9d9f348d0049091e Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Fri, 16 Feb 2018 16:55:14 +0100 Subject: [PATCH 377/403] update version id / name --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index f98bcbf73..abda8ad83 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 11 -name = "Verdwenen Verteller" +build = 12 +name = "Verraad op de Veluwe" From 730ff75e2047230fdc050c0c3b2287da565ab3fd Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 17 Feb 2018 18:15:33 +0100 Subject: [PATCH 378/403] Fix compiler warnings and bugfix in ugfx.Textbox.cursor_pos() - bugfix in ugfx.Textbox.cursor_pos($newpos); called gwinTexteditDefaultDraw with wrong pointer. - adc1_get_voltage() is deprecated. Using adc1_get_raw() instead. - include extmod/vfs.h for mp_vfs_import_stat() definition. - use %p to write pointers --- esp32/machine_adc.c | 2 +- esp32/main.c | 1 + esp32/ugfx_widgets.c | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/esp32/machine_adc.c b/esp32/machine_adc.c index 659702ae2..72696e11b 100644 --- a/esp32/machine_adc.c +++ b/esp32/machine_adc.c @@ -81,7 +81,7 @@ STATIC void madc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_ STATIC mp_obj_t madc_read(mp_obj_t self_in) { madc_obj_t *self = self_in; - int val = adc1_get_voltage(self->adc1_id); + int val = adc1_get_raw(self->adc1_id); if (val == -1) mp_raise_ValueError("Parameter Error"); return MP_OBJ_NEW_SMALL_INT(val); } diff --git a/esp32/main.c b/esp32/main.c index 89ff38aa0..748797c7b 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -47,6 +47,7 @@ #include "py/repl.h" #include "py/gc.h" #include "py/mphal.h" +#include "extmod/vfs.h" #include "lib/mp-readline/readline.h" #include "lib/utils/pyexec.h" #include "uart.h" diff --git a/esp32/ugfx_widgets.c b/esp32/ugfx_widgets.c index e2fd76aac..b48756414 100644 --- a/esp32/ugfx_widgets.c +++ b/esp32/ugfx_widgets.c @@ -299,7 +299,7 @@ STATIC mp_obj_t ugfx_button_make_new(const mp_obj_type_t *type, mp_uint_t n_args // TODO where to keep this reference so we can clean it up afterwards? // Perhaps pass our own structure to gwinButtonCreate? GListener* pl = malloc(sizeof(GListener)); - printf("Created GListener at %x\n", pl); + printf("Created GListener at %p\n", pl); geventListenerInit(pl); pl->callback = ugfx_button_gevent_handler; // TODO do we need to copy this value to make sure it doesn't get freed? @@ -443,11 +443,11 @@ STATIC mp_obj_t ugfx_textbox_cursor_pos(mp_uint_t n_args, const mp_obj_t *args) } else { - const int newPos = mp_obj_get_int(args[1]); - printf("Setting cursor position for widget at %p to %d\n", self, newPos); - ((GTexteditObject*)self->ghTextbox)->cursorPos = newPos; - // Should not be needed to do this explicitly right? - gwinTexteditDefaultDraw(self, NULL); + const int newPos = mp_obj_get_int(args[1]); + printf("Setting cursor position for widget at %p to %d\n", self, newPos); + ((GTexteditObject*)self->ghTextbox)->cursorPos = newPos; + // Should not be needed to do this explicitly right? + gwinTexteditDefaultDraw((GWidgetObject *) self->ghTextbox, NULL); return mp_const_none; } } @@ -459,7 +459,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ugfx_textbox_cursor_pos_obj, 1, 2, ug STATIC mp_obj_t ugfx_textbox_backspace(mp_obj_t self_in) { ugfx_textbox_obj_t *self = self_in; - gwinTexteditBackspace(self->ghTextbox); + gwinTexteditBackspace((GWidgetObject *) self->ghTextbox); return mp_const_none; } From 9fac0ca472dd66fee2d7279f01905e575aab9763 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 18 Feb 2018 12:43:16 +0100 Subject: [PATCH 379/403] update esp-idf hash --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index 11d2de0eb..6b31d7aca 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 297018a7780969c04d7783754ee479ef6b6707c1 +ESPIDF_SUPHASH := 4d1fe7d946c64e7dad368a06cb014380083a935d ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) From f8f405765688a9c8baa50f831b85c9cd71d5e7e6 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 18 Feb 2018 21:51:15 +0100 Subject: [PATCH 380/403] Add watchdog methods. esp.wdt_start() esp.wdt_reset() esp.wdt_stop() --- esp32/modesp.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/esp32/modesp.c b/esp32/modesp.c index 9c8f122d8..cae629c82 100644 --- a/esp32/modesp.c +++ b/esp32/modesp.c @@ -49,6 +49,10 @@ #include "sdmmc_cmd.h" #endif +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_task_wdt.h" + /* esp.temperature_sens_read() */ extern int temprature_sens_read(); STATIC mp_obj_t esp_temperature_sens_read() { @@ -64,6 +68,78 @@ STATIC mp_obj_t esp_hall_sens_read() { STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_hall_sens_read_obj, esp_hall_sens_read); +/* esp.wdt_start() */ +STATIC mp_obj_t esp_wdt_start(mp_obj_t timeout) { + // reconfigure watchdog + mp_int_t t = mp_obj_get_int(timeout); + esp_err_t res = esp_task_wdt_init(t, true); + if (res != ESP_OK) { + if (res == ESP_ERR_NO_MEM) + mp_raise_msg(&mp_type_MemoryError, "WDT: Out of memory"); + mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); + } + + // add current task + res = esp_task_wdt_add(NULL); + if (res != ESP_OK) { + if (res == ESP_ERR_INVALID_ARG) + mp_raise_msg(&mp_type_AttributeError, "WDT: Task is already subscribed"); + if (res == ESP_ERR_NO_MEM) + mp_raise_msg(&mp_type_MemoryError, "WDT: Out of memory"); + if (res == ESP_ERR_INVALID_STATE) + mp_raise_msg(&mp_type_AttributeError, "WDT: Not initialized"); + mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_wdt_start_obj, esp_wdt_start); + +/* esp.wdt_stop() */ +STATIC mp_obj_t esp_wdt_stop(void) { + // remove current task + esp_err_t res = esp_task_wdt_delete(NULL); + if (res != ESP_OK) { + if (res == ESP_ERR_INVALID_ARG) + mp_raise_msg(&mp_type_AttributeError, "WDT: Task is already unsubscribed"); + if (res == ESP_ERR_INVALID_STATE) + mp_raise_msg(&mp_type_AttributeError, "WDT: Not initialized"); + mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); + } + + // reconfigure watchdog to startup-state. +#ifdef CONFIG_TASK_WDT_PANIC + res = esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, true); +#elif CONFIG_TASK_WDT + res = esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, false); +#endif + if (res != ESP_OK) { + if (res == ESP_ERR_NO_MEM) + mp_raise_msg(&mp_type_MemoryError, "WDT: Out of memory"); + mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_wdt_stop_obj, esp_wdt_stop); + +/* esp.wdt_reset() */ +STATIC mp_obj_t esp_wdt_reset(void) { + esp_err_t res = esp_task_wdt_reset(); + if (res != ESP_OK) { + if (res == ESP_ERR_NOT_FOUND) + mp_raise_msg(&mp_type_AttributeError, "WDT: Task is not subscribed"); + if (res == ESP_ERR_INVALID_STATE) + mp_raise_msg(&mp_type_AttributeError, "WDT: Not initialized"); + mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_wdt_reset_obj, esp_wdt_reset); + + +/* flash */ STATIC wl_handle_t fs_handle = WL_INVALID_HANDLE; STATIC size_t wl_sect_size = 4096; @@ -379,6 +455,10 @@ STATIC const mp_rom_map_elem_t esp_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_temperature_sens_read), MP_ROM_PTR(&esp_temperature_sens_read_obj) }, { MP_ROM_QSTR(MP_QSTR_hall_sens_read), MP_ROM_PTR(&esp_hall_sens_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_wdt_start), MP_ROM_PTR(&esp_wdt_start_obj) }, + { MP_ROM_QSTR(MP_QSTR_wdt_stop), MP_ROM_PTR(&esp_wdt_stop_obj) }, + { MP_ROM_QSTR(MP_QSTR_wdt_reset), MP_ROM_PTR(&esp_wdt_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_flash_read), MP_ROM_PTR(&esp_flash_read_obj) }, { MP_ROM_QSTR(MP_QSTR_flash_write), MP_ROM_PTR(&esp_flash_write_obj) }, { MP_ROM_QSTR(MP_QSTR_flash_erase), MP_ROM_PTR(&esp_flash_erase_obj) }, From d5909e62d45531604d66b507226fc41274c7ca12 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 18 Feb 2018 21:56:53 +0100 Subject: [PATCH 381/403] fix indentation --- esp32/modesp.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/esp32/modesp.c b/esp32/modesp.c index cae629c82..93656328d 100644 --- a/esp32/modesp.c +++ b/esp32/modesp.c @@ -71,17 +71,17 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_hall_sens_read_obj, esp_hall_sens_read); /* esp.wdt_start() */ STATIC mp_obj_t esp_wdt_start(mp_obj_t timeout) { // reconfigure watchdog - mp_int_t t = mp_obj_get_int(timeout); + mp_int_t t = mp_obj_get_int(timeout); esp_err_t res = esp_task_wdt_init(t, true); - if (res != ESP_OK) { + if (res != ESP_OK) { if (res == ESP_ERR_NO_MEM) mp_raise_msg(&mp_type_MemoryError, "WDT: Out of memory"); mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); - } + } // add current task res = esp_task_wdt_add(NULL); - if (res != ESP_OK) { + if (res != ESP_OK) { if (res == ESP_ERR_INVALID_ARG) mp_raise_msg(&mp_type_AttributeError, "WDT: Task is already subscribed"); if (res == ESP_ERR_NO_MEM) @@ -89,9 +89,9 @@ STATIC mp_obj_t esp_wdt_start(mp_obj_t timeout) { if (res == ESP_ERR_INVALID_STATE) mp_raise_msg(&mp_type_AttributeError, "WDT: Not initialized"); mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); - } + } - return mp_const_none; + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_wdt_start_obj, esp_wdt_start); @@ -99,13 +99,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_wdt_start_obj, esp_wdt_start); STATIC mp_obj_t esp_wdt_stop(void) { // remove current task esp_err_t res = esp_task_wdt_delete(NULL); - if (res != ESP_OK) { + if (res != ESP_OK) { if (res == ESP_ERR_INVALID_ARG) mp_raise_msg(&mp_type_AttributeError, "WDT: Task is already unsubscribed"); if (res == ESP_ERR_INVALID_STATE) mp_raise_msg(&mp_type_AttributeError, "WDT: Not initialized"); mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); - } + } // reconfigure watchdog to startup-state. #ifdef CONFIG_TASK_WDT_PANIC @@ -113,28 +113,28 @@ STATIC mp_obj_t esp_wdt_stop(void) { #elif CONFIG_TASK_WDT res = esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, false); #endif - if (res != ESP_OK) { + if (res != ESP_OK) { if (res == ESP_ERR_NO_MEM) mp_raise_msg(&mp_type_MemoryError, "WDT: Out of memory"); mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); - } + } - return mp_const_none; + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_wdt_stop_obj, esp_wdt_stop); /* esp.wdt_reset() */ STATIC mp_obj_t esp_wdt_reset(void) { esp_err_t res = esp_task_wdt_reset(); - if (res != ESP_OK) { + if (res != ESP_OK) { if (res == ESP_ERR_NOT_FOUND) mp_raise_msg(&mp_type_AttributeError, "WDT: Task is not subscribed"); if (res == ESP_ERR_INVALID_STATE) mp_raise_msg(&mp_type_AttributeError, "WDT: Not initialized"); mp_raise_msg(&mp_type_NotImplementedError, "WDT: Unknown error"); - } + } - return mp_const_none; + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_wdt_reset_obj, esp_wdt_reset); From 491d901355d6edc932f37d1820c28e155d397fcc Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 18 Feb 2018 21:59:03 +0100 Subject: [PATCH 382/403] bump build version --- esp32/modules/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index abda8ad83..8ced83247 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 12 +build = 13 name = "Verraad op de Veluwe" From 202ff973af462ae8fe78011d435f91e92216b6a3 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 25 Feb 2018 20:31:31 +0100 Subject: [PATCH 383/403] Draw ugfx.demo("text") in greyscale. --- esp32/modugfx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esp32/modugfx.c b/esp32/modugfx.c index 8f08c9687..e9efcfb45 100644 --- a/esp32/modugfx.c +++ b/esp32/modugfx.c @@ -894,7 +894,10 @@ STATIC mp_obj_t ugfx_demo(mp_obj_t hacking) { #ifdef UNIX mp_hal_delay_ms(EMU_EINK_SCREEN_DELAY_MS); #endif + uint8_t target_lut_backup = target_lut; + target_lut = 0xff; gdispFlush(); + target_lut = target_lut_backup; return mp_const_none; } From 96617aa5eeb57b106a4bf938da67d34eeeacaf95 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 25 Feb 2018 20:39:39 +0100 Subject: [PATCH 384/403] Move badge.eink_busy_wait() to deepsleep module. You normally never have to call the badge.eink_busy_wait(). (but do call the method right before going to sleep or going into reboot) --- esp32/modules/appglue.py | 1 - esp32/modules/deepsleep.py | 4 +++- esp32/modules/setup.py | 1 - esp32/modules/splash.py | 1 - esp32/modules/tasks/services.py | 2 -- 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/esp32/modules/appglue.py b/esp32/modules/appglue.py index 462a2e0de..0067b42ad 100644 --- a/esp32/modules/appglue.py +++ b/esp32/modules/appglue.py @@ -10,7 +10,6 @@ def start_app(app, display = True): ugfx.string(0, 25, "Returning to homescreen...","Roboto_Regular12",ugfx.BLACK) ugfx.flush(ugfx.LUT_FASTER) esp.rtcmem_write_string(app) - badge.eink_busy_wait() deepsleep.reboot() def home(): diff --git a/esp32/modules/deepsleep.py b/esp32/modules/deepsleep.py index 2eed2379b..eac233e84 100644 --- a/esp32/modules/deepsleep.py +++ b/esp32/modules/deepsleep.py @@ -1,11 +1,13 @@ -import machine +import machine, badge pin = machine.Pin(25) rtc = machine.RTC() rtc.wake_on_ext0(pin = pin, level = 0) def start_sleeping(time=0): + badge.eink_busy_wait() machine.deepsleep(time) def reboot(): + badge.eink_busy_wait() machine.deepsleep(1) diff --git a/esp32/modules/setup.py b/esp32/modules/setup.py index f0e86c740..c1e696de4 100644 --- a/esp32/modules/setup.py +++ b/esp32/modules/setup.py @@ -22,7 +22,6 @@ def asked_nickname(value): badge.nvs_set_u8('badge', 'setup.state', 2) # Skip the sponsors badge.nvs_set_u8('sponsors', 'shown', 1) - badge.eink_busy_wait() appglue.home() ugfx.init() diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 9d8f675b9..2193267ab 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -21,7 +21,6 @@ def draw(mode, goingToSleep=False): if mode: # We flush the buffer and wait ugfx.flush(ugfx.LUT_FULL) - badge.eink_busy_wait() else: # We prepare the screen refresh ugfx.clear(ugfx.WHITE) diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index 0b0ee0b90..5bde858ba 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -159,8 +159,6 @@ def draw_task(): print("[DEBUG] Deleted draw callback: ",dcb) drawCallbacks = list(dcb for dcb in drawCallbacks if dcb!=deleted[i]) - badge.eink_busy_wait() - if requestedInterval<1000: #Draw at most once a second print("[SERVICES] Can't draw more than once a second!") From 12ceb0eaa3ed1bbe52cf1fa395731738a1a03cdb Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 25 Feb 2018 20:44:47 +0100 Subject: [PATCH 385/403] Only draw the screen when not starting any services. --- esp32/modules/splash.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 9d8f675b9..4e3197a74 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -163,16 +163,16 @@ def onSleep(idleTime): if not easywifi.failure(): spoc.show(False) # Check sponsors -if not badge.safe_mode(): +if badge.safe_mode(): + draw(False) + services.force_draw() + draw(True) +else: services.setup(draw) # Start services -draw(False) -services.force_draw() -draw(True) - easywifi.disable() gc.collect() - + virtualtimers.activate(25) pm.callback(onSleep) pm.feed() From 988fc297e1503df15fb8f08da737c5d0ef8ab70e Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 25 Feb 2018 20:49:01 +0100 Subject: [PATCH 386/403] Draw splash in greyscale. --- esp32/modules/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 9d8f675b9..fec3ddc26 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -20,7 +20,7 @@ def draw(mode, goingToSleep=False): if mode: # We flush the buffer and wait - ugfx.flush(ugfx.LUT_FULL) + ugfx.flush(ugfx.GREYSCALE) badge.eink_busy_wait() else: # We prepare the screen refresh From 55071eb69a32fef760d4d6ffc3193539f53f67dc Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 3 Mar 2018 10:49:24 +0100 Subject: [PATCH 387/403] The other returns just return False and True; return False here. --- esp32/modules/tasks/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/tasks/services.py b/esp32/modules/tasks/services.py index 0b0ee0b90..574bd39f7 100644 --- a/esp32/modules/tasks/services.py +++ b/esp32/modules/tasks/services.py @@ -27,7 +27,7 @@ def setup(drawCb=None): try: apps = uos.listdir('lib') except OSError: - return [False, False] + return False #For each app... for app in apps: From a8cac5cdd361095e15bdac78d7fa14269ed03f84 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 3 Mar 2018 10:50:38 +0100 Subject: [PATCH 388/403] Redraw the screen when no redraw is scheduled --- esp32/modules/splash.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esp32/modules/splash.py b/esp32/modules/splash.py index 4e3197a74..92002a6e8 100644 --- a/esp32/modules/splash.py +++ b/esp32/modules/splash.py @@ -168,7 +168,11 @@ def onSleep(idleTime): services.force_draw() draw(True) else: - services.setup(draw) # Start services + have_services = services.setup(draw) # Start services + if not have_services: + draw(False) + services.force_draw() + draw(True) easywifi.disable() gc.collect() From 71d39965f9019555de1bee375be3322523927e51 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 11 Mar 2018 14:08:47 +0100 Subject: [PATCH 389/403] bump build version --- esp32/modules/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 8ced83247..0e02566dd 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 13 +build = 14 name = "Verraad op de Veluwe" From bdffd5294564d7725bdcc0ed5649eab48b544f9d Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 24 Jun 2018 16:19:54 +0200 Subject: [PATCH 390/403] update esp-idf hash --- esp32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/Makefile b/esp32/Makefile index 6b31d7aca..1eece2693 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py # verify the ESP IDF version -ESPIDF_SUPHASH := 4d1fe7d946c64e7dad368a06cb014380083a935d +ESPIDF_SUPHASH := b13a2187db5580756265a067c1b9192afc489c5f ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) $(info ** WARNING **) From d5f9735291530b06d05a530aedc4cb434bc49157 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 28 Jul 2018 20:13:20 +0200 Subject: [PATCH 391/403] remove esp-idf git commit hash check --- esp32/Makefile | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index 1eece2693..eb5c17ce0 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -37,18 +37,6 @@ ESPIDF = $(IDF_PATH) ESPCOMP = $(ESPIDF)/components ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py -# verify the ESP IDF version -ESPIDF_SUPHASH := b13a2187db5580756265a067c1b9192afc489c5f -ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H') -ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH)) -$(info ** WARNING **) -$(info The git hash of ESP IDF does not match the supported version) -$(info The build may complete and the firmware may work but it is not guaranteed) -$(info ESP IDF path: $(ESPIDF)) -$(info Current git hash: $(ESPIDF_CURHASH)) -$(info Supported git hash: $(ESPIDF_SUPHASH)) -endif - # pretty format of ESP IDF version, used internally by the IDF IDF_VER := $(shell git -C $(ESPIDF) describe) @@ -738,10 +726,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(BADGE_COMPONENTS_O)) all: $(BUILD)/firmware.bin -.PHONY: idf-version deploy erase - -idf-version: - $(ECHO) "ESP IDF supported hash: $(ESPIDF_SUPHASH)" +.PHONY: deploy erase $(BUILD)/firmware.bin: $(BUILD)/bootloader.bin $(BUILD)/partitions.bin $(BUILD)/application.bin $(ECHO) "Create $@" From 2efb958480359448c98f6e1be1656e06f2761edc Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 28 Jul 2018 20:14:18 +0200 Subject: [PATCH 392/403] do a greyscale refresh once on startup. --- esp32/modules/launcher.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/esp32/modules/launcher.py b/esp32/modules/launcher.py index 547c405e7..2c03692fa 100644 --- a/esp32/modules/launcher.py +++ b/esp32/modules/launcher.py @@ -161,10 +161,7 @@ def init_power_management(): def start(): ugfx.input_init() ugfx.set_lut(ugfx.LUT_FASTER) - ugfx.clear(ugfx.BLACK) - ugfx.flush() ugfx.clear(ugfx.WHITE) - ugfx.flush() if badge.safe_mode(): still = "SAFE" @@ -213,7 +210,8 @@ def start(): populate_category() populate_options() - ugfx.flush(ugfx.LUT_FULL) + # do a greyscale flush on start + ugfx.flush(ugfx.GREYSCALE) start() init_power_management() From c607a699b50c634bb23e303e464c29fd52ff73ec Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 28 Jul 2018 20:19:47 +0200 Subject: [PATCH 393/403] update version --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 0e02566dd..3c7fc180c 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 14 -name = "Verraad op de Veluwe" +build = 15 +name = "De Vergeten Vallei (rc1)" From 2732fd349eb55e23effd3b3ea5f0124499a172c8 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Tue, 31 Jul 2018 22:24:38 +0200 Subject: [PATCH 394/403] enable ugfx.get_pixel(x,y) method --- esp32/modugfx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/esp32/modugfx.c b/esp32/modugfx.c index e9efcfb45..3eea6fd1c 100644 --- a/esp32/modugfx.c +++ b/esp32/modugfx.c @@ -190,12 +190,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(ugfx_height_obj, ugfx_height); /// STATIC mp_obj_t ugfx_get_pixel(mp_obj_t x_in, mp_obj_t y_in) { // extract arguments - //ugfx_obj_t *self = args[0]; - //int x = mp_obj_get_int(x_in); - //int y = mp_obj_get_int(y_in); - return mp_obj_new_int(0); - //needs sorting, currently returns somewhat dodgy values - //return mp_obj_new_int(gdispGetPixelColor(x,y)); + int x = mp_obj_get_int(x_in); + int y = mp_obj_get_int(y_in); + + return mp_obj_new_int(gdispGetPixelColor(x,y)); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(ugfx_get_pixel_obj, ugfx_get_pixel); @@ -1136,6 +1134,7 @@ STATIC const mp_rom_map_elem_t ugfx_module_globals_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_text), (mp_obj_t)&ugfx_text_obj }, {MP_OBJ_NEW_QSTR(MP_QSTR_string_box), (mp_obj_t)&ugfx_string_box_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_get_pixel), (mp_obj_t)&ugfx_get_pixel_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_pixel), (mp_obj_t)&ugfx_pixel_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_line), (mp_obj_t)&ugfx_line_obj}, {MP_OBJ_NEW_QSTR(MP_QSTR_box), (mp_obj_t)&ugfx_box_obj}, From 2799ff0797a6c728a5f2d65187b46a3b92f2fe61 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Tue, 31 Jul 2018 22:27:34 +0200 Subject: [PATCH 395/403] increment version id --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 3c7fc180c..317265df4 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 15 -name = "De Vergeten Vallei (rc1)" +build = 16 +name = "De Vergeten Vallei (rc2)" From c283f15404e3963cc6d8dd1978e00198f8c8e6fd Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Thu, 2 Aug 2018 20:45:39 +0200 Subject: [PATCH 396/403] fix ugfx unix emulator --- unix/gfxconf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/gfxconf.h b/unix/gfxconf.h index b0add4701..ea5334f37 100644 --- a/unix/gfxconf.h +++ b/unix/gfxconf.h @@ -87,7 +87,7 @@ //#define GDISP_NEED_ARCSECTORS FALSE #define GDISP_NEED_CONVEX_POLYGON TRUE //#define GDISP_NEED_SCROLL FALSE -//#define GDISP_NEED_PIXELREAD FALSE +#define GDISP_NEED_PIXELREAD TRUE #define GDISP_NEED_CONTROL TRUE //#define GDISP_NEED_QUERY FALSE //#define GDISP_NEED_MULTITHREAD FALSE @@ -97,7 +97,7 @@ #define GDISP_NEED_TEXT_WORDWRAP TRUE // #define GDISP_NEED_TEXT_BOXPADLR 1 // #define GDISP_NEED_TEXT_BOXPADTB 1 -// #define GDISP_NEED_ANTIALIAS FALSE +#define GDISP_NEED_ANTIALIAS TRUE #define GDISP_NEED_UTF8 TRUE // #define GDISP_NEED_TEXT_KERNING FALSE // #define GDISP_INCLUDE_FONT_UI1 FALSE From 5dbf3e7e6af454fc0a26ff2a281718c4b353d49a Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 19 Aug 2018 14:19:43 +0200 Subject: [PATCH 397/403] bump version; 'build 17: De Vergeten Vallei' --- esp32/modules/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/modules/version.py b/esp32/modules/version.py index 317265df4..14f80863c 100644 --- a/esp32/modules/version.py +++ b/esp32/modules/version.py @@ -1,2 +1,2 @@ -build = 16 -name = "De Vergeten Vallei (rc2)" +build = 17 +name = "De Vergeten Vallei" From 68c5e4cf1dd4309580c9de418628f0cf4ee88b8e Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sun, 20 Jan 2019 21:36:57 +0100 Subject: [PATCH 398/403] Add support for esp-idf v3.1 framework. --- esp32/Makefile | 174 ++++++++++++++++++++--------------- esp32/esp32.custom_common.ld | 52 +++++++++-- esp32/modnetwork.c | 6 +- 3 files changed, 147 insertions(+), 85 deletions(-) diff --git a/esp32/Makefile b/esp32/Makefile index eb5c17ce0..e018ef3c1 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -68,6 +68,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/nghttp/port/include INC_ESPCOMP += -I$(ESPCOMP)/nghttp/nghttp2/lib/includes INC_ESPCOMP += -I$(ESPCOMP)/esp32/include INC_ESPCOMP += -I$(ESPCOMP)/soc/esp32/include +INC_ESPCOMP += -I$(ESPCOMP)/smartconfig_ack/include INC_ESPCOMP += -I$(ESPCOMP)/ethernet/include INC_ESPCOMP += -I$(ESPCOMP)/expat/include/expat INC_ESPCOMP += -I$(ESPCOMP)/expat/port/include @@ -81,7 +82,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/tcpip_adapter/include INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/port INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/posix -INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/include +INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/mbedtls/include INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/port/include INC_ESPCOMP += -I$(ESPCOMP)/spi_flash/include INC_ESPCOMP += -I$(ESPCOMP)/wear_levelling/include @@ -100,6 +101,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/sdmmc/include INC_ESPCOMP += -I$(ESPCOMP)/heap/include INC_ESPCOMP += -I$(ESPCOMP)/soc/include INC_ESPCOMP += -I$(ESPCOMP)/fatfs/src +INC_ESPCOMP += -I$(ESPCOMP)/pthread/include CFLAGS_BASE = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM CFLAGS = $(CFLAGS_BASE) $(INC) $(INC_ESPCOMP) @@ -216,8 +218,8 @@ endif ifeq ($(MICROPY_NATIVEFS), 1) LIB_SRC_C += \ $(ESPCOMP)/fatfs/src/ff.c \ + $(ESPCOMP)/fatfs/src/diskio_wl.c \ $(ESPCOMP)/fatfs/src/diskio_sdmmc.c \ - $(ESPCOMP)/fatfs/src/diskio_spiflash.c \ $(ESPCOMP)/fatfs/src/diskio.c \ $(ESPCOMP)/fatfs/src/vfs_fat_sdmmc.c \ $(ESPCOMP)/fatfs/src/vfs_fat_spiflash.c \ @@ -259,6 +261,7 @@ ESPIDF_DRIVER_O = $(addprefix $(ESPCOMP)/driver/,\ sdmmc_host.o \ sdmmc_transaction.o \ sdspi_host.o \ + i2s.o \ ) $(BUILD)/$(ESPCOMP)/esp32/dport_access.o: CFLAGS += -Wno-array-bounds @@ -287,11 +290,13 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\ brownout.o \ fast_crypto_ops.o \ wifi_init.o \ - wifi_internal.o \ + wifi_os_adapter.o \ sleep_modes.o \ esp_timer.o \ esp_timer_esp32.o \ ets_timer_legacy.o \ + esp_err_to_name.o \ + dbg_stubs.o \ ) ESPIDF_PTHREAD_O = $(addprefix $(ESPCOMP)/pthread/,\ @@ -312,6 +317,9 @@ ESPIDF_SOC_O = $(addprefix $(ESPCOMP)/soc/,\ esp32/rtc_pm.o \ esp32/rtc_sleep.o \ esp32/rtc_time.o \ + esp32/rtc_periph.o \ + esp32/spi_periph.o \ + esp32/gpio_periph.o \ esp32/soc_memory_layout.o \ ) @@ -324,6 +332,10 @@ ESPIDF_ETHERNET_O = $(addprefix $(ESPCOMP)/ethernet/,\ emac_main.o \ ) +ESPIDF_SMARTCONFIG_ACK_O = $(addprefix $(ESPCOMP)/smartconfig_ack/,\ + smartconfig_ack.o \ + ) + ESPIDF_APP_TRACE_O = $(addprefix $(ESPCOMP)/app_trace/,\ app_trace.o \ ) @@ -334,6 +346,8 @@ ESPIDF_APP_UPDATE_O = $(addprefix $(ESPCOMP)/app_update/,\ ESPIDF_BOOTLOADER_O = $(addprefix $(ESPCOMP)/bootloader_support/src/,\ esp_image_format.o \ + bootloader_init.o \ + bootloader_utility.o \ bootloader_sha.o \ bootloader_flash.o \ ) @@ -410,6 +424,7 @@ ESPIDF_APP_TRACE_O = $(addprefix $(ESPCOMP)/app_trace/,\ ESPIDF_NEWLIB_O = $(addprefix $(ESPCOMP)/newlib/,\ time.o \ + select.o \ syscalls.o \ syscall_table.o \ reent_init.o \ @@ -443,6 +458,7 @@ ESPIDF_NGHTTP_O = $(addprefix $(ESPCOMP)/nghttp/,\ ESPIDF_NVS_FLASH_O = $(addprefix $(ESPCOMP)/nvs_flash/,\ src/nvs_types.o \ + src/nvs_ops.o \ src/nvs_page.o \ src/nvs_item_hash_list.o \ src/nvs_pagemanager.o \ @@ -531,75 +547,77 @@ ESPIDF_LWIP_O = $(addprefix $(ESPCOMP)/lwip/,\ ) ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\ - library/entropy.o \ - library/pkcs12.o \ - library/ccm.o \ - library/pk.o \ - library/sha1.o \ - library/x509_csr.o \ - library/ssl_cli.o \ - library/ecp.o \ - library/blowfish.o \ - library/x509.o \ - library/ecp_curves.o \ - library/error.o \ - library/ssl_ticket.o \ - library/entropy_poll.o \ - library/cipher.o \ - library/version_features.o \ - library/ripemd160.o \ - library/rsa.o \ - library/md.o \ - library/md_wrap.o \ - library/sha256.o \ - library/dhm.o \ - library/ssl_cache.o \ - library/pkwrite.o \ - library/base64.o \ - library/asn1parse.o \ - library/ssl_tls.o \ - library/hmac_drbg.o \ - library/pem.o \ - library/version.o \ - library/gcm.o \ - library/memory_buffer_alloc.o \ - library/md2.o \ - library/ecdsa.o \ - library/ssl_srv.o \ - library/x509_crt.o \ - library/ecdh.o \ - library/asn1write.o \ - library/md4.o \ - library/debug.o \ - library/x509_create.o \ - library/ecjpake.o \ - library/oid.o \ - library/md5.o \ - library/ssl_ciphersuites.o \ - library/sha512.o \ - library/xtea.o \ - library/aes.o \ - library/cipher_wrap.o \ - library/arc4.o \ - library/bignum.o \ - library/pkparse.o \ - library/padlock.o \ - library/threading.o \ - library/x509_crl.o \ - library/pkcs11.o \ - library/aesni.o \ - library/timing.o \ - library/certs.o \ - library/pkcs5.o \ - library/ssl_cookie.o \ - library/camellia.o \ - library/havege.o \ - library/des.o \ - library/x509write_csr.o \ - library/platform.o \ - library/ctr_drbg.o \ - library/x509write_crt.o \ - library/pk_wrap.o \ + mbedtls/library/entropy.o \ + mbedtls/library/pkcs12.o \ + mbedtls/library/ccm.o \ + mbedtls/library/pk.o \ + mbedtls/library/sha1.o \ + mbedtls/library/x509_csr.o \ + mbedtls/library/ssl_cli.o \ + mbedtls/library/ecp.o \ + mbedtls/library/blowfish.o \ + mbedtls/library/x509.o \ + mbedtls/library/ecp_curves.o \ + mbedtls/library/error.o \ + mbedtls/library/ssl_ticket.o \ + mbedtls/library/entropy_poll.o \ + mbedtls/library/cipher.o \ + mbedtls/library/version_features.o \ + mbedtls/library/ripemd160.o \ + mbedtls/library/rsa.o \ + mbedtls/library/rsa_internal.o \ + mbedtls/library/md.o \ + mbedtls/library/md_wrap.o \ + mbedtls/library/sha256.o \ + mbedtls/library/dhm.o \ + mbedtls/library/ssl_cache.o \ + mbedtls/library/pkwrite.o \ + mbedtls/library/base64.o \ + mbedtls/library/asn1parse.o \ + mbedtls/library/ssl_tls.o \ + mbedtls/library/hmac_drbg.o \ + mbedtls/library/pem.o \ + mbedtls/library/version.o \ + mbedtls/library/gcm.o \ + mbedtls/library/memory_buffer_alloc.o \ + mbedtls/library/md2.o \ + mbedtls/library/ecdsa.o \ + mbedtls/library/ssl_srv.o \ + mbedtls/library/x509_crt.o \ + mbedtls/library/ecdh.o \ + mbedtls/library/asn1write.o \ + mbedtls/library/md4.o \ + mbedtls/library/debug.o \ + mbedtls/library/x509_create.o \ + mbedtls/library/ecjpake.o \ + mbedtls/library/oid.o \ + mbedtls/library/md5.o \ + mbedtls/library/ssl_ciphersuites.o \ + mbedtls/library/sha512.o \ + mbedtls/library/xtea.o \ + mbedtls/library/aes.o \ + mbedtls/library/cipher_wrap.o \ + mbedtls/library/arc4.o \ + mbedtls/library/bignum.o \ + mbedtls/library/pkparse.o \ + mbedtls/library/padlock.o \ + mbedtls/library/threading.o \ + mbedtls/library/x509_crl.o \ + mbedtls/library/pkcs11.o \ + mbedtls/library/aesni.o \ + mbedtls/library/timing.o \ + mbedtls/library/certs.o \ + mbedtls/library/pkcs5.o \ + mbedtls/library/ssl_cookie.o \ + mbedtls/library/camellia.o \ + mbedtls/library/havege.o \ + mbedtls/library/des.o \ + mbedtls/library/x509write_csr.o \ + mbedtls/library/platform.o \ + mbedtls/library/platform_util.o \ + mbedtls/library/ctr_drbg.o \ + mbedtls/library/x509write_crt.o \ + mbedtls/library/pk_wrap.o \ port/net_sockets.o \ port/esp_bignum.o \ port/esp_hardware.o \ @@ -608,7 +626,7 @@ ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\ port/esp_sha512.o \ ) -$(BUILD)/$(ESPCOMP)/wpa_supplicant/%.o: CFLAGS += -DEMBEDDED_SUPP -D__ets__ -Wno-strict-aliasing +$(BUILD)/$(ESPCOMP)/wpa_supplicant/%.o: CFLAGS += -DESPRESSIF_USE -DEMBEDDED_SUPP -D__ets__ -Wno-strict-aliasing ESPIDF_WPA_SUPPLICANT_O = $(addprefix $(ESPCOMP)/wpa_supplicant/,\ src/crypto/aes-internal-enc.o \ src/crypto/sha256-internal.o \ @@ -647,6 +665,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SOC_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_CXX_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_ETHERNET_O)) +OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SMARTCONFIG_ACK_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_APP_TRACE_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_EXPAT_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_FREERTOS_O)) @@ -760,7 +779,7 @@ APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a APP_LD_ARGS += $(BADGE_LIBS) -APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist +APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lmesh -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist APP_LD_ARGS += $(OBJ) APP_LD_ARGS += --end-group @@ -801,16 +820,22 @@ BOOTLOADER_OBJ = $(addprefix $(BUILD)/bootloader/$(ESPCOMP)/,\ bootloader_support/src/bootloader_sha.o \ bootloader_support/src/bootloader_random.o \ bootloader_support/src/bootloader_clock.o \ + bootloader_support/src/bootloader_init.o \ + bootloader_support/src/bootloader_utility.o \ + bootloader_support/src/bootloader_common.o \ bootloader_support/src/secure_boot_signatures.o \ bootloader_support/src/secure_boot.o \ bootloader_support/src/esp_image_format.o \ bootloader_support/src/flash_encrypt.o \ bootloader_support/src/flash_partitions.o \ + bootloader_support/src/flash_qio_mode.o \ log/log.o \ spi_flash/spi_flash_rom_patch.o \ + soc/esp32/cpu_util.o \ soc/esp32/rtc_clk.o \ soc/esp32/rtc_time.o \ soc/esp32/rtc_init.o \ + soc/esp32/rtc_periph.o \ micro-ecc/micro-ecc/uECC.o \ bootloader/subproject/main/bootloader_start.o \ ) @@ -835,6 +860,7 @@ BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader. BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.rom.ld BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.ld BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.spiram_incompatible_fns.ld +BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.peripherals.ld BOOTLOADER_OBJ_DIRS = $(sort $(dir $(BOOTLOADER_OBJ))) $(BOOTLOADER_OBJ): | $(BOOTLOADER_OBJ_DIRS) diff --git a/esp32/esp32.custom_common.ld b/esp32/esp32.custom_common.ld index 5e5f864d7..d56dd3e7d 100644 --- a/esp32/esp32.custom_common.ld +++ b/esp32/esp32.custom_common.ld @@ -10,8 +10,8 @@ SECTIONS { . = ALIGN(4); *(.rtc.literal .rtc.text) - *rtc_wake_stub*.o(.literal .text .literal.* .text.*) - } >rtc_iram_seg + *rtc_wake_stub*.*(.literal .text .literal.* .text.*) + } > rtc_iram_seg /* RTC slow memory holds RTC wake stub data/rodata, including from any source file @@ -22,7 +22,7 @@ SECTIONS _rtc_data_start = ABSOLUTE(.); *(.rtc.data) *(.rtc.rodata) - *rtc_wake_stub*.o(.data .rodata .data.* .rodata.* .bss .bss.*) + *rtc_wake_stub*.*(.data .rodata .data.* .rodata.* .bss .bss.*) _rtc_data_end = ABSOLUTE(.); } > rtc_slow_seg @@ -30,11 +30,25 @@ SECTIONS .rtc.bss (NOLOAD) : { _rtc_bss_start = ABSOLUTE(.); - *rtc_wake_stub*.o(.bss .bss.*) - *rtc_wake_stub*.o(COMMON) + *rtc_wake_stub*.*(.bss .bss.*) + *rtc_wake_stub*.*(COMMON) _rtc_bss_end = ABSOLUTE(.); } > rtc_slow_seg + /* This section holds data that should not be initialized at power up + and will be retained during deep sleep. The section located in + RTC SLOW Memory area. User data marked with RTC_NOINIT_ATTR will be placed + into this section. See the file "esp_attr.h" for more information. + */ + .rtc_noinit (NOLOAD): + { + . = ALIGN(4); + _rtc_noinit_start = ABSOLUTE(.); + *(.rtc_noinit .rtc_noinit.*) + . = ALIGN(4) ; + _rtc_noinit_end = ABSOLUTE(.); + } > rtc_slow_seg + /* Send .iram0 code to iram */ .iram0.vectors : { @@ -100,7 +114,7 @@ SECTIONS INCLUDE esp32.spiram.rom-functions-iram.ld _iram_text_end = ABSOLUTE(.); } > iram0_0_seg - + .dram0.data : { _data_start = ABSOLUTE(.); @@ -125,7 +139,21 @@ SECTIONS INCLUDE esp32.spiram.rom-functions-dram.ld _data_end = ABSOLUTE(.); . = ALIGN(4); - } >dram0_0_seg + } > dram0_0_seg + + /*This section holds data that should not be initialized at power up. + The section located in Internal SRAM memory region. The macro _NOINIT + can be used as attribute to place data into this section. + See the esp_attr.h file for more information. + */ + .noinit (NOLOAD): + { + . = ALIGN(4); + _noinit_start = ABSOLUTE(.); + *(.noinit .noinit.*) + . = ALIGN(4) ; + _noinit_end = ABSOLUTE(.); + } > dram0_0_seg /* Shared RAM */ .dram0.bss (NOLOAD) : @@ -148,8 +176,9 @@ SECTIONS *(COMMON) . = ALIGN (8); _bss_end = ABSOLUTE(.); + /* The heap starts right after end of this section */ _heap_start = ABSOLUTE(.); - } >dram0_0_seg + } > dram0_0_seg .flash.rodata : { @@ -195,6 +224,13 @@ SECTIONS *(.gnu.linkonce.lit4.*) _lit4_end = ABSOLUTE(.); . = ALIGN(4); + _thread_local_start = ABSOLUTE(.); + *(.tdata) + *(.tdata.*) + *(.tbss) + *(.tbss.*) + _thread_local_end = ABSOLUTE(.); + . = ALIGN(4); } >drom0_0_seg .flash.text : diff --git a/esp32/modnetwork.c b/esp32/modnetwork.c index 21e29193a..88407d6b7 100644 --- a/esp32/modnetwork.c +++ b/esp32/modnetwork.c @@ -60,13 +60,13 @@ NORETURN void _esp_exceptions(esp_err_t e) { mp_raise_msg(&mp_type_OSError, "Wifi Internal Error"); case ESP_ERR_WIFI_SSID: mp_raise_msg(&mp_type_OSError, "Wifi SSID Invalid"); - case ESP_ERR_WIFI_FAIL: + case ESP_FAIL: mp_raise_msg(&mp_type_OSError, "Wifi Internal Failure"); case ESP_ERR_WIFI_IF: mp_raise_msg(&mp_type_OSError, "Wifi Invalid Interface"); case ESP_ERR_WIFI_MAC: mp_raise_msg(&mp_type_OSError, "Wifi Invalid MAC Address"); - case ESP_ERR_WIFI_ARG: + case ESP_ERR_INVALID_ARG: mp_raise_msg(&mp_type_OSError, "Wifi Invalid Argument"); case ESP_ERR_WIFI_MODE: mp_raise_msg(&mp_type_OSError, "Wifi Invalid Mode"); @@ -83,7 +83,7 @@ NORETURN void _esp_exceptions(esp_err_t e) { case ESP_ERR_WIFI_TIMEOUT: mp_raise_OSError(MP_ETIMEDOUT); case ESP_ERR_TCPIP_ADAPTER_NO_MEM: - case ESP_ERR_WIFI_NO_MEM: + case ESP_ERR_NO_MEM: mp_raise_OSError(MP_ENOMEM); default: nlr_raise(mp_obj_new_exception_msg_varg( From aa23cc37a4058a4b9c58c4bd36d82af164046223 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 30 Jan 2019 00:18:34 +0100 Subject: [PATCH 399/403] add esp-adf objects --- esp32/Makefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/esp32/Makefile b/esp32/Makefile index e018ef3c1..a60f43ad6 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -55,6 +55,17 @@ INC += -I../../components/ed25519/include INC += -I../../components/redundancy INC += -I../../components/badge-first-run INC += -I../../components/png +INC += -I../../components/audio_pipeline/include +INC += -I../../components/audio_hal/board +INC += -I../../components/audio_sal/include +INC += -I../../components/audio_stream/include +INC += -I../../components/esp_http_client/include +INC += -I../../components/esp_http_client/lib/include +INC += -I../../components/esp_peripherals/include +INC += -I../../components/esp_peripherals/lib/blufi +INC += -I../../components/tcp_transport/include +INC += -I../../components/esp-adf-libs/esp_codec/include/codec +INC += -I../../components/esp-tls INC += -I../../main INC += -I../../ugfx/src/gdisp/mcufont INC += -I../../ugfx @@ -656,6 +667,27 @@ ESPIDF_WPA_SUPPLICANT_O = $(addprefix $(ESPCOMP)/wpa_supplicant/,\ port/os_xtensa.o \ ) +ESPADF_O = $(addprefix $(PROJECT_PATH)/components/,\ + audio_pipeline/audio_pipeline.o \ + audio_pipeline/audio_element.o \ + audio_pipeline/audio_event_iface.o \ + audio_pipeline/ringbuf.o \ + audio_sal/audio_mem.o \ + audio_stream/http_stream.o \ + audio_stream/i2s_stream.o \ + esp_http_client/esp_http_client.o \ + esp_http_client/lib/http_header.o \ + esp_http_client/lib/http_auth.o \ + esp_http_client/lib/http_utils.o \ + tcp_transport/transport.o \ + tcp_transport/transport_ssl.o \ + tcp_transport/transport_tcp.o \ + tcp_transport/transport_utils.o \ + esp-tls/esp_tls.o \ + esp_peripherals/periph_wifi.o \ + esp_peripherals/esp_peripherals.o \ + ) + OBJ_ESPIDF = OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_NEWLIB_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_DRIVER_O)) @@ -686,6 +718,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_WPA_SUPPLICANT_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_APP_UPDATE_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_BOOTLOADER_O)) OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SDMMC_O)) +OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPADF_O)) #################### # Badge magic @@ -778,6 +811,7 @@ APP_LD_ARGS += -lgcov APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a +APP_LD_ARGS += $(PROJECT_PATH)/components/esp-adf-libs/esp_codec/lib/libesp_codec.a APP_LD_ARGS += $(BADGE_LIBS) APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lmesh -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist APP_LD_ARGS += $(OBJ) From 2fb00546948d3a978b7f5e2ee0c699e5ed0709a3 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Wed, 30 Jan 2019 00:19:11 +0100 Subject: [PATCH 400/403] add badge.test_audio() --- esp32/modbadge.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index fb1fce4e5..91733ad7f 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -214,6 +214,131 @@ STATIC mp_obj_t badge_nvs_set_u16_(mp_obj_t _namespace, mp_obj_t _key, mp_obj_t STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); +// audio +#define IIS_SCLK 33 +#define IIS_LCLK 12 +#define IIS_DSIN 4 +#define IIS_DOUT -1 + +#include "esp_log.h" +#include "audio_element.h" +#include "audio_pipeline.h" +#include "audio_event_iface.h" +#include "audio_common.h" +#include "http_stream.h" +#include "i2s_stream.h" +#include "mp3_decoder.h" +#include "esp_peripherals.h" +#include "periph_wifi.h" +#include "badge_power.h" +void +do_audio(void) { + tcpip_adapter_init(); + + audio_pipeline_handle_t pipeline; + audio_element_handle_t http_stream_reader, i2s_stream_writer, mp3_decoder; + +// esp_log_level_set("*", ESP_LOG_WARN); +// esp_log_level_set(TAG, ESP_LOG_DEBUG); + + ESP_LOGI(TAG, "[ 1 ] Start audio codec chip"); + badge_power_sdcard_enable(); +// audio_hal_codec_config_t audio_hal_codec_cfg = AUDIO_HAL_ES8388_DEFAULT(); +// audio_hal_handle_t hal = audio_hal_init(&audio_hal_codec_cfg, 0); +// audio_hal_ctrl_codec(hal, AUDIO_HAL_CODEC_MODE_DECODE, AUDIO_HAL_CTRL_START); + + ESP_LOGI(TAG, "[2.0] Create audio pipeline for playback"); + audio_pipeline_cfg_t pipeline_cfg = DEFAULT_AUDIO_PIPELINE_CONFIG(); + pipeline = audio_pipeline_init(&pipeline_cfg); + mem_assert(pipeline); + + ESP_LOGI(TAG, "[2.1] Create http stream to read data"); + http_stream_cfg_t http_cfg = HTTP_STREAM_CFG_DEFAULT(); + http_stream_reader = http_stream_init(&http_cfg); + + ESP_LOGI(TAG, "[2.2] Create i2s stream to write data to codec chip"); + i2s_stream_cfg_t i2s_cfg = I2S_STREAM_CFG_DEFAULT(); + i2s_cfg.type = AUDIO_STREAM_WRITER; + i2s_stream_writer = i2s_stream_init(&i2s_cfg); + + ESP_LOGI(TAG, "[2.3] Create mp3 decoder to decode mp3 file"); + mp3_decoder_cfg_t mp3_cfg = DEFAULT_MP3_DECODER_CONFIG(); + mp3_decoder = mp3_decoder_init(&mp3_cfg); + + ESP_LOGI(TAG, "[2.4] Register all elements to audio pipeline"); + audio_pipeline_register(pipeline, http_stream_reader, "http"); + audio_pipeline_register(pipeline, mp3_decoder, "mp3"); + audio_pipeline_register(pipeline, i2s_stream_writer, "i2s"); + + ESP_LOGI(TAG, "[2.5] Link it together http_stream-->mp3_decoder-->i2s_stream-->[codec_chip]"); + audio_pipeline_link(pipeline, (const char *[]) {"http", "mp3", "i2s"}, 3); + + ESP_LOGI(TAG, "[2.6] Setup uri (http as http_stream, mp3 as mp3 decoder, and default output is i2s)"); + audio_element_set_uri(http_stream_reader, "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp3"); + + ESP_LOGI(TAG, "[ 3 ] Start and wait for Wi-Fi network"); + esp_periph_config_t periph_cfg = { 0 }; + esp_periph_init(&periph_cfg); + periph_wifi_cfg_t wifi_cfg = { + .ssid = CONFIG_WIFI_SSID, + .password = CONFIG_WIFI_PASSWORD, + }; + esp_periph_handle_t wifi_handle = periph_wifi_init(&wifi_cfg); + esp_periph_start(wifi_handle); + periph_wifi_wait_for_connected(wifi_handle, portMAX_DELAY); + + ESP_LOGI(TAG, "[ 4 ] Setup event listener"); + audio_event_iface_cfg_t evt_cfg = AUDIO_EVENT_IFACE_DEFAULT_CFG(); + audio_event_iface_handle_t evt = audio_event_iface_init(&evt_cfg); + + ESP_LOGI(TAG, "[4.1] Listening event from all elements of pipeline"); + audio_pipeline_set_listener(pipeline, evt); + + ESP_LOGI(TAG, "[4.2] Listening event from peripherals"); + audio_event_iface_set_listener(esp_periph_get_event_iface(), evt); + + ESP_LOGI(TAG, "[ 5 ] Start audio_pipeline"); + audio_pipeline_run(pipeline); + + while (1) { + audio_event_iface_msg_t msg; + esp_err_t ret = audio_event_iface_listen(evt, &msg, portMAX_DELAY); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "[ * ] Event interface error : %d", ret); + continue; + } + + if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT + && msg.source == (void *) mp3_decoder + && msg.cmd == AEL_MSG_CMD_REPORT_MUSIC_INFO) { + audio_element_info_t music_info = {0}; + audio_element_getinfo(mp3_decoder, &music_info); + + ESP_LOGI(TAG, "[ * ] Receive music info from mp3 decoder, sample_rates=%d, bits=%d, ch=%d", + music_info.sample_rates, music_info.bits, music_info.channels); + + audio_element_setinfo(i2s_stream_writer, &music_info); + i2s_stream_set_clk(i2s_stream_writer, music_info.sample_rates, music_info.bits, music_info.channels); + continue; + } + + /* Stop when the last pipeline element (i2s_stream_writer in this case) receives stop event */ + if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT && msg.source == (void *) i2s_stream_writer + && msg.cmd == AEL_MSG_CMD_REPORT_STATUS && (int) msg.data == AEL_STATUS_STATE_STOPPED) { + ESP_LOGW(TAG, "[ * ] Stop event received"); + break; + } + } + + ESP_LOGI(TAG, "[ 6 ] Stop audio_pipeline"); + audio_pipeline_terminate(pipeline); +} +STATIC mp_obj_t badge_test_audio() { + do_audio(); + return mp_obj_new_int(0); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_test_audio_obj, badge_test_audio); + // I2C (badge_i2c.h) STATIC mp_obj_t badge_i2c_read_reg_(mp_obj_t _addr, mp_obj_t _reg, mp_obj_t _len) { int addr = mp_obj_get_int(_addr); @@ -765,6 +890,9 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_i2c_read_reg), MP_ROM_PTR(&badge_i2c_read_reg_obj)}, {MP_ROM_QSTR(MP_QSTR_i2c_write_reg), MP_ROM_PTR(&badge_i2c_write_reg_obj)}, + // audio + {MP_OBJ_NEW_QSTR(MP_QSTR_test_audio), (mp_obj_t)&badge_test_audio_obj}, + // Mpr121 #ifdef I2C_MPR121_ADDR {MP_ROM_QSTR(MP_QSTR_mpr121_get_touch_info), MP_ROM_PTR(&badge_mpr121_get_touch_info_obj)}, From 43c2cf9c4152734d204c701f98d278fc0267f978 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 2 Feb 2019 19:39:00 +0100 Subject: [PATCH 401/403] temp. lower micropython's heap and stack.. --- esp32/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esp32/main.c b/esp32/main.c index 748797c7b..e432f984f 100644 --- a/esp32/main.c +++ b/esp32/main.c @@ -63,9 +63,11 @@ // MicroPython runs as a task under FreeRTOS #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1) -#define MP_TASK_STACK_SIZE ( 8 * 1024) +//define MP_TASK_STACK_SIZE ( 8 * 1024) +#define MP_TASK_STACK_SIZE ( 6 * 1024) #define MP_TASK_STACK_LEN (MP_TASK_STACK_SIZE / sizeof(StackType_t)) -#define MP_TASK_HEAP_SIZE (88 * 1024) +//define MP_TASK_HEAP_SIZE (88 * 1024) +#define MP_TASK_HEAP_SIZE (20 * 1024) //define BUTTON_SAFE_MODE ((1 << BADGE_BUTTON_A) || (1 << BADGE_BUTTON_B)) #define BUTTON_SAFE_MODE ((1 << BADGE_BUTTON_START)) From 7c113ae0de6e62e2682c1797ce6e5f51dfeea172 Mon Sep 17 00:00:00 2001 From: Bas van Sisseren Date: Sat, 2 Feb 2019 19:39:42 +0100 Subject: [PATCH 402/403] test_audio() -> play_mp3_stream($url); add cleanups --- esp32/modbadge.c | 64 +++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/esp32/modbadge.c b/esp32/modbadge.c index 91733ad7f..00182abf9 100644 --- a/esp32/modbadge.c +++ b/esp32/modbadge.c @@ -231,21 +231,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(badge_nvs_set_u16_obj, badge_nvs_set_u16_); #include "esp_peripherals.h" #include "periph_wifi.h" #include "badge_power.h" -void -do_audio(void) { - tcpip_adapter_init(); + +STATIC mp_obj_t badge_play_mp3_stream(mp_obj_t _url) { + const char *url = mp_obj_str_get_str(_url); audio_pipeline_handle_t pipeline; audio_element_handle_t http_stream_reader, i2s_stream_writer, mp3_decoder; -// esp_log_level_set("*", ESP_LOG_WARN); -// esp_log_level_set(TAG, ESP_LOG_DEBUG); - ESP_LOGI(TAG, "[ 1 ] Start audio codec chip"); badge_power_sdcard_enable(); -// audio_hal_codec_config_t audio_hal_codec_cfg = AUDIO_HAL_ES8388_DEFAULT(); -// audio_hal_handle_t hal = audio_hal_init(&audio_hal_codec_cfg, 0); -// audio_hal_ctrl_codec(hal, AUDIO_HAL_CODEC_MODE_DECODE, AUDIO_HAL_CTRL_START); ESP_LOGI(TAG, "[2.0] Create audio pipeline for playback"); audio_pipeline_cfg_t pipeline_cfg = DEFAULT_AUDIO_PIPELINE_CONFIG(); @@ -258,6 +252,12 @@ do_audio(void) { ESP_LOGI(TAG, "[2.2] Create i2s stream to write data to codec chip"); i2s_stream_cfg_t i2s_cfg = I2S_STREAM_CFG_DEFAULT(); + + // fixes + i2s_cfg.i2s_config.mode = I2S_MODE_MASTER | I2S_MODE_TX; + i2s_cfg.i2s_config.sample_rate = 48000; + i2s_cfg.i2s_config.use_apll = 0; // too far off + i2s_cfg.type = AUDIO_STREAM_WRITER; i2s_stream_writer = i2s_stream_init(&i2s_cfg); @@ -274,18 +274,11 @@ do_audio(void) { audio_pipeline_link(pipeline, (const char *[]) {"http", "mp3", "i2s"}, 3); ESP_LOGI(TAG, "[2.6] Setup uri (http as http_stream, mp3 as mp3 decoder, and default output is i2s)"); - audio_element_set_uri(http_stream_reader, "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp3"); - - ESP_LOGI(TAG, "[ 3 ] Start and wait for Wi-Fi network"); - esp_periph_config_t periph_cfg = { 0 }; - esp_periph_init(&periph_cfg); - periph_wifi_cfg_t wifi_cfg = { - .ssid = CONFIG_WIFI_SSID, - .password = CONFIG_WIFI_PASSWORD, - }; - esp_periph_handle_t wifi_handle = periph_wifi_init(&wifi_cfg); - esp_periph_start(wifi_handle); - periph_wifi_wait_for_connected(wifi_handle, portMAX_DELAY); + if (*url == 0) { // empty string; keep as hack to test audio + audio_element_set_uri(http_stream_reader, "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp3"); + } else { + audio_element_set_uri(http_stream_reader, url); + } ESP_LOGI(TAG, "[ 4 ] Setup event listener"); audio_event_iface_cfg_t evt_cfg = AUDIO_EVENT_IFACE_DEFAULT_CFG(); @@ -294,9 +287,6 @@ do_audio(void) { ESP_LOGI(TAG, "[4.1] Listening event from all elements of pipeline"); audio_pipeline_set_listener(pipeline, evt); - ESP_LOGI(TAG, "[4.2] Listening event from peripherals"); - audio_event_iface_set_listener(esp_periph_get_event_iface(), evt); - ESP_LOGI(TAG, "[ 5 ] Start audio_pipeline"); audio_pipeline_run(pipeline); @@ -332,12 +322,26 @@ do_audio(void) { ESP_LOGI(TAG, "[ 6 ] Stop audio_pipeline"); audio_pipeline_terminate(pipeline); + + /* Terminate the pipeline before removing the listener */ + audio_pipeline_unregister(pipeline, http_stream_reader); + audio_pipeline_unregister(pipeline, i2s_stream_writer); + audio_pipeline_unregister(pipeline, mp3_decoder); + + audio_pipeline_remove_listener(pipeline); + + /* Make sure audio_pipeline_remove_listener & audio_event_iface_remove_listener are called before destroying event_iface */ + audio_event_iface_destroy(evt); + + /* Release all resources */ + audio_pipeline_deinit(pipeline); + audio_element_deinit(http_stream_reader); + audio_element_deinit(i2s_stream_writer); + audio_element_deinit(mp3_decoder); + + return mp_const_none; } -STATIC mp_obj_t badge_test_audio() { - do_audio(); - return mp_obj_new_int(0); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_test_audio_obj, badge_test_audio); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(badge_play_mp3_stream_obj, badge_play_mp3_stream); // I2C (badge_i2c.h) STATIC mp_obj_t badge_i2c_read_reg_(mp_obj_t _addr, mp_obj_t _reg, mp_obj_t _len) { @@ -891,7 +895,7 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_i2c_write_reg), MP_ROM_PTR(&badge_i2c_write_reg_obj)}, // audio - {MP_OBJ_NEW_QSTR(MP_QSTR_test_audio), (mp_obj_t)&badge_test_audio_obj}, + {MP_OBJ_NEW_QSTR(MP_QSTR_play_mp3_stream), (mp_obj_t)&badge_play_mp3_stream_obj}, // Mpr121 #ifdef I2C_MPR121_ADDR From e5a47153597134cc25721ebdbaff0aefb5323863 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Thu, 21 Feb 2019 21:57:42 +0100 Subject: [PATCH 403/403] Update woezel.py --- esp32/modules/woezel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/modules/woezel.py b/esp32/modules/woezel.py index ec31ffb19..a63c284bc 100644 --- a/esp32/modules/woezel.py +++ b/esp32/modules/woezel.py @@ -148,21 +148,21 @@ def url_open(url): def get_pkg_metadata(name): - f = url_open("https://badge.sha2017.org/eggs/get/%s/json" % name) + f = url_open("https://badge.team/eggs/get/%s/json" % name) try: return json.load(f) finally: f.close() def get_pkg_list(): - f = url_open("https://badge.sha2017.org/eggs/list/json") + f = url_open("https://badge.team/eggs/list/json") try: return json.load(f) finally: f.close() def search_pkg_list(query): - f = url_open("https://badge.sha2017.org/eggs/search/%s/json" % query) + f = url_open("https://badge.team/eggs/search/%s/json" % query) try: return json.load(f) finally: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy