]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/con-utils.c
Add memory commands (cmp, cp, md, mm, mw, nm)
[z180-stamp.git] / avr / con-utils.c
index 430ba98ae6407fbdc964f42e87a207b34766aa08..02657b9a2ccceb94798d0a0a52a2d1684c3be664 100644 (file)
@@ -1,13 +1,14 @@
 
 #include <string.h>
-#include <stdio.h>
+#include "common.h"
 
 #include "serial.h"
+#include "background.h"
 #include "con-utils.h"
 
-
 uint_fast8_t tstc(void)
 {
+       bg_shed();
        return serial_tstc();
 }
 
@@ -15,16 +16,19 @@ int my_getchar(void)
 {
        int c;
        
-       while((c = serial_getc()) < 0)
-               ;
+       do {
+               bg_shed();
+               c = serial_getc();
+       } while (c < 0);
+
        return c;
 }
 
 
 /* test if ctrl-c was pressed */
 
-static uint_fast8_t ctrlc_disabled = 0;        /* see disable_ctrl() */
-static uint_fast8_t ctrlc_was_pressed = 0;
+static uint_fast8_t ctrlc_disabled;    /* see disable_ctrl() */
+static uint_fast8_t ctrlc_was_pressed;
 
 uint_fast8_t ctrlc(void)
 {