basic hw in the loop - pwm self validation #2028

This commit is contained in:
rusefillc 2020-12-07 20:42:47 -05:00
parent 6b80297245
commit 96c29840ce
4 changed files with 11 additions and 4 deletions

View File

@ -233,7 +233,7 @@ void startLogicAnalyzerPins() {
void stopLogicAnalyzerPins() {
for (int index = 0; index < LOGIC_ANALYZER_CHANNEL_COUNT; index++) {
brain_pin_e brainPin = CONFIG(logicAnalyzerPins)[index];
brain_pin_e brainPin = activeConfiguration.logicAnalyzerPins[index];
if (brainPin != GPIO_UNASSIGNED) {
stopDigitalCapture("wave input", brainPin);

View File

@ -219,7 +219,7 @@ void stopDigitalCapture(const char *msg, brain_pin_e brainPin) {
if (driver == NULL) {
return;
}
efiSetPadUnused(brainPin);
int regSize = registeredIcus.size;
for (int i = 0; i < regSize; i++) {
if (registeredIcus.elements[i].driver == driver) {

View File

@ -151,6 +151,7 @@ void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->canReadEnabled = false;
}
// todo: we usually use 'activeConfiguration' for 'stopPin' why this unusual code here?
// this is related to #1375
static brain_pin_e currentTxPin = GPIO_UNASSIGNED;
static brain_pin_e currentRxPin = GPIO_UNASSIGNED;

View File

@ -304,8 +304,14 @@ void stopSpi(spi_device_e device) {
*/
void applyNewHardwareSettings(void) {
// all 'stop' methods need to go before we begin starting pins
/**
* All 'stop' methods need to go before we begin starting pins.
*
* We take settings from 'activeConfiguration' not 'engineConfiguration' while stopping hardware.
* Some hardware is restart unconditionally on change of parameters while for some systems we make extra effort and restart only
* relevant settings were changes.
*
*/
ButtonDebounce::stopConfigurationList();
#if EFI_SHAFT_POSITION_INPUT