Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial events main #379

Merged
merged 5 commits into from Jun 11, 2019

Conversation

Projects
None yet
2 participants
@KurtE
Copy link
Contributor

commented Jun 7, 2019

a) Main loop would now call yield
b) yield now has code to do if (Serial.available()) SerialEvent();
c) default SerialEvent code tries to disable these calls ...
d) The above first pass code for Serial.readBytes.

KurtE added some commits Jun 7, 2019

Main loop - call yield - yield can call SerialEvent
Comment out some of the main programs debug print statements plus add yield call to main loop.

yield can now call SerialEvent.

Put hack in that if the user has not overwritten the SerialEvent function, the weak linked one will turn off calling itself...
Serial.readBytes and Serial.peak
Put in probably temporary bandaids to allow code that uses:
Serial.readBytes(Buffer, cnt);

To function.  It simply loops calling the underlying code for Serial.read().
C Serial1 functions like: serial_print(const char *)
Found some of our code has these defined, plus had in another test sketch so defined them hopefully with C bindings, but calls Serial1 object code

@KurtE KurtE force-pushed the KurtE:SerialEvents_main branch from 780c42b to 2cde157 Jun 8, 2019

KurtE added some commits Jun 9, 2019

EventResponder runFromYield shortcut
Add quick test at start of function to return if there are no events pending.

Do this before checking if in ISR and the like.  Cut timing down a lot in yield.

@PaulStoffregen PaulStoffregen merged commit 36c2708 into PaulStoffregen:master Jun 11, 2019

@KurtE KurtE deleted the KurtE:SerialEvents_main branch Jun 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.