Skip to content

Commit fd299df

Browse files
committed
feat(examples): fix aws iot examples for esp8266 platform
1 parent d317757 commit fd299df

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@
3737
#include "esp_wifi.h"
3838
#include "esp_event_loop.h"
3939
#include "esp_log.h"
40+
41+
#ifdef CONFIG_EXAMPLE_FILESYSTEM_CERTS
4042
#include "esp_vfs_fat.h"
4143
#include "driver/sdmmc_host.h"
44+
#endif
4245

4346
#include "nvs.h"
4447
#include "nvs_flash.h"
@@ -65,7 +68,7 @@ static EventGroupHandle_t wifi_event_group;
6568
/* The event group allows multiple bits for each event,
6669
but we only care about one event - are we connected
6770
to the AP with an IP? */
68-
const int CONNECTED_BIT = BIT0;
71+
const int CONNECTED_BIT = 1 << 0;
6972

7073

7174
/* CA Root certificate, device ("Thing") certificate and device
@@ -328,5 +331,5 @@ void app_main()
328331
ESP_ERROR_CHECK( err );
329332

330333
initialise_wifi();
331-
xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL, 1);
334+
xTaskCreate(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL);
332335
}

examples/protocols/aws_iot/subscribe_publish/sdkconfig.defaults

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Enable AWS IoT SDK support
22
CONFIG_AWS_IOT_SDK=y
33

4+
CONFIG_MBEDTLS_SSL_ALPN=y
5+
46
# Enable FATFS read only with long filename support
57
# for loading Cert/CA/etc from filesystem
68
# (if enabled in config)

examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@
3434
#include "esp_wifi.h"
3535
#include "esp_event_loop.h"
3636
#include "esp_log.h"
37+
38+
#ifdef CONFIG_EXAMPLE_FILESYSTEM_CERTS
3739
#include "esp_vfs_fat.h"
3840
#include "driver/sdmmc_host.h"
41+
#endif
3942

4043
#include "nvs.h"
4144
#include "nvs_flash.h"
@@ -92,7 +95,7 @@ static EventGroupHandle_t wifi_event_group;
9295
/* The event group allows multiple bits for each event,
9396
but we only care about one event - are we connected
9497
to the AP with an IP? */
95-
const int CONNECTED_BIT = BIT0;
98+
const int CONNECTED_BIT = 1 << 0;
9699

97100

98101
/* CA Root certificate, device ("Thing") certificate and device
@@ -364,5 +367,5 @@ void app_main()
364367

365368
initialise_wifi();
366369
/* Temporarily pin task to core, due to FPU uncertainty */
367-
xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL, 1);
370+
xTaskCreate(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL);
368371
}

examples/protocols/aws_iot/thing_shadow/sdkconfig.defaults

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Enable AWS IoT SDK support
22
CONFIG_AWS_IOT_SDK=y
33

4+
CONFIG_MBEDTLS_SSL_ALPN=y
5+
46
# Enable FATFS read only with long filename support
57
# for loading Cert/CA/etc from filesystem
68
# (if enabled in config)

0 commit comments

Comments
 (0)