steps towards BT
This commit is contained in:
parent
9a2f6735b3
commit
965f247e11
|
@ -176,17 +176,34 @@ static void setTsSpeed(int value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_BLUETOOTH_SETUP
|
#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)
|
// 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) {
|
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)
|
// 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) {
|
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)
|
// 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) {
|
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 */
|
#endif /* EFI_BLUETOOTH_SETUP */
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size)
|
||||||
CommandHandler console_line_callback;
|
CommandHandler console_line_callback;
|
||||||
|
|
||||||
#if (defined(EFI_CONSOLE_SERIAL_DEVICE) && ! EFI_SIMULATOR )
|
#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
|
#endif
|
||||||
|
|
||||||
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR )
|
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR )
|
||||||
|
@ -227,7 +227,7 @@ bool isCommandLineConsoleReady(void) {
|
||||||
|
|
||||||
#if !defined(EFI_CONSOLE_NO_THREAD)
|
#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_WORKING_AREA(consoleThreadStack, 3 * UTILITY_THREAD_STACK_SIZE);
|
||||||
static THD_FUNCTION(consoleThreadEntryPoint, arg) {
|
static THD_FUNCTION(consoleThreadEntryPoint, arg) {
|
||||||
|
|
Loading…
Reference in New Issue