For now, hard-code UART initialisation into jshInit
Add jshUSARTKick - this should start off UART transmission if it isn't already started, but the transmission should then have an interrupt handler that keeps transmission going all by itself (calling jshGetCharToTransmit to get new characters).
At that point you should be able to boot and see the Espruino logo appear
Then implement the Interrupt handler for UART receive - when you get a character call jshPushIOCharEvent to push it into Espruino
And you should now have a working REPL
If you haven't already, add jshPinSetValue and jshPinSetState to allow you to turn outputs on and off. Initially jshPinSetState would only have to deal with JSHPINSTATE_GPIO_IN and JSHPINSTATE_GPIO_OUT.
Then you could look at adding jshGetSystemTime which would just get the current time from the RTC (that's easiest for now) - then you can start using setInterval/etc.
Hope that helps! Once you have the UART going it becomes quite fun, since you can debug and test using the REPL
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Wow, that's great!
I reckon you want:
jshUSARTKick
- this should start off UART transmission if it isn't already started, but the transmission should then have an interrupt handler that keeps transmission going all by itself (callingjshGetCharToTransmit
to get new characters).jshPushIOCharEvent
to push it into EspruinojshPinSetValue
andjshPinSetState
to allow you to turn outputs on and off. InitiallyjshPinSetState
would only have to deal with JSHPINSTATE_GPIO_IN and JSHPINSTATE_GPIO_OUT.Hope that helps! Once you have the UART going it becomes quite fun, since you can debug and test using the REPL