Fix the bluetooth includes - that is, remove them

This commit is contained in:
Brian Bulkowski
2020-07-26 17:29:59 -07:00
parent f7984498fe
commit 7a5045c3a4
2 changed files with 5 additions and 125 deletions

View File

@ -27,9 +27,7 @@
//#include "esp_ota_ops.h"
//#endif //CONFIG_APP_ROLLBACK_ENABLE
#ifdef CONFIG_BT_ENABLED
#include "esp_bt.h"
#endif //CONFIG_BT_ENABLED
#include <sys/time.h>
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
@ -54,6 +52,8 @@ void __yield()
void yield() __attribute__ ((weak, alias("__yield")));
#if 0
#if CONFIG_AUTOSTART_ARDUINO
extern TaskHandle_t loopTaskHandle;
@ -134,6 +134,8 @@ BaseType_t xTaskCreateUniversal( TaskFunction_t pxTaskCode,
#endif
}
#endif // test, don't think these are needed
unsigned long IRAM_ATTR micros()
{
return (unsigned long) (esp_timer_get_time());
@ -165,87 +167,4 @@ void IRAM_ATTR delayMicroseconds(uint32_t us)
}
}
// BB I don't think any of this will be needed
#if 0
void initVariant() __attribute__((weak));
void initVariant() {}
void init() __attribute__((weak));
void init() {}
bool verifyOta() __attribute__((weak));
bool verifyOta() { return true; }
#ifdef CONFIG_BT_ENABLED
//overwritten in esp32-hal-bt.c
bool btInUse() __attribute__((weak));
bool btInUse(){ return false; }
#endif
void initArduino()
{
#ifdef CONFIG_APP_ROLLBACK_ENABLE
const esp_partition_t *running = esp_ota_get_running_partition();
esp_ota_img_states_t ota_state;
if (esp_ota_get_state_partition(running, &ota_state) == ESP_OK) {
if (ota_state == ESP_OTA_IMG_PENDING_VERIFY) {
if (verifyOta()) {
esp_ota_mark_app_valid_cancel_rollback();
} else {
log_e("OTA verification failed! Start rollback to the previous version ...");
esp_ota_mark_app_invalid_rollback_and_reboot();
}
}
}
#endif
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
#ifdef F_CPU
setCpuFrequencyMhz(F_CPU/1000000);
#endif
#if CONFIG_SPIRAM_SUPPORT
psramInit();
#endif
esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL);
esp_err_t err = nvs_flash_init();
if(err == ESP_ERR_NVS_NO_FREE_PAGES){
const esp_partition_t* partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, NULL);
if (partition != NULL) {
err = esp_partition_erase_range(partition, 0, partition->size);
if(!err){
err = nvs_flash_init();
} else {
log_e("Failed to format the broken NVS partition!");
}
}
}
if(err) {
log_e("Failed to initialize NVS! Error: %u", err);
}
#ifdef CONFIG_BT_ENABLED
if(!btInUse()){
esp_bt_controller_mem_release(ESP_BT_MODE_BTDM);
}
#endif
init();
initVariant();
}
//used by hal log
const char * IRAM_ATTR pathToFileName(const char * path)
{
size_t i = 0;
size_t pos = 0;
char * p = (char *)path;
while(*p){
i++;
if(*p == '/' || *p == '\\'){
pos = i;
}
p++;
}
return path+pos;
}
#endif

View File

@ -50,20 +50,10 @@ void yield(void);
// BB: see how many we can remove
#include "esp32-hal-log.h"
// #include "esp32-hal-matrix.h"
// #include "esp32-hal-uart.h"
#include "esp32-hal-gpio.h"
// #include "esp32-hal-touch.h"
// #include "esp32-hal-dac.h"
// #include "esp32-hal-adc.h"
#include "esp32-hal-spi.h"
#include "esp32-hal-i2c.h"
// #include "esp32-hal-ledc.h"
#include "esp32-hal-rmt.h"
// #include "esp32-hal-sigmadelta.h"
// #include "esp32-hal-timer.h"
// #include "esp32-hal-bt.h"
// #include "esp32-hal-psram.h"
#include "esp32-hal-cpu.h"
#ifndef BOARD_HAS_PSRAM
@ -81,32 +71,6 @@ unsigned long millis(void);
//returns chip temperature in Celsius
float temperatureRead(void);
#if CONFIG_AUTOSTART_ARDUINO
//enable/disable WDT for Arduino's setup and loop functions
void enableLoopWDT(void);
void disableLoopWDT(void);
//feed WDT for the loop task
void feedLoopWDT(void);
#endif
//enable/disable WDT for the IDLE task on Core 0 (SYSTEM)
void enableCore0WDT();
void disableCore0WDT();
#ifndef CONFIG_FREERTOS_UNICORE
//enable/disable WDT for the IDLE task on Core 1 (Arduino)
void enableCore1WDT();
void disableCore1WDT();
#endif
//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore
//allows to easily handle all possible situations without repetitive code
BaseType_t xTaskCreateUniversal( TaskFunction_t pxTaskCode,
const char * const pcName,
const uint32_t usStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask,
const BaseType_t xCoreID );
unsigned long micros();
unsigned long millis();
@ -117,9 +81,6 @@ void delayMicroseconds(uint32_t us);
void arduino_phy_init();
#endif
#if !CONFIG_AUTOSTART_ARDUINO
void initArduino();
#endif
#ifdef __cplusplus
}