mikaelpatel / Arduino-Debug

On-target sketch debugger for Arduino

Home Page:https://mikaelpatel.github.io/Arduino-Debug/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

non-blocking mode

pille opened this issue · comments

commented

is it possible to provide a non-blocking mode, where the main program flow isn't interrupted?
i can imagine calling a debug-function, in the loop, that just checks the Serial buffer.
if it's filled, it interprets & acts on the commands it finds and returns to program flow.
maybe this could also being called using a timer.

I think you could use BREAK_IF(condition) for that. The condition could be as you describe a check of the input state or something else such a variable changed by a timer ISR.

commented

but wouln't that still drop into a shell, breaking program flow, or do you mean to use a dummy condition, just that your handler code is called?

Consider BREAK_IF(DebugSerial.available() > 0) that would only drop into the shell when there is/are character(s) available for the shell.

commented

understood. i basically want this feature in combination with #2, so i think it's fine to just hit go again after changing a value.