mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-22 01:02:57 +00:00
Add some comments in pcnt.h.
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
#define LEDC_OUTPUT_IO 18 // Output GPIO of a sample 1 Hz pulse generator
|
||||
|
||||
xQueueHandle pcnt_evt_queue; // A queue to handle pulse counter events
|
||||
pcnt_isr_handle_t user_isr_handle = NULL; //user's ISR service handle
|
||||
|
||||
/* A sample structure to pass events from the PCNT
|
||||
* interrupt handler to the main program.
|
||||
@@ -159,7 +160,7 @@ static void pcnt_example_init(void)
|
||||
pcnt_counter_clear(PCNT_TEST_UNIT);
|
||||
|
||||
/* Register ISR handler and enable interrupts for PCNT unit */
|
||||
pcnt_isr_register(pcnt_example_intr_handler, NULL, 0, NULL);
|
||||
pcnt_isr_register(pcnt_example_intr_handler, NULL, 0, &user_isr_handle);
|
||||
pcnt_intr_enable(PCNT_TEST_UNIT);
|
||||
|
||||
/* Everything is set up, now go to counting */
|
||||
@@ -206,4 +207,9 @@ void app_main()
|
||||
printf("Current counter value :%d\n", count);
|
||||
}
|
||||
}
|
||||
if(user_isr_handle) {
|
||||
//Free the ISR service handle.
|
||||
esp_intr_free(user_isr_handle);
|
||||
user_isr_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user