event_source.h 960 B

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