Skip to content

Commit 91fc391

Browse files
committed
CI Cleanup
1 parent 5ac46f7 commit 91fc391

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

cores/esp8266/esp8266_undocumented.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void _xtos_p_none(void);
150150
#else
151151
typedef void (_xtos_handler_func)();
152152
void _xtos_c_wrapper_handler();
153-
void _xtos_unhandled_exception());
153+
void _xtos_unhandled_exception();
154154
void _xtos_p_none();
155155

156156
#endif

cores/esp8266/umm_malloc/umm_local.c

+5
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ size_t umm_block_size( void ) {
180180

181181
static size_t free_blocks_to_free_space(unsigned short int blocks) {
182182
int free_space = (int)blocks * sizeof(umm_block) - UMM_OVERHEAD_ADJUST;
183+
/*
184+
* There are some strange boundary things at play I don't quite follow.
185+
* However, these adjustments allow malloc to be called and succeed in
186+
* allocating all of the available memory, assuming it is contiguous.
187+
*/
183188
return (free_space > 0) ? (size_t)free_space : 0;
184189
}
185190

libraries/esp8266/examples/irammem/irammem.ino

+24-1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,29 @@ void setup() {
253253
Serial.printf("IRAM free: %6d\n", ESP.getFreeHeap());
254254
}
255255
#endif
256+
{
257+
ets_uart_printf("Try and allocate all of the heap in one chunk\n");
258+
HeapSelectIram ephemeral;
259+
size_t free_iram = ESP.getFreeHeap();
260+
ets_uart_printf("IRAM free: %6d\n", free_iram);
261+
uint32_t hfree;
262+
uint16_t hmax;
263+
uint8_t hfrag;
264+
ESP.getHeapStats(&hfree, &hmax, &hfrag);
265+
ets_uart_printf("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n",
266+
hfree, hmax, hfrag);
267+
268+
void *all = malloc(free_iram);
269+
ets_uart_printf("%p = malloc(%lu)\n", all, free_iram);
270+
umm_info(NULL, true);
271+
272+
free_iram = ESP.getFreeHeap();
273+
ets_uart_printf("IRAM free: %6d\n", free_iram);
274+
275+
free(all);
276+
ets_uart_printf("IRAM free: %6d\n", ESP.getFreeHeap());
277+
278+
}
256279
}
257280

258281
void processKey(Print& out, int hotKey) {
@@ -305,7 +328,7 @@ void processKey(Print& out, int hotKey) {
305328
}
306329

307330

308-
void loop(void){
331+
void loop(void) {
309332
if (Serial.available() > 0) {
310333
int hotKey = Serial.read();
311334
processKey(Serial, hotKey);

tools/platformio-build.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def scons_patched_match_splitext(path, suffixes=None):
111111
join(FRAMEWORK_DIR, "tools", "sdk", "include"),
112112
join(FRAMEWORK_DIR, "tools", "sdk", "libc",
113113
"xtensa-lx106-elf", "include"),
114-
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
114+
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")),
115+
join(FRAMEWORK_DIR, "tools", "xtensa-lx106-elf", "include")
115116
],
116117

117118
LIBPATH=[

0 commit comments

Comments
 (0)