Skip to content

Commit

Permalink
Updated examples esp_rtos_sdk_example and esp_rtos_sdk_example_2
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Grigorev <[email protected]>
  • Loading branch information
CHERTS committed Aug 3, 2015
1 parent fc702ea commit 0177a8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Espressif/examples/esp_rtos_sdk_example/user/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ void task3(void *pvParameters)
* Parameters : none
* Returns : none
*******************************************************************************/
void ICACHE_FLASH_ATTR
user_init(void)
void user_init(void)
{
printf("SDK version:%s\n", system_get_sdk_version());

Expand Down
16 changes: 9 additions & 7 deletions Espressif/examples/esp_rtos_sdk_example_2/user/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#define server_ip "192.168.101.142"
#define server_port 9669

sc_type SC_Type = 0;

void ICACHE_FLASH_ATTR
smartconfig_done(sc_status status, void *pdata)
{
Expand All @@ -34,6 +32,12 @@ smartconfig_done(sc_status status, void *pdata)
break;
case SC_STATUS_GETTING_SSID_PSWD:
printf("SC_STATUS_GETTING_SSID_PSWD\n");
sc_type *type = pdata;
if (*type == SC_TYPE_ESPTOUCH) {
printf("SC_TYPE:SC_TYPE_ESPTOUCH\n");
} else {
printf("SC_TYPE:SC_TYPE_AIRKISS\n");
}
break;
case SC_STATUS_LINK:
printf("SC_STATUS_LINK\n");
Expand All @@ -45,7 +49,7 @@ smartconfig_done(sc_status status, void *pdata)
break;
case SC_STATUS_LINK_OVER:
printf("SC_STATUS_LINK_OVER\n");
if (SC_Type == SC_TYPE_ESPTOUCH) {
if (pdata != NULL) {
uint8 phone_ip[4] = {0};

memcpy(phone_ip, (uint8*)pdata, 4);
Expand All @@ -60,10 +64,8 @@ smartconfig_done(sc_status status, void *pdata)
void ICACHE_FLASH_ATTR
smartconfig_task(void *pvParameters)
{
SC_Type = SC_TYPE_ESPTOUCH;

smartconfig_start(SC_Type, smartconfig_done);//SC_TYPE_AIRKISS

smartconfig_start(smartconfig_done);

vTaskDelete(NULL);
}

Expand Down

0 comments on commit 0177a8f

Please sign in to comment.