Skip to content

Commit 4b33eba

Browse files
committed
ESP32: Fix reset() causing meditation error (ref #1777)
1 parent 95fb716 commit 4b33eba

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
Correctly handle parsing of template literals inside template literals
155155
Don't store command history if echo=off (eg for Web IDE/App Loader uploads)
156156
E.defrag now kicks the watchdog (on Bangle.js 2 it can take long enough that the watchdog fires)
157+
ESP32: Fix reset() causing meditation error (ref #1777)
157158

158159
2v14 : Bangle.js2: Fix issue with E.showMenu creating a global `s` variable
159160
Bangle.js2: Recheck string wrapping after font change inside E.showMenu

make/targets/ESP32.make

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ ESP_ZIP = $(PROJ_NAME).tgz
22

33
COMPORT?=/dev/ttyUSB0
44

5-
$(PROJ_NAME).bin: $(OBJS)
5+
$(PROJ_NAME).elf: $(OBJS)
66
$(LD) $(LDFLAGS) -o $(PROJ_NAME).elf -Wl,--start-group $(LIBS) $(OBJS) -Wl,--end-group
7+
8+
$(PROJ_NAME).bin: $(PROJ_NAME).elf
79
python $(ESP_IDF_PATH)/components/esptool_py/esptool/esptool.py \
810
--chip esp32 \
911
elf2image \
@@ -12,6 +14,9 @@ $(PROJ_NAME).bin: $(OBJS)
1214
-o $(PROJ_NAME).bin \
1315
$(PROJ_NAME).elf
1416

17+
$(PROJ_NAME).lst : $(PROJ_NAME).elf
18+
$(OBJDUMP) -d -l -x $(PROJ_NAME).elf > $(PROJ_NAME).lst
19+
1520
$(ESP_ZIP): $(PROJ_NAME).bin
1621
$(Q)rm -rf $(PROJ_NAME)
1722
$(Q)mkdir -p $(PROJ_NAME)

src/jsinteractive.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2236,10 +2236,11 @@ void jsiIdle() {
22362236
JsiStatus s = jsiStatus;
22372237
if ((s&JSIS_TODO_RESET) == JSIS_TODO_RESET) {
22382238
// shut down everything and start up again
2239+
unsigned int oldJsVarsSize = jsVarsSize; // we must remember the old vars size - mainly for ESP32 where it can change
22392240
jsiKill();
22402241
jsvKill();
22412242
jshReset();
2242-
jsvInit(0);
2243+
jsvInit(oldJsVarsSize);
22432244
jsiSemiInit(false, NULL/* no filename */); // don't autoload
22442245
jsiStatus &= (JsiStatus)~JSIS_TODO_RESET;
22452246
}

src/jsvar.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,11 @@ void jsvFree(void *ptr);
789789
} \
790790
}
791791

792-
#endif /* JSVAR_H_ */
793-
794-
#if defined(JSVAR_MALLOC) && defined(ESPR_EMBED)
792+
#if defined(JSVAR_MALLOC)
795793
extern unsigned int jsVarsSize;
796794
extern JsVar *jsVars;
797795
#endif
796+
797+
#endif /* JSVAR_H_ */
798+
799+

0 commit comments

Comments
 (0)