]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/con-utils.c
Enable pullups on all gpio pins. cleanup
[z180-stamp.git] / avr / con-utils.c
index 02657b9a2ccceb94798d0a0a52a2d1684c3be664..f4023ff4e896be07ddbb7965a3682abfab026cae 100644 (file)
@@ -12,14 +12,14 @@ uint_fast8_t tstc(void)
        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;
 }
@@ -57,7 +57,7 @@ uint_fast8_t confirm_yesno(void)
                ;
        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;
@@ -92,4 +92,3 @@ void clear_ctrlc(void)
 {
        ctrlc_was_pressed = 0;
 }
-