steps towards BT

This commit is contained in:
rusefi 2020-05-03 01:43:39 -04:00
parent 32b724dba7
commit 6882764221
2 changed files with 22 additions and 5 deletions

View File

@ -176,17 +176,34 @@ static void setTsSpeed(int value) {
}
#if EFI_BLUETOOTH_SETUP
#if defined(CONSOLE_USB_DEVICE)
/**
* we run BT on "primary" channel which is TTL if we have USB console
*/
extern ts_channel_s primaryChannel;
#define BT_CHANNEL primaryChannel
#else
/**
* if we run two TTL channels we run BT on 2nd TTL channel
*/
#define BT_CHANNEL tsChannel
#endif
// Bluetooth HC-05 module initialization start (it waits for disconnect and then communicates to the module)
static void bluetoothHC05(const char *baudRate, const char *name, const char *pinCode) {
bluetoothStart(&tsChannel, BLUETOOTH_HC_05, baudRate, name, pinCode);
bluetoothStart(&BT_CHANNEL, BLUETOOTH_HC_05, baudRate, name, pinCode);
}
// Bluetooth HC-06 module initialization start (it waits for disconnect and then communicates to the module)
static void bluetoothHC06(const char *baudRate, const char *name, const char *pinCode) {
bluetoothStart(&tsChannel, BLUETOOTH_HC_06, baudRate, name, pinCode);
bluetoothStart(&BT_CHANNEL, BLUETOOTH_HC_06, baudRate, name, pinCode);
}
// Bluetooth SPP-C module initialization start (it waits for disconnect and then communicates to the module)
static void bluetoothSPP(const char *baudRate, const char *name, const char *pinCode) {
bluetoothStart(&tsChannel, BLUETOOTH_SPP, baudRate, name, pinCode);
bluetoothStart(&BT_CHANNEL, BLUETOOTH_SPP, baudRate, name, pinCode);
}
#endif /* EFI_BLUETOOTH_SETUP */

View File

@ -131,7 +131,7 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size)
CommandHandler console_line_callback;
#if (defined(EFI_CONSOLE_SERIAL_DEVICE) && ! EFI_SIMULATOR )
static SerialConfig serialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
SerialConfig serialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
#endif
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR )
@ -227,7 +227,7 @@ bool isCommandLineConsoleReady(void) {
#if !defined(EFI_CONSOLE_NO_THREAD)
static ts_channel_s primaryChannel;
ts_channel_s primaryChannel;
static THD_WORKING_AREA(consoleThreadStack, 3 * UTILITY_THREAD_STACK_SIZE);
static THD_FUNCTION(consoleThreadEntryPoint, arg) {