better error handling
This commit is contained in:
parent
f53177f5d7
commit
3a0b7f66c5
|
@ -37,7 +37,7 @@ ioportid_t getHwPort(const char *msg, brain_pin_e brainPin) {
|
||||||
if (brainPin == GPIO_UNASSIGNED)
|
if (brainPin == GPIO_UNASSIGNED)
|
||||||
return GPIO_NULL;
|
return GPIO_NULL;
|
||||||
if (brainPin > GPIO_UNASSIGNED || brainPin < 0) {
|
if (brainPin > GPIO_UNASSIGNED || brainPin < 0) {
|
||||||
firmwareError(CUSTOM_ERR_INVALID_PIN, "%s: Invalid brain_pin_e: %d", msgbrainPin);
|
firmwareError(CUSTOM_ERR_INVALID_PIN, "%s: Invalid brain_pin_e: %d", msg, brainPin);
|
||||||
return GPIO_NULL;
|
return GPIO_NULL;
|
||||||
}
|
}
|
||||||
return PORTS[brainPin / PORT_SIZE];
|
return PORTS[brainPin / PORT_SIZE];
|
||||||
|
|
Loading…
Reference in New Issue