]> mj.ucw.cz Git - home-hw.git/commitdiff
BSB: Cleanup
authorMartin Mares <mj@ucw.cz>
Wed, 26 Feb 2020 21:50:12 +0000 (22:50 +0100)
committerMartin Mares <mj@ucw.cz>
Wed, 26 Feb 2020 21:50:12 +0000 (22:50 +0100)
bsb/README
bsb/firmware/interface.h
bsb/firmware/main.c

index 1c6fcceda84a933680da31c3c23f86c298887ef8..aaf8bbd57a3abee8dff1d8c06b6ab18c9d6cbe68 100644 (file)
@@ -28,3 +28,7 @@ RXD3 - BSB            | PB11           PA8 |
                        | GND           PB13 |
                        | GND           PB12 |
                        +--------------------+
+
+The green LED flashes when we receive a packet.
+The yellow LED shines when a transmit is in progress (including waiting
+for idle bus and for the reply).
index c2abf053b22a87c5fb61dd698ce96abbb96d5149..3f8b42b47f1ded6a8b522fdbb9269673afd6faaa 100644 (file)
@@ -77,15 +77,6 @@ struct bsb_stats {
  *             16-bit CRC
  */
 
-enum bsb_address {
-       BSB_ADDR_BOILER = 0,
-       BSB_ADDR_EXT_BOARD = 3,
-       BSB_ADDR_ROOM1 = 6,
-       BSB_ADDR_ROOM2 = 7,
-       BSB_ADDR_GATEWAY = 0x42,
-       BSB_ADDR_BROADCAST = 0x7f,
-};
-
 // Positions of fields in a frame
 enum bsb_frame {
        BF_SOF,
@@ -95,6 +86,15 @@ enum bsb_frame {
        BF_OP,
 };
 
+enum bsb_address {
+       BSB_ADDR_BOILER = 0,
+       BSB_ADDR_EXT_BOARD = 3,
+       BSB_ADDR_ROOM1 = 6,
+       BSB_ADDR_ROOM2 = 7,
+       BSB_ADDR_GATEWAY = 0x42,        // That's us
+       BSB_ADDR_BROADCAST = 0x7f,
+};
+
 enum bsb_op {
        BSB_OP_REQUEST_INFO = 1,
        BSB_OP_INFO = 2,
index 84fce5401878148e2dcbbf1d0b69a101d8ef28fd..bb0c48e53bf140ae98ade0e46e9da73180760dbf 100644 (file)
@@ -432,7 +432,7 @@ static void bsb_send(byte *buf, uint len)
 static void bsb_check_reply(void)
 {
        // Match received frame in bsb_rx_status_and_frame to expected replies
-       // and set the status byte in byte 0.
+       // and set the status in byte 0.
 
        byte *frame = bsb_rx_status_and_frame + 1;
        // XXX: This might be executed too fast, so we can still be in TX_STATE_SENT