From 81f9fb72170bba9d80a130c2b26e23d5239351d7 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Fri, 8 Jan 2021 22:32:39 -0800 Subject: [PATCH] Sort of working over web. --- ueforth/arduino/arduino_server.fs | 9 +++++---- ueforth/common/streams.fs | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ueforth/arduino/arduino_server.fs b/ueforth/arduino/arduino_server.fs index 6fa6a32..84d86a8 100644 --- a/ueforth/arduino/arduino_server.fs +++ b/ueforth/arduino/arduino_server.fs @@ -106,7 +106,7 @@ window.onload = function() { | constant index-html variable webserver -500 constant out-size +20000 constant out-size 200 stream input-stream out-size dup stream output-stream create out-string out-size 1+ allot align @@ -118,8 +118,9 @@ create out-string out-size 1+ allot align : handle-input z" cmd" webserver @ WebServer.hasArg if - z" cmd" webserver @ WebServer.arg input-stream >stream + z" cmd" webserver @ WebServer.arg input-stream >stream pause out-string out-size output-stream stream> + out-string z>s arduino-type 200 z" text/plain" out-string webserver @ WebServer.send else 500 z" text/plain" z" Missing Input" webserver @ WebServer.send @@ -141,7 +142,7 @@ create out-string out-size 1+ allot align again ; -' do-serve 10 10 task webserver-task +' do-serve 1000 1000 task webserver-task : serve ['] serve-type is type @@ -151,6 +152,6 @@ create out-string out-size 1+ allot align : wifi ( z z -- ) WIFI_MODE_STA Wifi.mode - WiFi.begin 1000 ms WiFi.localIP ip. cr + WiFi.begin begin WiFi.localIP 0= while 100 ms repeat WiFi.localIP ip. cr z" ueforth" MDNS.begin if ." MDNS started" else ." MDNS failed" then cr ; : webui ( z z -- ) wifi serve ; diff --git a/ueforth/common/streams.fs b/ueforth/common/streams.fs index 3bd862b..70dcd44 100644 --- a/ueforth/common/streams.fs +++ b/ueforth/common/streams.fs @@ -20,5 +20,4 @@ swap 0 do over c@ over ch>stream swap 1+ swap loop 2drop ; : stream> ( a n st -- ) begin over 1 > over empty? 0= and while - ." ch " dup stream>ch >r rot dup r> swap c! 1+ rot 1- rot repeat 2drop 0 swap c! ;