Skip to content

Commit 3b20382

Browse files
committed
Saving space on ESP8266 build by pulling out FFT
1 parent 831a568 commit 3b20382

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

boards/ESP8266.blocklist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
{"class":"E","name":"FFT"}
3+
]

boards/ESP8266_BOARD.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
],
3232
'makefile' : [
3333
'DEFINES+=-DSAVE_ON_FLASH_MATH',
34+
'BLACKLIST=boards/ESP8266.blocklist', # force some stuff to be removed to save space
3435
'USE_DEBUGGER=0', # We can't use debugger as RTOS needs jsiIdle to keep exiting
3536
]
3637
}

src/jswrap_espruino.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ JsVarFloat jswrap_espruino_convolve(JsVar *arr1, JsVar *arr2, int offset) {
429429
return conv;
430430
}
431431

432+
433+
#ifndef ESP8266 // ESP8266 seems unable to leave this out of the firmware, even with gc-sections/flto!
432434
#if defined(SAVE_ON_FLASH_MATH) || defined(BANGLEJS)
433435
#define FFTDATATYPE double
434436
#else
@@ -608,6 +610,7 @@ void jswrap_espruino_FFT(JsVar *arrReal, JsVar *arrImag, bool inverse) {
608610
_jswrap_espruino_FFT_setData(arrImag, vImag, 0, pow2);
609611
}
610612

613+
#endif //!ESP8266
611614
/*JSON{
612615
"type" : "staticmethod",
613616
"ifndef" : "SAVE_ON_FLASH",

0 commit comments

Comments
 (0)