Skip to content

Commit c660ebe

Browse files
committed
Fixed assert fail when building non-release builds on many boards - #2376
1 parent 49c916a commit c660ebe

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

targets/emscripten/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void jsInit() {
2626

2727
jshInit();
2828
jswHWInit();
29-
jsvInit(0);
29+
jsvInit(JSVAR_CACHE_SIZE);
3030
jsiInit(true);
3131
}
3232

targets/esp8266/user_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ void jshPrintBanner() {
126126
os_printf("Espruino "JS_VERSION"\nFlash map %s, manuf 0x%lx chip 0x%lx\n",
127127
flash_maps[map], (long unsigned int) (fid & 0xff), (long unsigned int)chip);
128128
jsiConsolePrintf(
129-
"Flash map %s, manuf 0x%x chip 0x%x\n",
129+
"Flash map %s, manuf 0x%x chip 0x%x\n",
130130
(( map == 2 && flash_kb[map] == 1024 && ESP_COMBINED_SIZE >= 1024) ? flash_maps_alt[map] : flash_maps[map]),
131131
fid & 0xff, chip);
132-
if ((chip == 0x4013 && map != 0) || (chip == 0x4016 && map != 4 && map != 6)) {
132+
if ((chip == 0x4013 && map != 0) || (chip == 0x4016 && map != 4 && map != 6)) {
133133
jsiConsolePrint("WARNING: *** Your flash chip does not match your flash map ***\n");
134134
}
135135
}
@@ -259,7 +259,7 @@ static void initDone() {
259259

260260
jshInit(); // Initialize the hardware
261261
jswHWInit();
262-
jsvInit(0); // Initialize the variables
262+
jsvInit(JSVAR_CACHE_SIZE); // Initialize the variables
263263
jsiInit(true); // Initialize the interactive subsystem
264264
// note: the wifi gets hooked-up via wifi_soft_init called from jsiInit
265265

@@ -328,8 +328,8 @@ void user_rf_pre_init() {
328328
uint32 user_rf_cal_sector_set(void) {
329329
uint32_t rf_cal_sec = 0;
330330
switch (system_get_flash_size_map()) {
331-
case FLASH_SIZE_4M_MAP_256_256:
332-
rf_cal_sec = 128 - 5;
331+
case FLASH_SIZE_4M_MAP_256_256:
332+
rf_cal_sec = 128 - 5;
333333
break;
334334
case FLASH_SIZE_8M_MAP_512_512:
335335
rf_cal_sec = 256 - 5;

targets/nrf5x/main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Platform Specific entry point
1212
* ----------------------------------------------------------------------------
1313
*/
14-
14+
1515
#include "platform_config.h"
1616
#include "jsinteractive.h"
1717
#include "jshardware.h"
@@ -31,11 +31,10 @@ int main() {
3131
#ifdef BTN1_PININDEX
3232
buttonState = jshPinGetValue(BTN1_PININDEX) == BTN1_ONSTATE;
3333
#endif
34-
jsvInit(0);
34+
jsvInit(JSVAR_CACHE_SIZE);
3535
jsiInit(!buttonState /* load from flash by default */); // pressing USER button skips autoload
3636

37-
while (1)
38-
{
37+
while (1) {
3938
jsiLoop();
4039
}
4140
//jsiKill();

targets/stm32/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int main(void){
5454
#ifdef BTN1_PININDEX
5555
buttonState = jshPinInput(BTN1_PININDEX) == BTN1_ONSTATE;
5656
#endif
57-
jsvInit(0);
57+
jsvInit(JSVAR_CACHE_SIZE);
5858
jsiInit(!buttonState); // pressing USER button skips autoload
5959

6060
while (1) {

targets/stm32_ll/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(void){
3535
#ifdef BTN1_PININDEX
3636
buttonState = jshPinInput(BTN1_PININDEX) == BTN1_ONSTATE;
3737
#endif
38-
jsvInit(0);
38+
jsvInit(JSVAR_CACHE_SIZE);
3939
jsiInit(!buttonState); // pressing USER button skips autoload
4040

4141
while (1) {

0 commit comments

Comments
 (0)