Created a blinky, uploaded, it runs but i see SOFT_AP runs?
Posted: Sat Sep 05, 2015 2:41 pm
I created a sample application based on blinky examples. You can check the code below. Uploaded the code to esp12 an saw it working fine. But when i checked uart output:
i see that the device also works as a SOFT_AP and i also can see the wifi network with my cellphone. I did not want this behaviour and did not write code about it. Is this normal? How can I turn off this behaviour?
i see that the device also works as a SOFT_AP and i also can see the wifi network with my cellphone. I did not want this behaviour and did not write code about it. Is this normal? How can I turn off this behaviour?
Code: Select all
#include "ets_sys.h"
#include "osapi.h"
#include "os_type.h"
#include "gpio.h"
// see eagle_soc.h for these definitions
#define LED_PIN 4
#define LED_GPIO_MUX PERIPHS_IO_MUX_GPIO4_U
#define LED_GPIO_FUNC FUNC_GPIO4
#define DELAY 500 /* milliseconds */
LOCAL os_timer_t blink_timer;
LOCAL uint8_t led_state=0;
LOCAL void ICACHE_FLASH_ATTR blink_cb(void *arg)
{
GPIO_OUTPUT_SET(LED_PIN, led_state);
led_state ^=1;
//os_printf("...Beat...\n");
}
void user_rf_pre_init(void)
{
}
void user_init(void)
{
gpio_init();
//os_printf("SDK version: %s \n", system_get_sdk_version());
// Configure pin as a GPIO
PIN_FUNC_SELECT(LED_GPIO_MUX, LED_GPIO_FUNC);
// Set up a timer to blink the LED
// os_timer_disarm(ETSTimer *ptimer)
os_timer_disarm(&blink_timer);
// os_timer_setfn(ETSTimer *ptimer, ETSTimerFunc *pfunction, void *parg)
os_timer_setfn(&blink_timer, (os_timer_func_t *)blink_cb, (void *)0);
// void os_timer_arm(ETSTimer *ptimer,uint32_t milliseconds, bool repeat_flag)
os_timer_arm(&blink_timer, DELAY, 1);
}