From: Andy Spencer Date: Thu, 13 Mar 2014 03:47:40 +0000 (+0000) Subject: Misc debugging X-Git-Url: http://pileus.org/git/?p=~andy%2Fcsm213a-hw;a=commitdiff_plain;h=b888e360fe2e74662feff76f6b5a0eef335d48c1 Misc debugging Add debug event messages Change devices to 1 and 2 Fix bug in time transmit Fix return code warning --- diff --git a/hw2/main.cpp b/hw2/main.cpp index 3e82918..52e84aa 100644 --- a/hw2/main.cpp +++ b/hw2/main.cpp @@ -335,8 +335,8 @@ void serial_send_event(sirq_t *port, uint16_t event, uint64_t local) body.device = serial_device_id; body.event = event; - body.world = ltime; - body.local = wtime; + body.world = wtime; + body.local = ltime; // Transmit message to BBB sirq_write(port, &head, sizeof(head)); @@ -569,6 +569,8 @@ void task_debug(uint64_t local, uint64_t world) //sirq_debug(sirq_mbed); + serial_send_event(sirq_bbb, 1, local); + #ifdef VERBOSE sirq_printf("background - %6u.%02u -> %u.%02u\r\n", (uint32_t)(local / NSEC_PER_SEC), diff --git a/hw2/makefile b/hw2/makefile index 0798282..697aa23 100644 --- a/hw2/makefile +++ b/hw2/makefile @@ -13,8 +13,8 @@ control: control.c messages.h run: all control install.sh @./install.sh $(PROG).bin - @./control $(UART0) 0 - @./control $(UART1) 1 sync + @./control $(UART0) 1 + @./control $(UART1) 2 sync terms: term /dev/ttyACM0 & diff --git a/hw2/timer_dma.c b/hw2/timer_dma.c index 7d06bac..9a803ac 100644 --- a/hw2/timer_dma.c +++ b/hw2/timer_dma.c @@ -167,7 +167,7 @@ void tdma_stop(tdma_t *port, int wait) for (int i = 0; port->dma->dsr & DMA_DSR_BCR_BCR_MASK; i++) if (i > wait) - return 0; + return; // Disable DMA Mux port->mux->cfg &= DMAMUX_CHCFG_ENBL_MASK;