10 changed files with 33 additions and 109 deletions
@ -1,2 +1,2 @@ |
|||
idf_component_register(SRCS "main.c" "tic.c" "wifi.c" "mqtt.c" "sntp.c" "libteleinfo.cpp" "libteleinfo/src/LibTeleinfo.cpp" |
|||
idf_component_register(SRCS "main.c" "tic.c" "wifi.c" "mqtt.c" "sntp.c" "common.c" "libteleinfo.cpp" "libteleinfo/src/LibTeleinfo.cpp" |
|||
INCLUDE_DIRS ".") |
|||
|
|||
@ -0,0 +1,2 @@ |
|||
#include "common.h" |
|||
volatile EventGroupHandle_t services_event_group; |
|||
@ -0,0 +1,16 @@ |
|||
#ifndef __COMMON_H__ |
|||
#define __COMMON_H__ |
|||
|
|||
#include "freertos/FreeRTOS.h" |
|||
#include "freertos/task.h" |
|||
#include "freertos/event_groups.h" |
|||
|
|||
#define WIFI_CONNECTED_BIT BIT0 |
|||
#define MQTT_CONNECTED_BIT BIT1 |
|||
#define TIME_SYNC_BIT BIT2 |
|||
|
|||
extern volatile EventGroupHandle_t services_event_group; |
|||
|
|||
#define WAIT_FOR(flags) while ((xEventGroupWaitBits(services_event_group, flags, pdFALSE, pdTRUE, portMAX_DELAY) & (flags)) != (flags)) {} |
|||
|
|||
#endif |
|||
Loading…
Reference in new issue