From f5196d26a62ff791e3d6c76a9801e450d88549b1 Mon Sep 17 00:00:00 2001 From: Dong Heng Date: Wed, 8 Aug 2018 15:29:29 +0800 Subject: [PATCH 1/2] feat(esp8266): Modify header file relationship for app using BITx --- components/esp8266/include/rom/ets_sys.h | 2 -- .../freertos/port/esp8266/include/freertos/FreeRTOSConfig.h | 4 ++++ components/log/include/esp_log.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/esp8266/include/rom/ets_sys.h b/components/esp8266/include/rom/ets_sys.h index 8ced18f2..52d5d2e4 100644 --- a/components/esp8266/include/rom/ets_sys.h +++ b/components/esp8266/include/rom/ets_sys.h @@ -29,8 +29,6 @@ #include "esp8266/eagle_soc.h" -#include "freertos/portmacro.h" - /* interrupt related */ #define ETS_SPI_INUM 2 #define ETS_GPIO_INUM 4 diff --git a/components/freertos/port/esp8266/include/freertos/FreeRTOSConfig.h b/components/freertos/port/esp8266/include/freertos/FreeRTOSConfig.h index c715c6eb..e39f9716 100644 --- a/components/freertos/port/esp8266/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/port/esp8266/include/freertos/FreeRTOSConfig.h @@ -67,6 +67,10 @@ #include "sdkconfig.h" +#ifndef __ASSEMBLER__ +#include "rom/ets_sys.h" +#endif + /*----------------------------------------------------------- * Application specific definitions. * diff --git a/components/log/include/esp_log.h b/components/log/include/esp_log.h index 9e77a032..b2e4b6af 100644 --- a/components/log/include/esp_log.h +++ b/components/log/include/esp_log.h @@ -18,6 +18,7 @@ #include #include #include "sdkconfig.h" +#include "rom/ets_sys.h" #ifdef __cplusplus extern "C" { From 430b95fc339b32afec6de6bff065daf8c694f4b1 Mon Sep 17 00:00:00 2001 From: Dong Heng Date: Thu, 9 Aug 2018 14:49:08 +0800 Subject: [PATCH 2/2] feat(example): Add "BIT0" to example instead of "1 << 0" --- .../aws_iot/subscribe_publish/main/subscribe_publish_sample.c | 2 +- .../protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c | 2 +- .../protocols/http_request/main/http_request_example_main.c | 2 +- .../protocols/https_mbedtls/main/https_mbedtls_example_main.c | 2 +- .../protocols/https_wolfssl/main/https_wolfssl_example_main.c | 2 +- examples/protocols/mqtt/main/MQTTEcho.c | 2 +- .../openssl_client/main/openssl_client_example_main.c | 2 +- .../protocols/openssl_demo/main/openssl_demo_example_main.c | 2 +- .../openssl_server/main/openssl_server_example_main.c | 2 +- examples/wifi/smart_config/main/smartconfig_main.c | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c b/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c index f78774bc..936ccf64 100644 --- a/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c +++ b/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c @@ -68,7 +68,7 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1 << 0; +const int CONNECTED_BIT = BIT0; /* CA Root certificate, device ("Thing") certificate and device diff --git a/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c b/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c index 48a5d3cf..cec6d0fa 100644 --- a/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c +++ b/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c @@ -95,7 +95,7 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1 << 0; +const int CONNECTED_BIT = BIT0; /* CA Root certificate, device ("Thing") certificate and device diff --git a/examples/protocols/http_request/main/http_request_example_main.c b/examples/protocols/http_request/main/http_request_example_main.c index 3f74a913..37b92679 100644 --- a/examples/protocols/http_request/main/http_request_example_main.c +++ b/examples/protocols/http_request/main/http_request_example_main.c @@ -37,7 +37,7 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1>>0; +const int CONNECTED_BIT = BIT0; /* Constants that aren't configurable in menuconfig */ #define WEB_SERVER "example.com" diff --git a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c index 63bde71e..f455080a 100644 --- a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c +++ b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c @@ -61,7 +61,7 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1 << 0; +const int CONNECTED_BIT = BIT0; /* Constants that aren't configurable in menuconfig */ #define WEB_SERVER "www.howsmyssl.com" diff --git a/examples/protocols/https_wolfssl/main/https_wolfssl_example_main.c b/examples/protocols/https_wolfssl/main/https_wolfssl_example_main.c index 8e60ecfe..6c62760f 100644 --- a/examples/protocols/https_wolfssl/main/https_wolfssl_example_main.c +++ b/examples/protocols/https_wolfssl/main/https_wolfssl_example_main.c @@ -40,7 +40,7 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1 << 0; +const int CONNECTED_BIT = BIT0; #if CONFIG_CERT_AUTH extern const uint8_t server_root_cert_pem_start[] asm("_binary_server_root_cert_pem_start"); diff --git a/examples/protocols/mqtt/main/MQTTEcho.c b/examples/protocols/mqtt/main/MQTTEcho.c index 51e8d51f..4a6ddd80 100644 --- a/examples/protocols/mqtt/main/MQTTEcho.c +++ b/examples/protocols/mqtt/main/MQTTEcho.c @@ -45,7 +45,7 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1<<0; +const int CONNECTED_BIT = BIT0; #define MQTT_BROKER "iot.eclipse.org" /* MQTT Broker Address*/ #define MQTT_PORT 1883 /* MQTT Port*/ diff --git a/examples/protocols/openssl_client/main/openssl_client_example_main.c b/examples/protocols/openssl_client/main/openssl_client_example_main.c index e5740237..5a3f2775 100644 --- a/examples/protocols/openssl_client/main/openssl_client_example_main.c +++ b/examples/protocols/openssl_client/main/openssl_client_example_main.c @@ -46,7 +46,7 @@ static const char *TAG = "example"; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1 << 0; +const int CONNECTED_BIT = BIT0; extern const uint8_t ca_pem_start[] asm("_binary_ca_pem_start"); extern const uint8_t ca_pem_end[] asm("_binary_ca_pem_end"); diff --git a/examples/protocols/openssl_demo/main/openssl_demo_example_main.c b/examples/protocols/openssl_demo/main/openssl_demo_example_main.c index 63136144..f4a995eb 100644 --- a/examples/protocols/openssl_demo/main/openssl_demo_example_main.c +++ b/examples/protocols/openssl_demo/main/openssl_demo_example_main.c @@ -40,7 +40,7 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1 << 0; +const int CONNECTED_BIT = BIT0; static const char *TAG = "example"; diff --git a/examples/protocols/openssl_server/main/openssl_server_example_main.c b/examples/protocols/openssl_server/main/openssl_server_example_main.c index 45368716..db62ef49 100644 --- a/examples/protocols/openssl_server/main/openssl_server_example_main.c +++ b/examples/protocols/openssl_server/main/openssl_server_example_main.c @@ -46,7 +46,7 @@ static const char *TAG = "example"; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -const int CONNECTED_BIT = 1 << 0; +const int CONNECTED_BIT = BIT0; extern const uint8_t ca_pem_start[] asm("_binary_ca_pem_start"); extern const uint8_t ca_pem_end[] asm("_binary_ca_pem_end"); diff --git a/examples/wifi/smart_config/main/smartconfig_main.c b/examples/wifi/smart_config/main/smartconfig_main.c index c8035d20..db4d005b 100644 --- a/examples/wifi/smart_config/main/smartconfig_main.c +++ b/examples/wifi/smart_config/main/smartconfig_main.c @@ -26,8 +26,8 @@ static EventGroupHandle_t wifi_event_group; /* The event group allows multiple bits for each event, but we only care about one event - are we connected to the AP with an IP? */ -static const int CONNECTED_BIT = 1<<0; -static const int ESPTOUCH_DONE_BIT = 1<<1; +static const int CONNECTED_BIT = BIT0; +static const int ESPTOUCH_DONE_BIT = BIT1; static const char *TAG = "sc"; void smartconfig_example_task(void * parm);