refactoring connectivity

This commit is contained in:
rusefi 2020-06-21 20:47:46 -04:00
parent 57239f6001
commit 294ee55525
4 changed files with 7 additions and 6 deletions

View File

@ -177,7 +177,7 @@
*/
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
/* Configured in efifeatures.h */
#if (TS_UART_DMA_MODE || TS_UART_MODE)
#if (PRIMARY_UART_DMA_MODE || TS_UART_DMA_MODE || TS_UART_MODE)
#define HAL_USE_UART TRUE
#else
#define HAL_USE_UART FALSE

View File

@ -164,7 +164,6 @@ int sr5ReadDataTimeout(ts_channel_s *tsChannel, uint8_t * buffer, int size, int
}
#endif
#if TS_UART_DMA_MODE
#elif TS_UART_MODE
UNUSED(tsChannel);

View File

@ -23,7 +23,7 @@ typedef enum {
} ts_response_format_e;
struct ts_channel_s {
BaseChannel * channel;
BaseChannel * channel = nullptr;
uint8_t writeBuffer[7]; // size(2 bytes) + response(1 byte) + crc32 (4 bytes)
/**
* See 'blockingFactor' in rusefi.ini

View File

@ -222,6 +222,10 @@ bool isUsbSerial(BaseChannel * channel) {
}
BaseChannel * getConsoleChannel(void) {
#if defined(CONSOLE_UART_DEVICE)
return nullptr;
#endif //CONSOLE_UART_DEVICE
#if defined(EFI_CONSOLE_SERIAL_DEVICE)
return (BaseChannel *) EFI_CONSOLE_SERIAL_DEVICE;
#endif /* EFI_CONSOLE_SERIAL_DEVICE */
@ -255,11 +259,9 @@ static THD_FUNCTION(consoleThreadEntryPoint, arg) {
primaryChannel.channel = (BaseChannel *) getConsoleChannel();
#endif
if (primaryChannel.channel != NULL) {
#if EFI_TUNER_STUDIO
runBinaryProtocolLoop(&primaryChannel);
runBinaryProtocolLoop(&primaryChannel);
#endif /* EFI_TUNER_STUDIO */
}
}
#endif /* EFI_CONSOLE_NO_THREAD */