From 88ea6f851b4f7c36b2df3a1a69b52856b5fbdb81 Mon Sep 17 00:00:00 2001 From: Pawel Jalocha Date: Fri, 7 May 2021 21:47:41 +0100 Subject: [PATCH] Correction to compile without Bluetooth serial port --- main/bt.cpp | 8 ++++---- main/hal.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/bt.cpp b/main/bt.cpp index 64e112b..c1d9ab2 100644 --- a/main/bt.cpp +++ b/main/bt.cpp @@ -2,10 +2,10 @@ // ~/esp-idf/components/bt/bluedroid/api/include/esp_spp_api.h // esp_err_t esp_spp_write(uint32_t handle, int len, uint8_t *p_data); -// #ifdef WITH_BT_SPP - #include "hal.h" +#ifdef WITH_BT_SPP + #include "esp_bt.h" #include "esp_bt_main.h" #include "esp_gap_bt_api.h" @@ -19,7 +19,7 @@ static const esp_spp_mode_t esp_spp_mode = ESP_SPP_MODE_CB; static const esp_spp_sec_t sec_mask = ESP_SPP_SEC_AUTHENTICATE; static const esp_spp_role_t role_slave = ESP_SPP_ROLE_SLAVE; -static FIFO BT_SPP_TxFIFO; // buffer for console output to be sent over BT +static FIFO BT_SPP_TxFIFO; // buffer for console output to be sent over BT static FIFO BT_SPP_RxFIFO; // buffer for BT data to be send to the console static uint32_t BT_SPP_Conn = 0; // BT incoming connection handle static uint32_t BT_SPP_TxCong = 0; // congestion control @@ -215,6 +215,6 @@ int BT_SPP_Init(void) return Err; } -// #endif // WITH_BT_SPP +#endif // WITH_BT_SPP // ======================================================================================================== diff --git a/main/hal.h b/main/hal.h index 348dc8a..baa3893 100644 --- a/main/hal.h +++ b/main/hal.h @@ -11,10 +11,6 @@ #include "fifo.h" -#ifdef WITH_BT_SPP -#include "bt.h" -#endif - // ============================================================================================================ #define WITH_ESP32 @@ -31,6 +27,10 @@ #include "config.h" // user options +#ifdef WITH_BT_SPP +#include "bt.h" +#endif + // ============================================================================================================ extern FIFO KeyBuffer;