From dc8361687bdd5f058e0a1b8d55ceab3518e8d766 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Fri, 17 Dec 2021 21:05:29 -0800 Subject: [PATCH] Fixing yield + yielding correctly to prevent watchdog issues on ESP32-C3. --- ueforth/common/opcodes.h | 2 +- ueforth/esp32/platform.fs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ueforth/common/opcodes.h b/ueforth/common/opcodes.h index 0546bfa..2bf8693 100644 --- a/ueforth/common/opcodes.h +++ b/ueforth/common/opcodes.h @@ -31,7 +31,7 @@ typedef uintptr_t ucell_t; #define DOIMMEDIATE() (*g_sys.current)[-1] |= IMMEDIATE #define UNSMUDGE() (*g_sys.current)[-1] &= ~SMUDGE #define DOES(ip) **g_sys.current = (cell_t) ADDR_DODOES; (*g_sys.current)[1] = (cell_t) ip -#define PARK DUP; *++rp = (cell_t) sp; *++rp = (cell_t) ip +#define PARK DUP; *++rp = (cell_t) fp; *++rp = (cell_t) sp; *++rp = (cell_t) ip #ifndef SSMOD_FUNC # if __SIZEOF_POINTER__ == 8 diff --git a/ueforth/esp32/platform.fs b/ueforth/esp32/platform.fs index 02f526c..047af44 100644 --- a/ueforth/esp32/platform.fs +++ b/ueforth/esp32/platform.fs @@ -15,7 +15,8 @@ ( Add a yielding task so pause yields ) internals definitions transfer{ yield raw-yield }transfer -' raw-yield 100 100 task yield-task +: yield-step raw-yield yield ; +' yield-step 100 100 task yield-task yield-task start-task forth definitions