Shift Device/Action enums to avclan.h

This commit is contained in:
Allen Hill
2026-07-06 15:50:09 -07:00
parent 25e425a601
commit 554fca0582
9 changed files with 261 additions and 210 deletions
+12 -5
View File
@@ -66,6 +66,8 @@ int main() {
uint8_t seqIdx = 0; // current index in data_tmp
Bus phy;
using enum Action;
using enum Device;
Peripheral<CDChanger> peripheral(phy, 0x360);
using Error = decltype(peripheral)::Error;
using Print = Frame::Print;
@@ -139,22 +141,27 @@ int main() {
out->is_unicast = true;
out->peripheral_addr = peripheral.controller();
{
const uint8_t beep[] = {0x00, dev_CD_CHANGER, dev_BEEP_SPEAKERS,
0x60, 0x01};
const uint8_t beep[] = {0x00, to_underlying(CD_CHANGER),
to_underlying(BEEP_SPEAKERS), 0x60, 0x01};
out->length = sizeof(beep);
memcpy(out->data, beep, sizeof(beep));
}
out->reaction = 1;
outgoing.push(std::move(out));
}
} else
RS232_Print("!! Cache empty; unable to queue beep request");
break;
case 'P':
if (auto out = cache.pop()) {
out->is_unicast = true;
out->peripheral_addr = peripheral.controller();
{
const uint8_t play[] = {0x00, dev_COMM_CTRL, dev_COMM_v1,
Ejection, dev_CD_CHANGER, 0x01};
const uint8_t play[] = {0x00,
to_underlying(COMM_CTRL),
to_underlying(COMM_v1),
to_underlying(Ejection),
to_underlying(CD_CHANGER),
0x01};
out->length = sizeof(play);
memcpy(out->data, play, sizeof(play));
}