We stub out the GPIO Functions in #uLisp #WebAssembly ... They shall be simulated with JavaScript in our #BL602 Simulator
https://github.com/lupyuen/ulisp-bl602/blob/wasm/src/ulisp.c#L48-L57
#uLisp Interpreter runs in #WebAssembly ... Thanks to #Emscripten yay!
https://github.com/lupyuen/ulisp-bl602/blob/wasm/docs/ulisp.html#L1297-L1326
#uLisp in #WebAssembly ... Try it here: https://lupyuen.github.io/ulisp-bl602/ulisp.html
#BL602 Simulator is super helpful ... For catching, fixing and testing tricky firmware bugs like this
https://github.com/lupyuen/ulisp-bl602/blob/wasm/src/ulisp.c#L5346-L5373
#uLisp #WebAssembly shall send #BL602 Simulator a JSON Stream of Simulation Events ... Looks like a MIDI Stream 🤔
Here's the JSON Stream of #BL602 Simulation Events in #WebAssembly ... When #uLisp sets the GPIO Output, a Simulation Event gets added to the JSON Stream
https://github.com/lupyuen/ulisp-bl602/blob/wasm/wasm/wasm.c#L7-L32
Here's how #uLisp #WebAssembly adds a Simulation Event to the JSON Stream ... For #BL602 GPIO Output
https://github.com/lupyuen/ulisp-bl602/blob/wasm/wasm/wasm.c#L54-L71
#uLisp #WebAssembly generates this JSON Stream of #BL602 Simulation Events ... Now we interpret the Simulation Events and blink the Simulated #BL602 LED
How we return a String from #WebAssembly to JavaScript ... In our #BL602 Simulator
https://github.com/lupyuen/ulisp-bl602/blob/wasm/docs/ulisp.html#L1339-L1379
Our #BL602 Simulator needs a board pic ... Let's use this wriggly sketch for now 😬
https://github.com/lupyuen/ulisp-bl602/blob/wasm/docs/pinecone.png
How we render our #BL602 Simulator pic to the HTML Canvas 🎨
https://github.com/lupyuen/ulisp-bl602/blob/wasm/docs/ulisp.html#L1334-L1358
How we handle the #BL602 Simulation Events generated by #uLisp #WebAssembly
https://github.com/lupyuen/ulisp-bl602/blob/wasm/docs/ulisp.html#L1407-L1454
How we render the Simulated LED in our #BL602 #WebAssembly Simulator
https://github.com/lupyuen/ulisp-bl602/blob/wasm/docs/ulisp.html#L1437-L1459
To blink the Simulated #BL602 LED ... We need to Simulate the Delays too ... Here's how
https://github.com/lupyuen/ulisp-bl602/blob/wasm/docs/ulisp.html#L1467-L1472
Simulating #uLisp Loops ... We can't allow uLisp to emit an Infinite List of #BL602 Simulation Events ... So we stop uLisp Loops before the Event List gets too long
https://github.com/lupyuen/ulisp-bl602/blob/wasm/wasm/wasm.c#L34-L46
We compile #uLisp with Emscripten ... And turn it into a #WebAssembly App
https://github.com/lupyuen/ulisp-bl602/blob/wasm/wasm.mk