|
|
4 лет назад | |
|---|---|---|
| .. | ||
| main | 4 лет назад | |
| CMakeLists.txt | 4 лет назад | |
| Makefile | 4 лет назад | |
| README.md | 4 лет назад | |
| example_test.py | 4 лет назад | |
The example demonstrates the use of eventfd() to collect events from other tasks and ISRs in a
select() based main loop. The example starts two tasks and installs a timer interrupt handler:
eventfd periodically.eventfd.select() loop.This example should be able to run on any commonly available ESP32, ESP32S2, ESP32S3 or ESP32C3 development board.
idf.py menuconfig
The default config will work.
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor
(Replace PORT with the name of the serial port to use.)
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
The following log output should appear when the example runs (note that the bootloader log has been omitted).
I (4310) eventfd_example: Time: 1.99s
I (4310) eventfd_example: Select timeout
I (4310) eventfd_example: =================================
I (4310) eventfd_example: Select timeouted for 1 times
I (4320) eventfd_example: Timer triggerred for 0 times
I (4320) eventfd_example: Progress triggerred for 0 times
I (4330) eventfd_example: =================================
I (4810) eventfd_example: Time: 2.50s
I (4810) eventfd_example: TimerEvent fd event triggered
I (5810) eventfd_example: Time: 3.49s
I (5810) eventfd_example: Progress fd event triggered
I (7310) eventfd_example: Time: 5.00s
I (7310) eventfd_example: TimerEvent fd event triggered
I (9310) eventfd_example: Time: 6.99s
I (9310) eventfd_example: Select timeout
I (9310) eventfd_example: Time: 6.99s
I (9310) eventfd_example: Progress fd event triggered
I (9810) eventfd_example: Time: 7.50s
I (9810) eventfd_example: TimerEvent fd event triggered
I (11810) eventfd_example: Time: 9.49s
I (11810) eventfd_example: Select timeout
I (12310) eventfd_example: Time: 10.00s
I (12310) eventfd_example: TimerEvent fd event triggered
I (12810) eventfd_example: Time: 10.49s
I (12810) eventfd_example: Progress fd event triggered
I (14810) eventfd_example: Time: 12.49s
I (14810) eventfd_example: Select timeout
I (14810) eventfd_example: =================================
I (14810) eventfd_example: Select timeouted for 4 times
I (14820) eventfd_example: Timer triggerred for 4 times
I (14820) eventfd_example: Progress triggerred for 3 times
I (14830) eventfd_example: =================================