Multiple fixes.

Switched in KEY and MS which yield to PAUSE on esp32.
Added a background task which yield using yield() in place of the event loop.
Made some formatting and carriage return handling changes to the web ui.
This commit is contained in:
Brad Nelson
2021-05-08 01:36:50 -07:00
parent c030b61248
commit b6ecb6db1a
6 changed files with 31 additions and 21 deletions

View File

@ -1,14 +1,21 @@
( Add a yielding task so pause yields )
internals definitions
transfer{ yield raw-yield }transfer
' raw-yield 100 100 task yield-task
yield-task start-task
forth definitions
( Set up Basic I/O )
internals definitions
: arduino-bye 0 terminate ;
' arduino-bye is bye
: arduino-type ( a n -- ) Serial.write drop ;
' arduino-type is type
: arduino-key ( -- n )
begin Serial.available until 0 >r rp@ 1 Serial.readBytes drop r> ;
' arduino-key is key
: arduino-key? ( -- n ) Serial.available ;
' arduino-key? is key?
: esp32-bye 0 terminate ;
' esp32-bye is bye
: serial-type ( a n -- ) Serial.write drop ;
' serial-type is type
: serial-key ( -- n )
begin pause Serial.available until 0 >r rp@ 1 Serial.readBytes drop r> ;
' serial-key is key
: serial-key? ( -- n ) Serial.available ;
' serial-key? is key?
forth definitions
( Map Arduino / ESP32 things to shorter names. )