remove old config override (#2763)

This commit is contained in:
Matthew Kennedy 2021-05-30 04:31:36 -06:00 committed by GitHub
parent 0e1cdd9334
commit 6d19adb24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 16 deletions

View File

@ -60,6 +60,3 @@ void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void setBoardDefaultConfiguration(void); void setBoardDefaultConfiguration(void);
void setBoardConfigOverrides(void); void setBoardConfigOverrides(void);
// TODO: remove me
#define CONFIG_OVERRIDE(__x__) CONFIG(__x__)

View File

@ -136,7 +136,7 @@ public:
} }
void ThreadTask() override { void ThreadTask() override {
CANDriver* device = detectCanDevice(CONFIG_OVERRIDE(canRxPin), CONFIG_OVERRIDE(canTxPin)); CANDriver* device = detectCanDevice(CONFIG(canRxPin), CONFIG(canTxPin));
if (!device) { if (!device) {
warning(CUSTOM_ERR_CAN_CONFIGURATION, "CAN configuration issue"); warning(CUSTOM_ERR_CAN_CONFIGURATION, "CAN configuration issue");
@ -171,8 +171,8 @@ static void canInfo(void) {
return; return;
} }
efiPrintf("CAN TX %s", hwPortname(CONFIG_OVERRIDE(canTxPin))); efiPrintf("CAN TX %s", hwPortname(CONFIG(canTxPin)));
efiPrintf("CAN RX %s", hwPortname(CONFIG_OVERRIDE(canRxPin))); efiPrintf("CAN RX %s", hwPortname(CONFIG(canRxPin)));
efiPrintf("type=%d canReadEnabled=%s canWriteEnabled=%s period=%d", engineConfiguration->canNbcType, efiPrintf("type=%d canReadEnabled=%s canWriteEnabled=%s period=%d", engineConfiguration->canNbcType,
boolToString(engineConfiguration->canReadEnabled), boolToString(engineConfiguration->canWriteEnabled), boolToString(engineConfiguration->canReadEnabled), boolToString(engineConfiguration->canWriteEnabled),
engineConfiguration->canSleepPeriodMs); engineConfiguration->canSleepPeriodMs);
@ -211,8 +211,8 @@ void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// Store pins so we can disable later // Store pins so we can disable later
currentTxPin = CONFIG_OVERRIDE(canTxPin); currentTxPin = CONFIG(canTxPin);
currentRxPin = CONFIG_OVERRIDE(canRxPin); currentRxPin = CONFIG(canRxPin);
efiSetPadMode("CAN TX", currentTxPin, PAL_MODE_ALTERNATE(EFI_CAN_TX_AF)); efiSetPadMode("CAN TX", currentTxPin, PAL_MODE_ALTERNATE(EFI_CAN_TX_AF));
efiSetPadMode("CAN RX", currentRxPin, PAL_MODE_ALTERNATE(EFI_CAN_RX_AF)); efiSetPadMode("CAN RX", currentRxPin, PAL_MODE_ALTERNATE(EFI_CAN_RX_AF));
@ -222,8 +222,8 @@ void initCan(void) {
addConsoleAction("caninfo", canInfo); addConsoleAction("caninfo", canInfo);
isCanEnabled = isCanEnabled =
(isBrainPinValid(CONFIG_OVERRIDE(canTxPin))) && // both pins are set... (isBrainPinValid(CONFIG(canTxPin))) && // both pins are set...
(isBrainPinValid(CONFIG_OVERRIDE(canRxPin))) && (isBrainPinValid(CONFIG(canRxPin))) &&
(CONFIG(canWriteEnabled) || CONFIG(canReadEnabled)) ; // ...and either read or write is enabled (CONFIG(canWriteEnabled) || CONFIG(canReadEnabled)) ; // ...and either read or write is enabled
// nothing to do if we aren't enabled... // nothing to do if we aren't enabled...
@ -232,13 +232,13 @@ void initCan(void) {
} }
// Validate pins // Validate pins
if (!isValidCanTxPin(CONFIG_OVERRIDE(canTxPin))) { if (!isValidCanTxPin(CONFIG(canTxPin))) {
firmwareError(CUSTOM_OBD_70, "invalid CAN TX %s", hwPortname(CONFIG_OVERRIDE(canTxPin))); firmwareError(CUSTOM_OBD_70, "invalid CAN TX %s", hwPortname(CONFIG(canTxPin)));
return; return;
} }
if (!isValidCanRxPin(CONFIG_OVERRIDE(canRxPin))) { if (!isValidCanRxPin(CONFIG(canRxPin))) {
firmwareError(CUSTOM_OBD_70, "invalid CAN RX %s", hwPortname(CONFIG_OVERRIDE(canRxPin))); firmwareError(CUSTOM_OBD_70, "invalid CAN RX %s", hwPortname(CONFIG(canRxPin)));
return; return;
} }
@ -272,8 +272,8 @@ void initCan(void) {
// Plumb CAN device to tx system // Plumb CAN device to tx system
CanTxMessage::setDevice(detectCanDevice( CanTxMessage::setDevice(detectCanDevice(
CONFIG_OVERRIDE(canRxPin), CONFIG(canRxPin),
CONFIG_OVERRIDE(canTxPin) CONFIG(canTxPin)
)); ));
// fire up threads, as necessary // fire up threads, as necessary