Add Kconfig for IDF and option to disable HAL mutexes

IDF Options:
- Autostart Arduino (implements app_main)
- Disable HAL locks
- Set HAL debug level
- Auto-connect STA if configured (else will connect after WiFi.begin())
This commit is contained in:
me-no-dev
2016-11-18 15:07:25 +02:00
parent c82699a83d
commit c30012ab78
11 changed files with 174 additions and 22 deletions

View File

@ -282,7 +282,7 @@ void wifi_dns_found_callback(const char *name, const ip_addr_t *ipaddr, void *ca
* */
#include "nvs_flash.h"
void initWiFi()
extern "C" void initWiFi()
{
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
nvs_flash_init();
@ -294,14 +294,15 @@ void initWiFi()
void startWiFi()
{
esp_err_t err;
wifi_mode_t mode = WIFI_MODE_NULL;
bool auto_connect = false;
err = esp_wifi_start();
if (err != ESP_OK) {
log_e("esp_wifi_start: %d", err);
return;
}
#if CONFIG_AUTOCONNECT_WIFI
wifi_mode_t mode = WIFI_MODE_NULL;
bool auto_connect = false;
err = esp_wifi_get_mode(&mode);
if (err != ESP_OK) {
@ -316,5 +317,6 @@ void startWiFi()
log_e("esp_wifi_connect: %d", err);
}
}
#endif
}