Skip to content

Instantly share code, notes, and snippets.

@amcjen
Created April 24, 2014 23:58
Show Gist options
  • Save amcjen/11273610 to your computer and use it in GitHub Desktop.
Save amcjen/11273610 to your computer and use it in GitHub Desktop.
/////////////////////////////
//
// 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