|
|
|
@ -117,14 +117,17 @@ bool MultiSplitFlap_Display(char sentence[]){ |
|
|
|
bool MultiSplitFlap_SetHardwareIdentifier(SetupIdentifier_t id, HardwareIdentifier_t hwId){ |
|
|
|
bool MultiSplitFlap_SetHardwareIdentifier(SetupIdentifier_t id, HardwareIdentifier_t hwId){ |
|
|
|
// number too high (not that many split flaps can be added to the combination)
|
|
|
|
// number too high (not that many split flaps can be added to the combination)
|
|
|
|
if(id >= NUM_FLAPS){ |
|
|
|
if(id >= NUM_FLAPS){ |
|
|
|
|
|
|
|
McuLog_error("MultiSplitFlap_SetHardwareIdentifier failed because splitflap with setup id <%i> cannot exist.", id); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
// number too high (not that many split flaps were added added to the combination)
|
|
|
|
// number too high (not that many split flaps were added added to the combination)
|
|
|
|
if(id >= MultiSplitFlap_GetAmountOfAddedSplitFlaps()){ |
|
|
|
if(id >= MultiSplitFlap_GetAmountOfAddedSplitFlaps()){ |
|
|
|
|
|
|
|
McuLog_error("MultiSplitFlap_SetHardwareIdentifier failed because splitflap with setup id <%i> was not yet added.", id); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
// number negative
|
|
|
|
// number negative
|
|
|
|
if(id < 0){ |
|
|
|
if(id < 0){ |
|
|
|
|
|
|
|
McuLog_error("MultiSplitFlap_SetHardwareIdentifier failed because given setup id <%i> is negative.", id); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -132,6 +135,8 @@ bool MultiSplitFlap_SetHardwareIdentifier(SetupIdentifier_t id, HardwareIdentifi |
|
|
|
SF_Handle_t sfHandle = (SF_Handle_t)(getItem(*flapDict, flapKeys[id])); |
|
|
|
SF_Handle_t sfHandle = (SF_Handle_t)(getItem(*flapDict, flapKeys[id])); |
|
|
|
// set hardware identifier
|
|
|
|
// set hardware identifier
|
|
|
|
SF_SetHardwareIdentifier(sfHandle, hwId); |
|
|
|
SF_SetHardwareIdentifier(sfHandle, hwId); |
|
|
|
|
|
|
|
// log
|
|
|
|
|
|
|
|
McuLog_info("MultiSplitFlap_SetHardwareIdentifier successful. SetupId=%i HardwareId=%i.", id, hwId); |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|