Code:
void ICACHE_FLASH_ATTR scan_done(void *arg, STATUS status)
{
uint8 ssid[33];
char temp[128];
return; // just to make sure no error here causing fault
}
void ICACHE_FLASH_ATTR user_scan(void)
{
// wifi scan has to after system init done
if(wifi_get_opmode() == SOFTAP_MODE)
{
os_printf("ap mode can't scan !!!\r\n");
return;
}
os_printf("Calling Scan\n");
wifi_station_scan(NULL, scan_done);
}
void ICACHE_FLASH_ATTR scan_task(void *pvParameters)
{
printf("Hello, welcome to scan-task!\r\n");
user_scan();
while(1)
{
os_printf("Delay another 5\n");
vTaskDelay(5000 / 10);
}
}
/******************************************************************************
* FunctionName : user_init
* Description : entry of user application, init user function here
* Parameters : none
* Returns : none
*******************************************************************************/
void ICACHE_FLASH_ATTR
user_init(void)
{
printf("SDK version:%s\n", system_get_sdk_version());
/* need to set opmode before you set config */
wifi_set_opmode(STATION_MODE);
//xTaskCreate(smartconfig_task, "smartconfig_task", 256, NULL, 2, NULL);
os_printf("User_Init Hmj\n");
wifi_set_opmode_current(STATION_MODE);
xTaskCreate(scan_task, "scantsk", 256, NULL, 2, NULL);
}
Code:
SDK version:1.5.0-dev(950076a)
User_Init Hmj
mode : sta(18:fe:34:ce:25:fe)
add if0
Hello, welcome to scan-task!
Calling Scan
Delay another 5
scandone
Delay another 5
Delay another 5
Delay another 5
Delay another 5
Delay another 5
Statistics: Posted by ESP_Xutao — Thu Dec 08, 2016 4:57 pm
Statistics: Posted by jhinkle — Wed Dec 07, 2016 10:20 pm
Statistics: Posted by ESP_Xutao — Wed Dec 07, 2016 12:27 pm
Code:
User_Init Joe
mode : sta(5c:cf:7f:14:b0:3b)
add if0
Hello, welcome to scan-task!
Calling Scan
Delay another 5
Fatal exception (0):
epc1=0x40220282
epc2=0x00000000
epc3=0x402314d0
epcvaddr=0x00000238
depc=0x00000000
rtn_add=0x40100e1d
ú
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
Code:
void ICACHE_FLASH_ATTR scan_done(void *arg, STATUS status)
{
uint8 ssid[33];
char temp[128];
return; // just to make sure no error here causing fault
}
void ICACHE_FLASH_ATTR user_scan(void)
{
// wifi scan has to after system init done
if(wifi_get_opmode() == SOFTAP_MODE)
{
os_printf("ap mode can't scan !!!\r\n");
return;
}
os_printf("Calling Scan\n");
wifi_station_scan(NULL, scan_done);
}
void ICACHE_FLASH_ATTR scan_task(void *pvParameters)
{
printf("Hello, welcome to scan-task!\r\n");
user_scan();
while(1)
{
os_printf("Delay another 5\n");
vTaskDelay(5000 / portTick_RATE_MS);
}
}
//Unless you explicitly define the functions as RAMFUNC, they will be placed in the SPI FLASH and the debugge>
//won't be able to set software breakpoints there.
void ICACHE_FLASH_ATTR user_init(void)
{
#ifdef ESP8266_GDBSTUB
//gdbstub_init();
#endif
UART_ConfigTypeDef uart_config;
uart_config.baud_rate = BIT_RATE_115200;
uart_config.data_bits = UART_WordLength_8b;
uart_config.parity = USART_Parity_None;
uart_config.stop_bits = USART_StopBits_1;
uart_config.flow_ctrl = USART_HardwareFlowControl_None;
uart_config.UART_RxFlowThresh = 120;
uart_config.UART_InverseMask = UART_None_Inverse;
UART_ParamConfig(UART1, &uart_config);
UART_SetPrintPort(UART1);
os_printf("User_Init Joe\n");
// Ensure we are in station mode
wifi_set_opmode_current(STATION_MODE);
//Set softAP + station mode
// wifi_set_opmode(STATIONAP_MODE);
xTaskCreate(scan_task, "scantsk", 256, NULL, 2, NULL);
}
Statistics: Posted by jhinkle — Wed Dec 07, 2016 2:32 am