]> Pileus Git - ~andy/csm213a-hw/blobdiff - hw2/main_comm.c
Make control script more configurable
[~andy/csm213a-hw] / hw2 / main_comm.c
index 54cdffcf23d18b9025359e8836f36d6a1d6d56c1..ed864ccab1ba230a7bc03fc077834889ff4e6b49 100644 (file)
@@ -217,7 +217,8 @@ void comm_handle_init(header_t *head, init_msg_t *body)
                body->control & MSG_CTL_VALID_START  ? "START"  : "start",
                body->control & MSG_CTL_VALID_PERIOD ? "PERIOD" : "period",
                body->control & MSG_CTL_VALID_WORLD  ? "WORLD"  : "world",
-               body->control & MSG_CTL_VALID_SYNC   ? "SYNC"   : "sync");
+               body->control & MSG_CTL_RELAY_MODE   ? "RELAY"  : "relay",
+               body->control & MSG_CTL_BEGIN_SYNC   ? "SYNC"   : "sync");
        sirq_printf("  dev    -- %d\r\n", body->device);
        time_printf("  start ", comm_read_time(body->start));
        time_printf("  period", comm_read_time(body->period));
@@ -241,7 +242,7 @@ void comm_handle_init(header_t *head, init_msg_t *body)
        else
                comm_relay_mode = 0;
 
-       if (body->control & MSG_CTL_VALID_SYNC)
+       if (body->control & MSG_CTL_BEGIN_SYNC)
                comm_sync_due = tdma_time() + comm_sync_delay;
 }