Created
April 24, 2014 23:58
-
-
Save amcjen/11273610 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////// | |
// | |
// runBitlash | |
// | |
// This is the main entry point where the main loop gives Bitlash cycles | |
// Call this frequently from loop() | |
// | |
void runBitlash(void) { | |
// Pipe the serial input into the command handler. Read up to 12 | |
// bytes, which is as much as can be sent over at 115200 bps in | |
// one millisecond. This means that when runBitlash is called | |
// at least once every millisecond, the receive buffer will not | |
// overflow. | |
uint8_t times = 12; | |
while (times-- && serialAvailable()) doCharacter(serialRead()); | |
// Background macro handler: feed it one call each time through | |
runBackgroundTasks(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment