From e4e0824f57fc8edccd24490247a75f743ddd9eac Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 7 Aug 2024 12:01:08 -0700 Subject: [PATCH] misc format/comment cleanups --- firmware/controllers/algo/engine.cpp | 2 +- firmware/hw_layer/adc/adc_inputs.cpp | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 7d51b4c50d..586a28ff9b 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -476,7 +476,7 @@ void Engine::periodicFastCallback() { tachUpdate(); speedoUpdate(); - engine->engineModules.apply_all([](auto & m) { m.onFastCallback(); }); + engineModules.apply_all([](auto & m) { m.onFastCallback(); }); } EngineRotationState * getEngineRotationState() { diff --git a/firmware/hw_layer/adc/adc_inputs.cpp b/firmware/hw_layer/adc/adc_inputs.cpp index db259ba967..ad0a60427d 100644 --- a/firmware/hw_layer/adc/adc_inputs.cpp +++ b/firmware/hw_layer/adc/adc_inputs.cpp @@ -109,12 +109,9 @@ static ADCConversionGroup adcgrpcfgFast = { /* HW dependent part.*/ .cr1 = 0, .cr2 = ADC_CR2_SWSTART, - /** - * here we configure all possible channels for fast mode. Some channels would not actually - * be used hopefully that's fine to configure all possible channels. - * - */ - // sample times for channels 10...18 + // Configure sample time for all channels. We'll only actually use + // one or two (MAP sensors, etc), but setting sample time for unused + // channels doesn't do anything. .smpr1 = ADC_SMPR1_SMP_AN10(ADC_SAMPLING_FAST) | ADC_SMPR1_SMP_AN11(ADC_SAMPLING_FAST) | @@ -122,7 +119,6 @@ static ADCConversionGroup adcgrpcfgFast = { ADC_SMPR1_SMP_AN13(ADC_SAMPLING_FAST) | ADC_SMPR1_SMP_AN14(ADC_SAMPLING_FAST) | ADC_SMPR1_SMP_AN15(ADC_SAMPLING_FAST), - // In this field must be specified the sample times for channels 0...9 .smpr2 = ADC_SMPR2_SMP_AN0(ADC_SAMPLING_FAST) | ADC_SMPR2_SMP_AN1(ADC_SAMPLING_FAST) | @@ -139,10 +135,6 @@ static ADCConversionGroup adcgrpcfgFast = { .sqr1 = 0, // Conversion group sequence 13...16 + sequence length .sqr2 = 0, // Conversion group sequence 7...12 .sqr3 = 0, // Conversion group sequence 1...6 -#if ADC_MAX_CHANNELS_COUNT > 16 - .sqr4 = 0, // Conversion group sequence 19...24 - .sqr5 = 0 // Conversion group sequence 25...30 -#endif /* ADC_MAX_CHANNELS_COUNT */ }; static NO_CACHE adcsample_t fastAdcSampleBuf[ADC_BUF_DEPTH_FAST * ADC_MAX_CHANNELS_COUNT];