Removed arduino bullshit from nimble

This commit is contained in:
2021-05-28 10:46:37 +02:00
parent d3a0f95aaf
commit df4eb9f7d8
7 changed files with 18 additions and 13 deletions

View File

@ -14,11 +14,12 @@ elseif("nimble" IN_LIST BUILD_COMPONENTS OR "__nimble" IN_LIST __hack_component_
) )
endif() endif()
if("arduino" IN_LIST BUILD_COMPONENTS OR __hack_component_targets MATCHES "__idf_arduino") # Dont use arduino bullshit
list(APPEND ESP_NIMBLE_PRIV_REQUIRES #if("arduino" IN_LIST BUILD_COMPONENTS OR __hack_component_targets MATCHES "__idf_arduino")
arduino # list(APPEND ESP_NIMBLE_PRIV_REQUIRES
) # arduino
endif() # )
#endif()
idf_component_register( idf_component_register(
REQUIRED_IDF_TARGETS REQUIRED_IDF_TARGETS
@ -57,3 +58,7 @@ idf_component_register(
${ESP_NIMBLE_PRIV_REQUIRES} ${ESP_NIMBLE_PRIV_REQUIRES}
) )
target_compile_options(${COMPONENT_TARGET}
PUBLIC
-DDONT_USE_ARDUINO_BULLSHIT
)

View File

@ -155,7 +155,7 @@ void FreeRTOS::Semaphore::give() {
} else { } else {
xSemaphoreGive(m_semaphore); xSemaphoreGive(m_semaphore);
} }
// #ifdef ARDUINO_ARCH_ESP32 // #if defined(ARDUINO_ARCH_ESP32) && !defined(DONT_USE_ARDUINO_BULLSHIT)
// FreeRTOS::sleep(10); // FreeRTOS::sleep(10);
// #endif // #endif

View File

@ -45,7 +45,7 @@
/* of data as per HID Class standard */ /* of data as per HID Class standard */
/* Main items */ /* Main items */
#ifdef ARDUINO_ARCH_ESP32 #if defined(ARDUINO_ARCH_ESP32) && !defined(DONT_USE_ARDUINO_BULLSHIT)
#define HIDINPUT(size) (0x80 | size) #define HIDINPUT(size) (0x80 | size)
#define HIDOUTPUT(size) (0x90 | size) #define HIDOUTPUT(size) (0x90 | size)
#else #else

View File

@ -473,7 +473,7 @@ NimBLECharacteristicCallbacks* NimBLECharacteristic::getCallbacks() {
* @param [in] length The length of the data in bytes. * @param [in] length The length of the data in bytes.
*/ */
void NimBLECharacteristic::setValue(const uint8_t* data, size_t length) { void NimBLECharacteristic::setValue(const uint8_t* data, size_t length) {
#if CONFIG_LOG_DEFAULT_LEVEL > 3 || (ARDUINO_ARCH_ESP32 && CORE_DEBUG_LEVEL >= 4) #if CONFIG_LOG_DEFAULT_LEVEL > 3 || (ARDUINO_ARCH_ESP32 && !defined(DONT_USE_ARDUINO_BULLSHIT) && CORE_DEBUG_LEVEL >= 4)
char* pHex = NimBLEUtils::buildHexData(nullptr, data, length); char* pHex = NimBLEUtils::buildHexData(nullptr, data, length);
NIMBLE_LOGD(LOG_TAG, ">> setValue: length=%d, data=%s, characteristic UUID=%s", length, pHex, getUUID().toString().c_str()); NIMBLE_LOGD(LOG_TAG, ">> setValue: length=%d, data=%s, characteristic UUID=%s", length, pHex, getUUID().toString().c_str());
free(pHex); free(pHex);

View File

@ -30,7 +30,7 @@
#include "services/gap/ble_svc_gap.h" #include "services/gap/ble_svc_gap.h"
#include "services/gatt/ble_svc_gatt.h" #include "services/gatt/ble_svc_gatt.h"
#ifdef CONFIG_ENABLE_ARDUINO_DEPENDS #if defined(CONFIG_ENABLE_ARDUINO_DEPENDS) && !defined(DONT_USE_ARDUINO_BULLSHIT)
#include "esp32-hal-bt.h" #include "esp32-hal-bt.h"
#endif #endif
@ -740,7 +740,7 @@ NimBLEAddress NimBLEDevice::getWhiteListAddress(size_t index) {
int rc=0; int rc=0;
esp_err_t errRc = ESP_OK; esp_err_t errRc = ESP_OK;
#ifdef CONFIG_ENABLE_ARDUINO_DEPENDS #if defined(CONFIG_ENABLE_ARDUINO_DEPENDS) && !defined(DONT_USE_ARDUINO_BULLSHIT)
// make sure the linker includes esp32-hal-bt.c so ardruino init doesn't release BLE memory. // make sure the linker includes esp32-hal-bt.c so ardruino init doesn't release BLE memory.
btStarted(); btStarted();
#endif #endif

View File

@ -12,7 +12,7 @@
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BT_ENABLED)
#ifdef ARDUINO_ARCH_ESP32 #if defined(ARDUINO_ARCH_ESP32) && !defined(DONT_USE_ARDUINO_BULLSHIT)
#include "syscfg/syscfg.h" #include "syscfg/syscfg.h"
#include "modlog/modlog.h" #include "modlog/modlog.h"

View File

@ -174,7 +174,7 @@ void NimBLEServer::start() {
abort(); abort();
} }
#if CONFIG_LOG_DEFAULT_LEVEL > 3 || (ARDUINO_ARCH_ESP32 && CORE_DEBUG_LEVEL >= 4) #if CONFIG_LOG_DEFAULT_LEVEL > 3 || (ARDUINO_ARCH_ESP32 && !defined(DONT_USE_ARDUINO_BULLSHIT) && CORE_DEBUG_LEVEL >= 4)
ble_gatts_show_local(); ble_gatts_show_local();
#endif #endif
/*** Future use *** /*** Future use ***