]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/z180-serv.c
switch fifos conin,conout
[z180-stamp.git] / avr / z180-serv.c
index c7869a68f310e0c38d484887e5488ec03ecf66ee..7193495d513e4b9f42a743d108e4291b34a21e46 100644 (file)
@@ -114,10 +114,9 @@ void do_msg_echo(uint8_t subf, int len, uint8_t * msg)
 /* get timer */
 void do_msg_get_timer(uint8_t subf, int len, uint8_t * msg)
 {
-       (void)len; (void)msg;
-
-       uint32_t time_ms = get_timer(0);
+       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);
 }
 
@@ -492,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) {