power up/down working for broadcast
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user