8000 stm32/mboot: Make _estack an array to avoid compiler warnings. · guidebee/micropython@c8f19f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit c8f19f1

Browse files
committed
stm32/mboot: Make _estack an array to avoid compiler warnings.
The compiler can warn about out-of-bounds array access if _estack is just a single uint8_t.
1 parent d43dd88 commit c8f19f1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ports/stm32/mboot/mboot.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
// Use this to tag global static data in RAM that doesn't need to be zeroed on startup
3131
#define SECTION_NOZERO_BSS __attribute__((section(".nozero_bss")))
3232

33-
#define ELEM_DATA_START (&_estack)
34-
#define ELEM_DATA_MAX (ELEM_DATA_START + 1024)
33+
#define ELEM_DATA_SIZE (1024)
34+
#define ELEM_DATA_START (&_estack[0])
35+
#define ELEM_DATA_MAX (&_estack[ELEM_DATA_SIZE])
3536

3637
enum {
3738
ELEM_TYPE_END = 1,
@@ -48,7 +49,7 @@ typedef struct _fsload_bdev_t {
4849
uint32_t byte_len;
4950
} fsload_bdev_t;
5051

51-
extern uint8_t _estack;
52+
extern uint8_t _estack[ELEM_DATA_SIZE];
5253

5354
uint32_t get_le32(const uint8_t *b);
5455
void led_state_all(unsigned int mask);

0 commit comments

Comments
 (0)
0