#define CREAD_HIST_CHAR ('!')
#define getcmd_putch(ch) putchar(ch)
-#define getcmd_getch() my_getchar()
+#define getcmd_getch() my_getchar(1)
#define getcmd_cbeep() getcmd_putch('\a')
#define HIST_MAX 5
for (;;) {
- c = my_getchar();
+ c = my_getchar(1);
/*
* Special character handling
return serial_tstc();
}
-int my_getchar(void)
+int my_getchar(uint_fast8_t waitforchar)
{
int c;
do {
bg_shed();
c = serial_getc();
- } while (c < 0);
+ } while ((c < 0) && waitforchar);
return c;
}
;
i = 0;
while (i < sizeof(str_input)) {
- str_input[i] = my_getchar();
+ str_input[i] = my_getchar(1);
putchar(str_input[i]);
if (str_input[i] == '\r')
break;
*/
if (bootdelay >= 0) {
if (tstc()) { /* we got a key press */
- (void) my_getchar(); /* consume input */
+ (void) my_getchar(1); /* consume input */
my_puts_P(PSTR("\b\b\b 0"));
abort = 1; /* don't auto boot */
}
uint_fast8_t tstc(void);
-int my_getchar(void);
+int my_getchar(uint_fast8_t waitforchar);
/* test if ctrl-c was pressed */
uint_fast8_t ctrlc(void);