We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 25dd72d + 2637e5b commit 50121d0Copy full SHA for 50121d0
1 file changed
ports/nrf/supervisor/port.c
@@ -283,14 +283,16 @@ uint32_t *port_stack_get_top(void) {
283
return &_estack;
284
}
285
286
-// Place the word in the uninitialized section so it won't get overwritten.
287
-__attribute__((section(".uninitialized"))) uint32_t _saved_word;
+// Place the word in the first 32k of RAM. This is saved by us and the
+// bootloader for the soft device. We only use it before the soft device uses
288
+// that memory.
289
+#define SAVED_WORD ((uint32_t *)(0x20008000 - 4))
290
void port_set_saved_word(uint32_t value) {
- _saved_word = value;
291
+ *SAVED_WORD = value;
292
293
294
uint32_t port_get_saved_word(void) {
- return _saved_word;
295
+ return *SAVED_WORD;
296
297
298
uint64_t port_get_raw_ticks(uint8_t *subticks) {
0 commit comments