New answers tagged

2

There's many design problems here. Unless you have a hard real-time requirement that your system must be extremely fast responding (microsecond real-time) to incoming UART data on the fly, there is no need to parse anything inside an ISR. Since UART is asynchronous and unsuitable for such real-time requirements, this seems highly unlikely. Rather, in some ...


1

Assuming that your parsing routine is fast (you really should minimize time spend inside an interrupt), I'd consider modifying your code, as follows. struct MeterState { double valueA; double valueB; double valueC; char id[64]; //more.. } MeterState MeterBuffer[2]; MeterState *filled = &MeterBuffer[0]; volatile MeterState *unfilled =...


2

Use the DMA for the UART to move the data into a memory buffer and parse from there, and check that you don't outrun the DMA while parsing. I would not parse in an interrupt. Then have two copies of the object and three flags: one to indicate most updated copy which the application should read from on its next read, and two to indicate that the application ...


Top 50 recent answers are included