Skip to content

Commit 2d78cf3

Browse files
authored
Merge branch 'adafruit:main' into efr32-doc-fixes
2 parents 60935c2 + 475ffc3 commit 2d78cf3

File tree

6 files changed

+43
-7
lines changed

6 files changed

+43
-7
lines changed

extmod/moductypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_ob
544544
}
545545

546546
} else if (agg_type == PTR) {
547-
byte *p = *(void **)self->addr;
547+
byte *p = *(void **)(void *)self->addr;
548548
if (mp_obj_is_small_int(t->items[1])) {
549549
uint val_type = GET_TYPE(MP_OBJ_SMALL_INT_VALUE(t->items[1]), VAL_TYPE_BITS);
550550
return get_aligned(val_type, p, index);
@@ -574,7 +574,7 @@ STATIC mp_obj_t uctypes_struct_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
574574
mp_int_t offset = MP_OBJ_SMALL_INT_VALUE(t->items[0]);
575575
uint agg_type = GET_TYPE(offset, AGG_TYPE_BITS);
576576
if (agg_type == PTR) {
577-
byte *p = *(void **)self->addr;
577+
byte *p = *(void **)(void *)self->addr;
578578
return mp_obj_new_int((mp_int_t)(uintptr_t)p);
579579
}
580580
}

locale/de_DE.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ msgstr ""
66
"Project-Id-Version: \n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
9-
"PO-Revision-Date: 2023-05-21 00:49+0000\n"
10-
"Last-Translator: Scott Shawcroft <[email protected]>\n"
9+
"PO-Revision-Date: 2023-06-02 20:48+0000\n"
10+
"Last-Translator: Ettore Atalan <[email protected]>\n"
1111
"Language: de_DE\n"
1212
"MIME-Version: 1.0\n"
1313
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1318,7 +1318,7 @@ msgstr "Ungültige format chunk size"
13181318

13191319
#: shared-bindings/wifi/Radio.c
13201320
msgid "Invalid hex password"
1321-
msgstr ""
1321+
msgstr "Ungültiges Hex-Passwort"
13221322

13231323
#: ports/espressif/common-hal/wifi/Radio.c
13241324
msgid "Invalid multicast MAC address"
@@ -2544,7 +2544,7 @@ msgstr "Die Annotation muss ein Bezeichner sein"
25442544

25452545
#: extmod/ulab/code/numpy/create.c
25462546
msgid "arange: cannot compute length"
2547-
msgstr ""
2547+
msgstr "arange: kann Länge nicht berechnen"
25482548

25492549
#: py/modbuiltins.c
25502550
msgid "arg is an empty sequence"

ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CHIP_VARIANT = SAME54P20A
77
CHIP_FAMILY = same54
88

99
QSPI_FLASH_FILESYSTEM = 1
10-
EXTERNAL_FLASH_DEVICES = "N25Q256A"
10+
EXTERNAL_FLASH_DEVICES = "N25Q256A,SST26VF064B"
1111
LONGINT_IMPL = MPZ
1212

1313
CIRCUITPY_SDIOIO = 1

ports/nrf/boards/makerdiary_m60_keyboard/board.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,39 @@
2525
*/
2626

2727
#include "supervisor/board.h"
28+
#include "supervisor/shared/board.h"
29+
#include "mpconfigboard.h"
2830

31+
static void power_on(void) {
32+
// turn on internal battery
33+
nrf_gpio_cfg(POWER_SWITCH_PIN->number,
34+
NRF_GPIO_PIN_DIR_OUTPUT,
35+
NRF_GPIO_PIN_INPUT_DISCONNECT,
36+
NRF_GPIO_PIN_NOPULL,
37+
NRF_GPIO_PIN_S0S1,
38+
NRF_GPIO_PIN_NOSENSE);
39+
nrf_gpio_pin_write(POWER_SWITCH_PIN->number, true);
40+
}
41+
42+
static void preserve_and_release_battery_pin(void) {
43+
// Preserve the battery state. The battery is enabled by default in factory bootloader.
44+
// Reset claimed_pins so user can control pin's state in the vm.
45+
// The code below doesn't actually reset the pin's state, but only set the flags.
46+
reset_pin_number(POWER_SWITCH_PIN->number); // clear claimed_pins and never_reset_pins
47+
never_reset_pin_number(POWER_SWITCH_PIN->number); // set never_reset_pins
48+
}
49+
50+
void board_init(void) {
51+
// As of cpy 8.1.0, board_init() runs after reset_ports() on first run. That means
52+
// never_reset_pins won't be set at boot, the battery pin is reset, causing system
53+
// shutdown.
54+
// So if we need to run on battery, we must enable the battery here.
55+
power_on();
56+
preserve_and_release_battery_pin();
57+
}
58+
59+
void reset_board(void) {
60+
preserve_and_release_battery_pin();
61+
}
2962

3063
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@
4949

5050
#define DEFAULT_I2C_BUS_SCL (&pin_P1_06)
5151
#define DEFAULT_I2C_BUS_SDA (&pin_P1_05)
52+
53+
#define POWER_SWITCH_PIN (&pin_P0_28)

ports/nrf/boards/makerdiary_m60_keyboard/pins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
3939
{ MP_ROM_QSTR(MP_QSTR_CHARGING), MP_ROM_PTR(&pin_P0_03) },
4040
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_02) },
4141
{ MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_02) },
42+
{ MP_ROM_QSTR(MP_QSTR_BATTERY_ENABLE), MP_ROM_PTR(&pin_P0_28) },
4243

4344
{ MP_ROM_QSTR(MP_QSTR_RGB_POWER), MP_ROM_PTR(&pin_P1_04) },
4445

0 commit comments

Comments
 (0)