reducing potential confusion with "NO PIN" in engine sniffer

https://rusefi.com/forum/viewtopic.php?p=43812#p43812
This commit is contained in:
rusefillc 2022-01-01 12:10:40 -05:00
parent 4111d525d7
commit 9dc4efe993
2 changed files with 10 additions and 2 deletions

View File

@ -171,9 +171,16 @@ static systime_t timeOfPreviousPrintVersion = 0;
#if EFI_PROD_CODE
static void printOutPin(const char *pinName, brain_pin_e hwPin) {
if (isBrainPinValid(hwPin)) {
logger.appendPrintf(PROTOCOL_OUTPIN LOG_DELIMITER "%s@%s" LOG_DELIMITER, pinName, hwPortname(hwPin));
if (hwPin == GPIO_UNASSIGNED || hwPin == GPIO_INVALID) {
return;
}
const char *hwPinName;
if (isBrainPinValid(hwPin)) {
hwPinName = hwPortname(hwPin);
} else {
hwPinName = "smart";
}
logger.appendPrintf(PROTOCOL_OUTPIN LOG_DELIMITER "%s@%s" LOG_DELIMITER, pinName, hwPinName);
}
#endif /* EFI_PROD_CODE */

View File

@ -22,6 +22,7 @@ typedef enum __attribute__ ((__packed__)) {
*/
typedef enum __attribute__ ((__packed__)) {
GPIO_UNASSIGNED = 0,
// only used as return value of 'parseBrainPin' function do we really this this logic special value at all?!
GPIO_INVALID = 1,
GPIOA_0 = 2,