Closed trevorshannon closed 7 years ago
Your intuitions are correct - it was a design decision to try to log as fast as possible while still scanning for escape chars.
To avoid your issue, and if possible, add a small delay of 500ms before sending $$$. If MAX_IDLE_TIME_MSEC passes the buffer is recorded and unit goes to sleep. This insures the first $ is picked up and the escape sequence is picked up correctly.
Please re-open if you have other problems or issues.
I have an application where I am writing logs, and when the logs are done, I automatically drop to command mode. Sometimes, I find log files with the escape sequence and subsequent command written to the log file. In these cases, there are two logs back-to-back in the same file, separated by the escape sequence and command.
Example log file: [data from first run...] $$$reset [more data from second run...]
Perhaps this has to do with the fact that only the first character in the local buffer is checked for an escape character before entering escape detection logic? OpenLog.ino:481
Maybe it was done that way for speed/performance?