Last active
August 29, 2015 14:00
-
-
Save amcjen/11273667 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
void prompt(void) { | |
char buf[IDLEN+1]; | |
#if defined(TINY_BUILD) | |
msgp(M_prompt); | |
#else | |
// Run the script named "prompt" if there is one else print "> " | |
strncpy_P(buf, getmsg(M_promptid), IDLEN); // get the name "prompt" in our cmd buf | |
if (findscript(buf)) doCommand(buf); | |
else msgp(M_prompt); // else print default prompt | |
#endif | |
} | |
void initlbuf(void) { | |
lbufptr = lbuf; | |
#if defined(SERIAL_OVERRIDE) && 0 | |
// don't do the prompt in serialIsOverridden mode | |
if (serialIsOverridden()) return; | |
#endif | |
prompt(); | |
// flush any pending serial input | |
while (serialAvailable()) serialRead(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment