You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • WS2811

    Yes - WS2811 is one of the obvious things to do. Personally I'd really like to improve the SPI output code at some point soon (using DMA - it's already partially implemented for the TV out). When I do that then the WS2811 code wouldn't have to disable interrupts and everything would 'just work'.

    I've cheated by detecting a framing error

    You could probably check that with peek32 - however making sure that your JS got called at exactly the right point to check it could be problematic.

    Using the (hacky) resistor/capacitor thing fires a watch event, which shoves data into the same queue as the received serial data - so even if the JS doesn't get run immediately it still gets called at the same time relative to the Serial data that's been processed to date :)

    Transmitting 4 x 128byte chunks for the output would be fine

    Yes - actually you should be able to do 8x64 byte chunks with enough of a delay between that the data just gets dumped into the TX buffer and there's no blocking, but without running the risk of the TX buffer emptying and there being a pause.

    Does the STM chip warn when the TX buffer is getting empty

    There's only a single byte TX buffer afaik (it's all done via IRQ in Espruino). You could probably set up DMA for transmits (and receives) though.

    The issue with Espruino is that I don't allocate individual buffers for peripherals (because if you did that you'd use all your memory right at the start) so the buffers are shared and it makes it almost impossible to DMA.

    I'd have to add the ability to dynamically allocate a buffer, DMA, and then deallocate it after - quite a big change :)

About

Avatar for Gordon @Gordon started