Replace use of numeric literals with appropriate enums

This commit is contained in:
Allen Hill
2026-05-04 11:47:34 -07:00
parent d465bb38c7
commit 628ec2de5f
3 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -82,7 +82,7 @@
- The broadcast bit is `1` (floating, no effort) for normal communication - The broadcast bit is `1` (floating, no effort) for normal communication
- For acknowledge bits, the receiver extends the logical '0' of the sync - For acknowledge bits, the receiver extends the logical '0' of the sync
period to the length of a normal bit `0`. Hence, a NAK (bit `1`) is period to the length of a normal bit `0`. Hence, a NAK (bit `1`) is
equivalent to no response. literally the absence of an ACK.
No acknowledge bits are sent for broadcast frames. No acknowledge bits are sent for broadcast frames.
+1
View File
@@ -53,6 +53,7 @@ typedef enum {
} commands; } commands;
typedef enum { typedef enum {
dev_LAN = 0x00,
dev_COMM_CTRL = 0x01, dev_COMM_CTRL = 0x01,
dev_COMM_v1 = 0x11, dev_COMM_v1 = 0x11,
dev_COMM_v2 = 0x12, dev_COMM_v2 = 0x12,
+7 -7
View File
@@ -142,8 +142,8 @@ int main() {
case 'b': case 'b':
case 'B': // Beep case 'B': // Beep
data_tmp[0] = 0x00; data_tmp[0] = 0x00;
data_tmp[1] = 0x63; data_tmp[1] = dev_CD_CHANGER;
data_tmp[2] = 0x29; data_tmp[2] = dev_BEEP_SPEAKERS;
data_tmp[3] = 0x60; data_tmp[3] = 0x60;
data_tmp[4] = 0x01; data_tmp[4] = 0x01;
msg.length = 5; msg.length = 5;
@@ -155,10 +155,10 @@ int main() {
case 'p': case 'p':
CD_Mode = stPlay; CD_Mode = stPlay;
data_tmp[0] = 0x00; data_tmp[0] = 0x00;
data_tmp[1] = 0x01; data_tmp[1] = dev_COMM_CTRL;
data_tmp[2] = 0x11; data_tmp[2] = dev_COMM_v1;
data_tmp[3] = 0x50; data_tmp[3] = Insertion;
data_tmp[4] = 0x63; data_tmp[4] = dev_CD_CHANGER;
msg.length = 5; msg.length = 5;
msg.broadcast = UNICAST; msg.broadcast = UNICAST;
msg.controller_addr = DEVICE_ADDR; msg.controller_addr = DEVICE_ADDR;
@@ -226,7 +226,7 @@ int main() {
} }
} }
} // switch (readkey) } // switch (readkey)
} // if (RS232_RxCharEnd) } // if (RS232_RxCharEnd)
} }
return 0; return 0;
} }