only:hellen121nissan

hw_qc_mode
This commit is contained in:
rusefi 2024-07-07 13:44:38 -04:00
parent 97acf15a41
commit 3152ae4d4a
3 changed files with 7 additions and 2 deletions

View File

@ -244,6 +244,7 @@ void processCanQcBenchTest(const CANRxFrame& frame) {
if (command == bench_test_io_control_e::CAN_BENCH_GET_COUNT) {
sendOutBoardMeta();
} else if (command == bench_test_io_control_e::CAN_QC_OUTPUT_CONTROL_SET) {
// see also "bench_setpin" console command
qcDirectPinControlMode = true;
setPin(frame, 1);
} else if (command == bench_test_io_control_e::CAN_QC_OUTPUT_CONTROL_CLEAR) {

View File

@ -348,6 +348,7 @@ static void benchSetPinValue(const char *pinName, int bit) {
if (pin == Gpio::Invalid) {
return;
}
// low-level API which does not care about 'qcDirectPinControlMode'
palWritePad(getHwPort("write", pin), getHwPin("write", pin), bit);
efiPrintf("pin %s set value", hwPortname(pin));
readPin(pinName);
@ -813,6 +814,10 @@ void initSettings() {
addConsoleActionS("bench_clearpin", benchClearPin);
addConsoleActionS("bench_setpin", benchSetPin);
addConsoleActionS("readpin", readPin);
addConsoleAction("hw_qc_mode", [](){
extern bool qcDirectPinControlMode;
qcDirectPinControlMode = true;
});
#if HAL_USE_ADC
addConsoleAction("adc_report", printFullAdcReport);

View File

@ -578,9 +578,8 @@ void OutputPin::resetToggleStats() {
}
#endif // EFI_SIMULATOR
extern bool qcDirectPinControlMode;
void OutputPin::setValue(const char *msg, int logicValue, bool isForce) {
extern bool qcDirectPinControlMode;
UNUSED(msg);
if ((qcDirectPinControlMode || getOutputOnTheBenchTest() == this) && !isForce) {
return;