]> Pileus Git - ~andy/csm213a-hw/commitdiff
Add readme and cleanup formatting cleanup
authorAndy Spencer <andy753421@gmail.com>
Sat, 15 Mar 2014 18:10:27 +0000 (18:10 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sat, 15 Mar 2014 18:10:27 +0000 (18:10 +0000)
hw2/main_comm.c
hw2/main_emit.c
hw2/main_time.h
hw2/messages.h
hw2/readme.txt [new file with mode: 0644]
hw2/serial_irq.c

index ed864ccab1ba230a7bc03fc077834889ff4e6b49..d5c66b168c7a66f1cc89ff7988cf6ee4245dd359 100644 (file)
@@ -9,7 +9,7 @@
 #include "main_emit.h"
 
 /**
- * Communcation overview:
+ * Communication overview:
  *
  *     Initialization:
  *        bbb --init1-->  mbed1
@@ -26,7 +26,7 @@
  * Initialization:
  *     Each mbed is initialized by the BBB by receiving an initialization
  *     message.  The Device ID must be non-zero, and is saved for future
- *     messages. If the device is already initialized and a recevied Device ID
+ *     messages. If the device is already initialized and a received Device ID
  *     does not match the configured Device ID, the messages is relayed to the
  *     second mbed.
  *
@@ -159,7 +159,7 @@ void comm_send_sync(uint64_t local)
  */
 void comm_send_event(uint16_t event, uint64_t local)
 {
-       //time_printf("event received", local);
+       time_printf("event received", local);
 
        // Convert timestamp
        uint64_t world = time_to_world(local);
index 6588e1fc35079709d72bc6d44b69555bd3759d94..bb751a65cd04614a0753514239dbdb3af1bdb79f 100644 (file)
@@ -9,13 +9,13 @@
  * Signal generation *
  *********************/
 
-// for 50 Mhz clock  50/1000 = 1/20  (PLL/2)
+// for 50 MHz clock  50/1000 = 1/20  (PLL/2)
 
-// for 48 Mhz clock  48/1000 = 6/125 (FLL)
-// for 24 Mhz clock, 24/1000 = 3/125
-// for 12 Mhz clock, 12/1000 = 3/250
-// for  6 Mhz clock,  6/1000 = 3/500
-// for  3 Mhz clock,  3/1000 = 3/1000
+// for 48 MHz clock  48/1000 = 6/125 (FLL)
+// for 24 MHz clock, 24/1000 = 3/125
+// for 12 MHz clock, 12/1000 = 3/250
+// for  6 MHz clock,  6/1000 = 3/500
+// for  3 MHz clock,  3/1000 = 3/1000
 
 #define EMIT_PS 1
 
@@ -105,7 +105,7 @@ void emit_init(int alt, PinName pin, PinMode mode)
        TPM1->MOD              = TPM_MOD_MOD(0xFFFF);
 
        TPM1->CONTROLS[0].CnSC = TPM_CnSC_CHF_MASK    // clear flag
-                              | TPM_CnSC_MSB_MASK    // set output highon match,
+                              | TPM_CnSC_MSB_MASK    // set output high on match,
                               | TPM_CnSC_ELSB_MASK   // cleared on overflow
                               | TPM_CnSC_ELSA_MASK;  // ..
 
index e0d27332be8b03519779f315872141f2dd68537c..fc507ef8a01042af0668f7c9ad9aeb071eff8ffb 100644 (file)
@@ -13,11 +13,11 @@ extern "C" {
 /* Initialization */
 void time_init(void);
 
-/* Time conversino functions */
+/* Time conversion functions */
 uint64_t time_to_world(uint64_t local);
 uint64_t time_to_local(uint64_t world);
 
-/* External time syncronization */ 
+/* External time synchronization */
 void time_ext_init(uint64_t local, uint64_t world);
 void time_ext_sync(uint64_t local, uint64_t world);
 
index cd9439832c85b534025f196e2350ce79176163f0..275e7857c0f5aae970a331ff89d271c146267b91 100644 (file)
@@ -45,7 +45,7 @@ typedef struct {
        uint16_t control;  // Message control bits
        uint16_t device;   // Device ID to use
        ntime_t  world;    // World time (since 1970)
-       ntime_t  start;    // Transmit start time 
+       ntime_t  start;    // Transmit start time
        ntime_t  period;   // Transmit period
 } init_msg_t;
 
diff --git a/hw2/readme.txt b/hw2/readme.txt
new file mode 100644 (file)
index 0000000..18e27ad
--- /dev/null
@@ -0,0 +1,22 @@
+Primary mbed:
+    main.cpp        - Primary program to control mbed
+    main_time.[ch]  - Time synchronization functions
+    main_comm.[ch]  - Serial communication functions
+    main_emit.[ch]  - Periodic signal generation functions
+
+Testing mbed:
+    tester.cpp      - Mbed 3 testing program
+
+Host control:
+    control.c       - Linux program to control primary mbeds
+
+Miscellaneous:
+    examples.cpp    - Device testing routines (not used)
+
+Common files:
+    messages.[ch]   - Message definitions for mbed <--> {bbb,host}
+
+KL46Z Libraries:
+    serial_dma.[ch] - DMA based serial I/O (not used)
+    serial_irq.[ch] - Interrupt driven serial I/O
+    timer_dma.[ch]  - Time stamping using DMA and PIT
index 0f5106d8bda598b8bcbb0b91c55a443f6260a006..2d4b70d24877d5b1d4445ebe01f85a304bf1bfed 100644 (file)
@@ -125,19 +125,6 @@ void sirq_debug(sirq_t *port)
        sirq_printf("rcv  - wix:%03x rix:%03x\r\n", port->rcv.wix, port->rcv.rix);\r
        sirq_printf("irq  - ??\r\n");\r
        sirq_printf("uart - ??\r\n");\r
-\r
-       // __IO uint8_t BDH;     \r
-       // __IO uint8_t BDL;     \r
-       // __IO uint8_t C1;      \r
-       // __IO uint8_t C2;      \r
-       // __IO uint8_t S1;      \r
-       // __IO uint8_t S2;      \r
-       // __IO uint8_t C3;      \r
-       // __IO uint8_t D;       \r
-       // __IO uint8_t MA1;     \r
-       // __IO uint8_t MA2;     \r
-       // __IO uint8_t C4;      \r
-       // __IO uint8_t C5;      \r
 }\r
 \r
 /* Write ASCII data to the output queue */\r