event_source.h 933 B

12345678910111213141516171819202122232425262728293031323334
  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_timer.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. // Declarations for the event source
  15. #define TASK_ITERATIONS_COUNT 10 // number of times the task iterates
  16. #define TASK_PERIOD 500 // period of the task loop in milliseconds
  17. ESP_EVENT_DECLARE_BASE(TASK_EVENTS); // declaration of the task events family
  18. enum {
  19. TASK_ITERATION_EVENT // raised during an iteration of the loop within the task
  20. };
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #endif // #ifndef EVENT_SOURCE_H_