|
26 | 26 | #include "../libraries/LittleFS/lib/littlefs/lfs_util.h"
|
27 | 27 | #include "./uzlib/src/uzlib.h"
|
28 | 28 |
|
| 29 | +OTACmdPage __attribute__((section (".globals"))) _ota_cmd; |
| 30 | + |
29 | 31 | static lfs_t _lfs;
|
30 | 32 | static struct lfs_config _lfs_cfg;
|
31 | 33 |
|
@@ -70,9 +72,9 @@ static int lfs_flash_sync(const struct lfs_config *c) {
|
70 | 72 | return 0;
|
71 | 73 | }
|
72 | 74 |
|
73 |
| -uint8_t _read_buffer[256]; |
74 |
| -uint8_t _prog_buffer[256]; |
75 |
| -uint8_t _lookahead_buffer[256]; |
| 75 | +uint8_t __attribute__((section (".globals"))) _read_buffer[256]; |
| 76 | +uint8_t __attribute__((section (".globals"))) _prog_buffer[256]; |
| 77 | +uint8_t __attribute__((section (".globals"))) _lookahead_buffer[256]; |
76 | 78 | bool lfsMount(uint8_t *start, uint32_t blockSize, uint32_t size) {
|
77 | 79 | _start = start;
|
78 | 80 | _blockSize = blockSize;
|
@@ -104,16 +106,16 @@ bool lfsMount(uint8_t *start, uint32_t blockSize, uint32_t size) {
|
104 | 106 | static bool _gzip = false;
|
105 | 107 | static lfs_file_t _file;
|
106 | 108 |
|
107 |
| -static unsigned char __attribute__((aligned(4))) uzlib_read_buff[4096]; |
108 |
| -static unsigned char gzip_dict[32768]; |
109 |
| -static uint8_t _flash_buff[4096]; // no room for this on the stack |
110 |
| -static struct uzlib_uncomp m_uncomp; |
| 109 | +unsigned char __attribute__((section (".globals"))) uzlib_read_buff[4096]; |
| 110 | +unsigned char __attribute__((section (".globals"))) gzip_dict[32768]; |
| 111 | +uint8_t __attribute__((section (".globals")))_flash_buff[4096]; // no room for this on the stack |
| 112 | +struct uzlib_uncomp __attribute__((section (".globals"))) m_uncomp; |
111 | 113 |
|
112 |
| -static uint8_t _ota_buff[256]; |
113 |
| -static struct lfs_file_config _ota_cfg = { (void *)_ota_buff, NULL, 0 }; |
| 114 | +uint8_t __attribute__((section (".globals")))_ota_buff[256]; |
| 115 | +struct lfs_file_config _ota_cfg = { (void *)_ota_buff, NULL, 0 }; |
114 | 116 |
|
115 |
| -static uint8_t _file_buff[256]; |
116 |
| -static struct lfs_file_config _file_cfg = { (void *)_file_buff, NULL, 0 }; |
| 117 | +uint8_t __attribute__((section (".globals")))_file_buff[256]; |
| 118 | +struct lfs_file_config _file_cfg = { (void *)_file_buff, NULL, 0 }; |
117 | 119 |
|
118 | 120 | bool lfsReadOTA(OTACmdPage *ota, uint32_t *blockToErase) {
|
119 | 121 | lfs_file_t f;
|
|
0 commit comments