Kline: do init from initHardware() and stop/start from applyNewHardwareSettings() (#5125)

This commit is contained in:
Andrey G 2023-02-24 00:05:59 +03:00 committed by GitHub
parent 3247c15838
commit ddab1536de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 5 deletions

View File

@ -261,6 +261,8 @@ void applyNewHardwareSettings() {
stopCanPins();
#endif /* EFI_CAN_SUPPORT */
stopKLine();
#if EFI_AUX_SERIAL
stopAuxSerialPins();
#endif /* EFI_AUX_SERIAL */
@ -343,7 +345,7 @@ void applyNewHardwareSettings() {
startAuxSerialPins();
#endif /* EFI_AUX_SERIAL */
initKLine();
startKLine();
#if EFI_HIP_9011
@ -605,6 +607,8 @@ void initHardware() {
initSent();
#endif
initKLine();
calcFastAdcIndexes();
startHardware();

View File

@ -17,15 +17,15 @@ void kLineThread(void*)
chnReadTimeout(klDriver, &ch, 1, KLINE_READ_TIMEOUT);
// to begin with just write byte to console
if (ch != 0) {
efiPrintf("kline: %c", ch);
efiPrintf("kline: 0x%02x", ch);
totalBytes++;
}
}
}
#endif
void initKLine() {
/* currently useless because all settings are hardcoded */
void startKLine() {
#ifdef EFI_KLINE
#if EFI_PROD_CODE
efiSetPadMode("K-Line UART RX", KLINE_SERIAL_DEVICE_RX, PAL_MODE_ALTERNATE(TS_SERIAL_AF));
@ -49,3 +49,19 @@ void initKLine() {
});
#endif
}
/* currently useless because all settings are hardcoded */
void stopKLine() {
#ifdef EFI_KLINE
#if EFI_PROD_CODE
efiSetPadUnused(KLINE_SERIAL_DEVICE_RX);
efiSetPadUnused(KLINE_SERIAL_DEVICE_TX);
#endif /* EFI_PROD_CODE */
#endif
}
void initKLine() {
#ifdef EFI_KLINE
startKLine();
#endif
}

View File

@ -11,4 +11,8 @@
#define KLINE_READ_TIMEOUT 50
void initKLine();
void initKLine();
/* Stop/Start for config update */
void startKLine();
void stopKLine();