Skip to content

Commit

Permalink
Saving space on ESP8266 build by pulling out FFT
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Sep 20, 2024
1 parent 831a568 commit 3b20382
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boards/ESP8266.blocklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
{"class":"E","name":"FFT"}
]
1 change: 1 addition & 0 deletions boards/ESP8266_BOARD.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
],
'makefile' : [
'DEFINES+=-DSAVE_ON_FLASH_MATH',
'BLACKLIST=boards/ESP8266.blocklist', # force some stuff to be removed to save space
'USE_DEBUGGER=0', # We can't use debugger as RTOS needs jsiIdle to keep exiting
]
}
Expand Down
3 changes: 3 additions & 0 deletions src/jswrap_espruino.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ JsVarFloat jswrap_espruino_convolve(JsVar *arr1, JsVar *arr2, int offset) {
return conv;
}


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

#endif //!ESP8266
/*JSON{
"type" : "staticmethod",
"ifndef" : "SAVE_ON_FLASH",
Expand Down

0 comments on commit 3b20382

Please sign in to comment.