power up/down working for broadcast

This commit is contained in:
2025-06-25 14:49:12 -05:00
parent 2ff7291c63
commit 372e4941a2
11 changed files with 226 additions and 163 deletions

View File

@@ -176,6 +176,11 @@ void ACCY_service(void)
}
}
}
else
{
// if nothing active, set broadcast
ACCY_setActive(&sys.ports[ACCY_PORT_INDUCTION], CHANNEL_A);
}
}
@@ -188,6 +193,13 @@ void ACCY_setActiveChannel(AccyChannelId_t channel)
void ACCY_next(void)
{
if (sys.activeAccessory == NULL)
{
ACCY_setActive(&sys.ports[ACCY_PORT_INDUCTION], CHANNEL_A);
return;
}
// cycle through accessories and channels to find the next available
AccessoryPortId_t currentPort = sys.activeAccessory->portId;
AccyChannelId_t currentChannel = sys.activeAccessory->activeChannel;
@@ -367,6 +379,9 @@ void ACCY_Init(void)
sys.ports[ACCY_PORT_1].idVoltage = &sys.adc.V_ID1;
sys.ports[ACCY_PORT_2].idVoltage = &sys.adc.V_ID2;
sys.activeAccessory = NULL;
sys.nextAccessory = NULL;
}
void ACCY_Update(void)