1 /* esp_event (event loop library) basic example 2 3 This example code is in the Public Domain (or CC0 licensed, at your option.) 4 5 Unless required by applicable law or agreed to in writing, this 6 software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 7 CONDITIONS OF ANY KIND, either express or implied. 8 */ 9 10 #ifndef EVENT_SOURCE_H_ 11 #define EVENT_SOURCE_H_ 12 13 #include "esp_event.h" 14 #include "esp_timer.h" 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 // Declarations for the event source 21 #define TASK_ITERATIONS_COUNT 10 // number of times the task iterates 22 #define TASK_PERIOD 500 // period of the task loop in milliseconds 23 24 ESP_EVENT_DECLARE_BASE(TASK_EVENTS); // declaration of the task events family 25 26 enum { 27 TASK_ITERATION_EVENT // raised during an iteration of the loop within the task 28 }; 29 30 #ifdef __cplusplus 31 } 32 #endif 33 34 #endif // #ifndef EVENT_SOURCE_H_ 35