Skip to content

Commit 430b95f

Browse files
committed
feat(example): Add "BIT0" to example instead of "1 << 0"
1 parent f5196d2 commit 430b95f

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static EventGroupHandle_t wifi_event_group;
6868
/* The event group allows multiple bits for each event,
6969
but we only care about one event - are we connected
7070
to the AP with an IP? */
71-
const int CONNECTED_BIT = 1 << 0;
71+
const int CONNECTED_BIT = BIT0;
7272

7373

7474
/* CA Root certificate, device ("Thing") certificate and device

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static EventGroupHandle_t wifi_event_group;
9595
/* The event group allows multiple bits for each event,
9696
but we only care about one event - are we connected
9797
to the AP with an IP? */
98-
const int CONNECTED_BIT = 1 << 0;
98+
const int CONNECTED_BIT = BIT0;
9999

100100

101101
/* CA Root certificate, device ("Thing") certificate and device

examples/protocols/http_request/main/http_request_example_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static EventGroupHandle_t wifi_event_group;
3737
/* The event group allows multiple bits for each event,
3838
but we only care about one event - are we connected
3939
to the AP with an IP? */
40-
const int CONNECTED_BIT = 1>>0;
40+
const int CONNECTED_BIT = BIT0;
4141

4242
/* Constants that aren't configurable in menuconfig */
4343
#define WEB_SERVER "example.com"

examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static EventGroupHandle_t wifi_event_group;
6161
/* The event group allows multiple bits for each event,
6262
but we only care about one event - are we connected
6363
to the AP with an IP? */
64-
const int CONNECTED_BIT = 1 << 0;
64+
const int CONNECTED_BIT = BIT0;
6565

6666
/* Constants that aren't configurable in menuconfig */
6767
#define WEB_SERVER "www.howsmyssl.com"

examples/protocols/https_wolfssl/main/https_wolfssl_example_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static EventGroupHandle_t wifi_event_group;
4040
/* The event group allows multiple bits for each event,
4141
but we only care about one event - are we connected
4242
to the AP with an IP? */
43-
const int CONNECTED_BIT = 1 << 0;
43+
const int CONNECTED_BIT = BIT0;
4444

4545
#if CONFIG_CERT_AUTH
4646
extern const uint8_t server_root_cert_pem_start[] asm("_binary_server_root_cert_pem_start");

examples/protocols/mqtt/main/MQTTEcho.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static EventGroupHandle_t wifi_event_group;
4545
/* The event group allows multiple bits for each event,
4646
but we only care about one event - are we connected
4747
to the AP with an IP? */
48-
const int CONNECTED_BIT = 1<<0;
48+
const int CONNECTED_BIT = BIT0;
4949

5050
#define MQTT_BROKER "iot.eclipse.org" /* MQTT Broker Address*/
5151
#define MQTT_PORT 1883 /* MQTT Port*/

examples/protocols/openssl_client/main/openssl_client_example_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static const char *TAG = "example";
4646
/* The event group allows multiple bits for each event,
4747
but we only care about one event - are we connected
4848
to the AP with an IP? */
49-
const int CONNECTED_BIT = 1 << 0;
49+
const int CONNECTED_BIT = BIT0;
5050

5151
extern const uint8_t ca_pem_start[] asm("_binary_ca_pem_start");
5252
extern const uint8_t ca_pem_end[] asm("_binary_ca_pem_end");

examples/protocols/openssl_demo/main/openssl_demo_example_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static EventGroupHandle_t wifi_event_group;
4040
/* The event group allows multiple bits for each event,
4141
but we only care about one event - are we connected
4242
to the AP with an IP? */
43-
const int CONNECTED_BIT = 1 << 0;
43+
const int CONNECTED_BIT = BIT0;
4444

4545
static const char *TAG = "example";
4646

examples/protocols/openssl_server/main/openssl_server_example_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static const char *TAG = "example";
4646
/* The event group allows multiple bits for each event,
4747
but we only care about one event - are we connected
4848
to the AP with an IP? */
49-
const int CONNECTED_BIT = 1 << 0;
49+
const int CONNECTED_BIT = BIT0;
5050

5151
extern const uint8_t ca_pem_start[] asm("_binary_ca_pem_start");
5252
extern const uint8_t ca_pem_end[] asm("_binary_ca_pem_end");

examples/wifi/smart_config/main/smartconfig_main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ static EventGroupHandle_t wifi_event_group;
2626
/* The event group allows multiple bits for each event,
2727
but we only care about one event - are we connected
2828
to the AP with an IP? */
29-
static const int CONNECTED_BIT = 1<<0;
30-
static const int ESPTOUCH_DONE_BIT = 1<<1;
29+
static const int CONNECTED_BIT = BIT0;
30+
static const int ESPTOUCH_DONE_BIT = BIT1;
3131
static const char *TAG = "sc";
3232

3333
void smartconfig_example_task(void * parm);

0 commit comments

Comments
 (0)