only:minor simplification

This commit is contained in:
rusefillc 2023-11-24 14:35:56 -05:00
parent c886c8b3d5
commit 7c68d7a304
1 changed files with 2 additions and 2 deletions

View File

@ -57,12 +57,12 @@ bool brain_pin_markUsed(Gpio brainPin, const char *msg) {
if (index < 0)
return true;
if (engine->pinRepository.getBrainUsedPin(index) != NULL) {
if (engine->pinRepository.getBrainUsedPin(index) != nullptr) {
// hwPortname and share a buffer behind the scenes, even while they probably never use it for different
// values here let's have an explicit second buffer to make this more reliable
char physicalPinName[32];
strncpy(physicalPinName, hwPhysicalPinName(brainPin), sizeof(physicalPinName) - 1);
firmwareError(ObdCode::CUSTOM_ERR_PIN_ALREADY_USED_1, "Pin \"%s\" (%s) required by \"%s\" but is used by \"%s\"",
criticalError("Pin \"%s\" (%s) required by \"%s\" but is used by \"%s\"",
hwPortname(brainPin),
physicalPinName,
msg,