nrf: port: move saved word into .uninitialized section
Circuit Python supports saving a single word of data across reboots. Previously, this data was placed immediately following the .bss. However, this appeared to not work, as Circuit Python zeroes out the heap when it starts up, and the heap begins immediately after the .bss. Switch to using the new .uninitialized section in order to store this word across resets. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
192bb155fa
commit
3b5f5ddaa6
@ -198,13 +198,14 @@ uint32_t *port_stack_get_top(void) {
|
||||
return &_estack;
|
||||
}
|
||||
|
||||
// Place the word to save just after our BSS section that gets blanked.
|
||||
// Place the word in the uninitialized section so it won't get overwritten.
|
||||
__attribute__((section(".uninitialized"))) uint32_t _saved_word;
|
||||
void port_set_saved_word(uint32_t value) {
|
||||
_ebss = value;
|
||||
_saved_word = value;
|
||||
}
|
||||
|
||||
uint32_t port_get_saved_word(void) {
|
||||
return _ebss;
|
||||
return _saved_word;
|
||||
}
|
||||
|
||||
uint64_t port_get_raw_ticks(uint8_t* subticks) {
|
||||
|
Loading…
Reference in New Issue
Block a user