kopia lustrzana https://github.com/pjalocha/esp32-ogn-tracker
WITH_AP_BUTTON => Turn on the WiFi AP only when user button is pressed during startup
rodzic
08b6b990df
commit
dcd97b118c
|
@ -178,6 +178,7 @@ void LED_RX_Flash(uint8_t Time=100);
|
|||
|
||||
void LED_TimerCheck(uint8_t Ticks=1);
|
||||
|
||||
bool Button_isPressed(void);
|
||||
// extern bool Button_SleepRequest;
|
||||
int32_t Button_TimerCheck(uint8_t Ticks=1);
|
||||
|
||||
|
|
|
@ -124,7 +124,11 @@ void app_main(void)
|
|||
xTaskCreate(vTaskSTX, "STX", 4000, 0, tskIDLE_PRIORITY+3, 0);
|
||||
#endif
|
||||
#ifdef WITH_AP
|
||||
if(Parameters.APname[0])
|
||||
#ifdef WITH_AP_BUTTON
|
||||
if(Button_isPressed() && Parameters.APname[0]) // start WiFi AP when button pressed during startup and APname non-empty
|
||||
#else
|
||||
if(Parameters.APname[0]) // start WiFi AP when APname non-empty
|
||||
#endif
|
||||
xTaskCreate(vTaskAP, "AP", 4000, 0, tskIDLE_PRIORITY+3, 0);
|
||||
#endif
|
||||
#if defined(WITH_OLED) || defined(WITH_U8G2_OLED) || defined(WITH_ST7789) || defined(WITH_ILI9341)
|
||||
|
|
|
@ -78,8 +78,8 @@ esp_err_t WIFI_StartAP(const char *SSID, const char *Pass, int MaxConnections)
|
|||
// IP4_ADDR(&IPinfo.gw, 192,168,1,1);
|
||||
// IP4_ADDR(&IPinfo.netmask, 255,255,255,0);
|
||||
// tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &IPinfo);
|
||||
Err = esp_wifi_set_mode(WIFI_MODE_AP); if(Err!=ESP_OK) return Err; // which one should come first: set_mode or set_config ?
|
||||
Err = esp_wifi_set_config(ESP_IF_WIFI_AP, &WIFI_Config); if(Err!=ESP_OK) return Err;
|
||||
Err = esp_wifi_set_mode(WIFI_MODE_AP); if(Err!=ESP_OK) return Err;
|
||||
Err = esp_wifi_start();
|
||||
return Err; }
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue