diff --git a/CMakeLists.txt b/CMakeLists.txt index d84e132..da54307 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,12 @@ elseif("nimble" IN_LIST BUILD_COMPONENTS OR "__nimble" IN_LIST __hack_component_ ) endif() -if("arduino" IN_LIST BUILD_COMPONENTS OR __hack_component_targets MATCHES "__idf_arduino") - list(APPEND ESP_NIMBLE_PRIV_REQUIRES - arduino - ) -endif() +# Dont use arduino bullshit +#if("arduino" IN_LIST BUILD_COMPONENTS OR __hack_component_targets MATCHES "__idf_arduino") +# list(APPEND ESP_NIMBLE_PRIV_REQUIRES +# arduino +# ) +#endif() idf_component_register( REQUIRED_IDF_TARGETS @@ -57,3 +58,7 @@ idf_component_register( ${ESP_NIMBLE_PRIV_REQUIRES} ) +target_compile_options(${COMPONENT_TARGET} + PUBLIC + -DDONT_USE_ARDUINO_BULLSHIT +) diff --git a/src/FreeRTOS.cpp b/src/FreeRTOS.cpp index 1c398cb..2c56e96 100644 --- a/src/FreeRTOS.cpp +++ b/src/FreeRTOS.cpp @@ -155,7 +155,7 @@ void FreeRTOS::Semaphore::give() { } else { xSemaphoreGive(m_semaphore); } -// #ifdef ARDUINO_ARCH_ESP32 +// #if defined(ARDUINO_ARCH_ESP32) && !defined(DONT_USE_ARDUINO_BULLSHIT) // FreeRTOS::sleep(10); // #endif diff --git a/src/HIDTypes.h b/src/HIDTypes.h index 726b84b..57ca970 100644 --- a/src/HIDTypes.h +++ b/src/HIDTypes.h @@ -45,7 +45,7 @@ /* of data as per HID Class standard */ /* Main items */ -#ifdef ARDUINO_ARCH_ESP32 +#if defined(ARDUINO_ARCH_ESP32) && !defined(DONT_USE_ARDUINO_BULLSHIT) #define HIDINPUT(size) (0x80 | size) #define HIDOUTPUT(size) (0x90 | size) #else diff --git a/src/NimBLECharacteristic.cpp b/src/NimBLECharacteristic.cpp index 39e7edf..7960cc1 100644 --- a/src/NimBLECharacteristic.cpp +++ b/src/NimBLECharacteristic.cpp @@ -473,7 +473,7 @@ NimBLECharacteristicCallbacks* NimBLECharacteristic::getCallbacks() { * @param [in] length The length of the data in bytes. */ 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); NIMBLE_LOGD(LOG_TAG, ">> setValue: length=%d, data=%s, characteristic UUID=%s", length, pHex, getUUID().toString().c_str()); free(pHex); diff --git a/src/NimBLEDevice.cpp b/src/NimBLEDevice.cpp index 6917490..5dde767 100644 --- a/src/NimBLEDevice.cpp +++ b/src/NimBLEDevice.cpp @@ -30,7 +30,7 @@ #include "services/gap/ble_svc_gap.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" #endif @@ -740,7 +740,7 @@ NimBLEAddress NimBLEDevice::getWhiteListAddress(size_t index) { int rc=0; 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. btStarted(); #endif diff --git a/src/NimBLELog.h b/src/NimBLELog.h index 8c13146..e571579 100644 --- a/src/NimBLELog.h +++ b/src/NimBLELog.h @@ -12,7 +12,7 @@ #if defined(CONFIG_BT_ENABLED) -#ifdef ARDUINO_ARCH_ESP32 +#if defined(ARDUINO_ARCH_ESP32) && !defined(DONT_USE_ARDUINO_BULLSHIT) #include "syscfg/syscfg.h" #include "modlog/modlog.h" @@ -63,4 +63,4 @@ #endif /*ARDUINO_ARCH_ESP32*/ #endif /*CONFIG_BT_ENABLED*/ -#endif /*MAIN_NIMBLELOG_H_*/ \ No newline at end of file +#endif /*MAIN_NIMBLELOG_H_*/ diff --git a/src/NimBLEServer.cpp b/src/NimBLEServer.cpp index ca4729d..718e3ac 100644 --- a/src/NimBLEServer.cpp +++ b/src/NimBLEServer.cpp @@ -174,7 +174,7 @@ void NimBLEServer::start() { 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(); #endif /*** Future use ***