basic hw in the loop - pwm self validation #2028

This commit is contained in:
rusefillc 2020-12-07 20:01:05 -05:00
parent 5bae56a32a
commit 6712c63160
3 changed files with 21 additions and 10 deletions

View File

@ -120,7 +120,7 @@ static void initWave(const char *name, int index) {
reader->hw->setPeriodCallback((VoidInt)(void*) waIcuPeriodCallback, (void*) reader); reader->hw->setPeriodCallback((VoidInt)(void*) waIcuPeriodCallback, (void*) reader);
} }
print("wave%d input on %s\r\n", index, hwPortname(brainPin)); scheduleMsg(logger, "wave%d input on %s", index, hwPortname(brainPin));
} }
WaveReader::WaveReader() { WaveReader::WaveReader() {
@ -221,21 +221,24 @@ void initWaveAnalyzer(Logging *sharedLogger) {
return; return;
} }
addConsoleAction("waveinfo", showWaveInfo);
}
void startLogicAnalyzerPins() {
initWave(PROTOCOL_WA_CHANNEL_1, 0); initWave(PROTOCOL_WA_CHANNEL_1, 0);
initWave(PROTOCOL_WA_CHANNEL_2, 1); initWave(PROTOCOL_WA_CHANNEL_2, 1);
initWave(PROTOCOL_WA_CHANNEL_3, 2); initWave(PROTOCOL_WA_CHANNEL_3, 2);
initWave(PROTOCOL_WA_CHANNEL_4, 3); initWave(PROTOCOL_WA_CHANNEL_4, 3);
addConsoleAction("waveinfo", showWaveInfo);
} }
void startLogicAnalyzerPins(void) { void stopLogicAnalyzerPins() {
for (int index = 0; index < LOGIC_ANALYZER_CHANNEL_COUNT; index++) {
brain_pin_e brainPin = CONFIG(logicAnalyzerPins)[index];
} if (brainPin != GPIO_UNASSIGNED) {
void stopLogicAnalyzerPins(void) {
}
}
} }
#endif /* EFI_LOGIC_ANALYZER */ #endif /* EFI_LOGIC_ANALYZER */

View File

@ -51,8 +51,8 @@ public:
}; };
void initWaveAnalyzer(Logging *sharedLogger); void initWaveAnalyzer(Logging *sharedLogger);
void startLogicAnalyzerPins(void); void startLogicAnalyzerPins();
void stopLogicAnalyzerPins(void); void stopLogicAnalyzerPins();
void printWave(Logging *logging); void printWave(Logging *logging);
void showWaveInfo(void); void showWaveInfo(void);

View File

@ -23,6 +23,7 @@
#include "yaw_rate_sensor.h" #include "yaw_rate_sensor.h"
#include "pin_repository.h" #include "pin_repository.h"
#include "max31855.h" #include "max31855.h"
#include "logic_analyzer.h"
#include "smart_gpio.h" #include "smart_gpio.h"
#include "accelerometer.h" #include "accelerometer.h"
#include "eficonsole.h" #include "eficonsole.h"
@ -343,6 +344,10 @@ void applyNewHardwareSettings(void) {
stopVSSPins(); stopVSSPins();
#endif /* EFI_VEHICLE_SPEED */ #endif /* EFI_VEHICLE_SPEED */
#if EFI_LOGIC_ANALYZER
stopLogicAnalyzerPins();
#endif /* EFI_LOGIC_ANALYZER */
#if EFI_AUX_PID #if EFI_AUX_PID
stopAuxPins(); stopAuxPins();
#endif /* EFI_AUX_PID */ #endif /* EFI_AUX_PID */
@ -420,6 +425,9 @@ void applyNewHardwareSettings(void) {
#if EFI_BOOST_CONTROL #if EFI_BOOST_CONTROL
startBoostPin(); startBoostPin();
#endif #endif
#if EFI_LOGIC_ANALYZER
startLogicAnalyzerPins();
#endif /* EFI_LOGIC_ANALYZER */
#if EFI_AUX_PID #if EFI_AUX_PID
startAuxPins(); startAuxPins();
#endif /* EFI_AUX_PID */ #endif /* EFI_AUX_PID */