tero2011:
I thought of many different ways and decided to use this method.
What about noblock and Priority handling?
Looks like nobody can answer that but all can question the designOn my ISR I am buffering the whole message and then once I reach checksum y call a parsing function that save the data of the message to dynamic memory using malloc. All these is then buffered on a circular buffer so that if the remote device is busy with something else it will execute that message later. Remote device has a serial camera and a GPS. Only at that moment at the end of a message if when my ISR routine can be longer as it calls that parsing function.
That is the whole idea why I want to have nested interrupts enabled so that I am sure I do not miss any data on serial port.
Another thing that could be done is to move the parsing function outside the ISR but I decided to include it on the ISR and I do not want to modify it now.
Rob answered your interrupt question, only one flag and uC will service via priority not my time of arrival. This is not good for your design which means, one of:
- the design is not appropriate for uC selected
- you selected the wrong uC
Your software architecture is not appropriate for what you are attempting to do. Obviously, you have a good grasp of programming but perhaps a different hardware platform. Programming and Software Architecture are separate entities but only become apparent when moving between hardware platforms.
Be forwarned, calling malloc within an ISR is not prudent. Parsing within the ISR is message dependent which means if the parse interval is variable, you are standing in quicksand.
Just my opinion, but I would strongly suggest you change the software design.
Ray