You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Wow, that's great!

    I reckon you want:

    • 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

About

Avatar for Gordon @Gordon started