Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ bool run_code_py(safe_mode_t safe_mode) {
MICROPY_VM_HOOK_LOOP
#endif
if (reload_requested) {
reload_requested = false;
return true;
}

Expand Down
14 changes: 10 additions & 4 deletions ports/atmel-samd/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,20 @@ void reset_cpu(void) {
reset();
}

extern uint32_t _ebss;
// Place the word to save just after our BSS section that gets blanked.
// Place the word to save 8k from the end of RAM so we and the bootloader don't clobber it.
#ifdef SAMD21
uint32_t* safe_word = (uint32_t*) (HMCRAMC0_ADDR + HMCRAMC0_SIZE - 0x2000);
#endif
#ifdef SAMD51
uint32_t* safe_word = (uint32_t*) (HSRAM_ADDR + HSRAM_SIZE - 0x2000);
#endif

void port_set_saved_word(uint32_t value) {
_ebss = value;
*safe_word = value;
}

uint32_t port_get_saved_word(void) {
return _ebss;
return *safe_word;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/displayio/Group.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ STATIC mp_obj_t group_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t valu

if (value == MP_OBJ_SENTINEL) {
// load
return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_group_get(self, index));
return common_hal_displayio_group_get(self, index);
} else if (value == mp_const_none) {
common_hal_displayio_group_pop(self, index);
} else {
Expand Down
2 changes: 1 addition & 1 deletion shared-module/displayio/Group.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ size_t common_hal_displayio_group_get_len(displayio_group_t* self) {
}

mp_obj_t common_hal_displayio_group_get(displayio_group_t* self, size_t index) {
return self->children[index];
return MP_OBJ_FROM_PTR(self->children[index]);
}

void common_hal_displayio_group_set(displayio_group_t* self, size_t index, mp_obj_t layer) {
Expand Down
2 changes: 1 addition & 1 deletion shared-module/displayio/TileGrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ void common_hal_displayio_tilegrid_get_position(displayio_tilegrid_t *self, int1
}

void common_hal_displayio_tilegrid_set_position(displayio_tilegrid_t *self, int16_t x, int16_t y) {
self->needs_refresh = self->x != x || self->y != y;
self->x = x;
self->y = y;
self->needs_refresh = true;
}

mp_obj_t common_hal_displayio_tilegrid_get_pixel_shader(displayio_tilegrid_t *self) {
Expand Down