]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/z180-serv.c
switch fifos conin,conout
[z180-stamp.git] / avr / z180-serv.c
index bf49a6c7fb49332ff5c2bf878b8b31b1542a7275..7193495d513e4b9f42a743d108e4291b34a21e46 100644 (file)
@@ -111,6 +111,15 @@ void do_msg_echo(uint8_t subf, int len, uint8_t * msg)
        msg_xmit(1, 3, len, msg);
 }
 
+/* get timer */
+void do_msg_get_timer(uint8_t subf, int len, uint8_t * msg)
+{
+       uint32_t time_ms = (len >= 4) ? *(uint32_t *) msg : 0;
+
+       time_ms = get_timer(time_ms);
+       msg_xmit(3, subf, sizeof(time_ms), (uint8_t *) &time_ms);
+}
+
 /* ---------------------------------------------------------------------------*/
 
 #define MAX_DRIVE      4
@@ -381,6 +390,9 @@ const FLASH struct msg_item z80_messages[] =
        { 2,
          1, 2,
          do_msg_cpm_rw},
+       { 3,
+         1, 1,
+         do_msg_get_timer},
        { 0xff,                         /* end mark */
          0, 0,
          0},
@@ -479,6 +491,9 @@ int msg_handling(int state)
                pending = (Stat & S_MSG_PENDING) != 0;
                Stat &= ~S_MSG_PENDING;
        }
+/*
+ * TODO: if pending but no message chr --> special condition. ie init,...
+ */
 
        if (pending) {
                switch (state) {