Search found 28 matches

by wuyuanyi
Tue Sep 03, 2024 7:55 am
Forum: ESP-IDF
Topic: Is it possible to enable Pulse Counter (PCNT) and gpio interrupt on the same pin?
Replies: 3
Views: 1519

Re: Is it possible to enable Pulse Counter (PCNT) and gpio interrupt on the same pin?

Welp, I could confirm that the correct combination to make PCNT and gpio interrupt work simultaneously is: PCNT setup -> gpio config -> gpio interrupt handler
by wuyuanyi
Tue Sep 03, 2024 5:13 am
Forum: ESP-IDF
Topic: Is it possible to enable Pulse Counter (PCNT) and gpio interrupt on the same pin?
Replies: 3
Views: 1519

Re: Is it possible to enable Pulse Counter (PCNT) and gpio interrupt on the same pin?

I have tried gpio_config > gpio_add_handler > pcnt setup as well as gpio_config > pcnt setup > gpio_add_handler. In either case,only pcnt works. the interrupt handler won't be called. Without pcnt the interrupt worked
by wuyuanyi
Mon Sep 02, 2024 4:57 pm
Forum: ESP-IDF
Topic: Is it possible to enable Pulse Counter (PCNT) and gpio interrupt on the same pin?
Replies: 3
Views: 1519

Is it possible to enable Pulse Counter (PCNT) and gpio interrupt on the same pin?

Hi, I am implementing a pulse counter for an encoder. I would also like to capture the edge in ISR and perform some action. However, when both PCNT and interrupt using `gpio_isr_handler_add`, the interrupt handler no longer gets called. I assume this was because the signal was routed to PCNT periphe...
by wuyuanyi
Mon May 06, 2024 1:27 am
Forum: General Discussion
Topic: Possibility to automatically detect Octal/Quad PSRAM?
Replies: 0
Views: 426

Possibility to automatically detect Octal/Quad PSRAM?

Hello all, I designed a prodcut with ESP32S3NxR2 and the firmware was set to using quad PSRAM lines. However, due to stock issue a recent batch was assembled with ESP32S3NxR8. While I was told the R8 version is compatible with R2 in quad mode, it turned out to be not true and I was getting E (323) q...
by wuyuanyi
Wed Dec 06, 2023 7:46 am
Forum: ESP-IDF
Topic: What is the purpose of using httpd_queue_work?
Replies: 4
Views: 9003

Re: What is the purpose of using httpd_queue_work?

I succeed implementing the asynchronous response using the following code Note the commented code, where I assumed that httpd_queue_work is used to delegate the http communication to the http server thread. However, without using httpd_queue_work it works just fine. This makes me wonder more when h...
by wuyuanyi
Sat Jan 07, 2023 2:49 pm
Forum: ESP-IDF
Topic: What is the purpose of using httpd_queue_work?
Replies: 4
Views: 9003

Re: What is the purpose of using httpd_queue_work?

I succeed implementing the asynchronous response using the following code Note the commented code, where I assumed that httpd_queue_work is used to delegate the http communication to the http server thread. However, without using httpd_queue_work it works just fine. This makes me wonder more when ht...
by wuyuanyi
Sat Jan 07, 2023 12:44 pm
Forum: ESP-IDF
Topic: What is the purpose of using httpd_queue_work?
Replies: 4
Views: 9003

What is the purpose of using httpd_queue_work?

Hi, I am looking at the http server component and found this function: httpd_queue_work. After tracing the source code, I found that It merely ask the http server thread to invoke the work callback immediately. The callback is not called in a standalone thread. I wonder what is the purpose of using ...
by wuyuanyi
Tue Dec 06, 2022 8:20 am
Forum: General Discussion
Topic: esp_event: event finalization callback function
Replies: 4
Views: 2492

Re: esp_event: event finalization callback function

I think this approach with the "magic" size value would result in less readable code of the application. You could probably add a function-like macro to "hide" this detail, and make the calling code look nicer, but then it's not going to be any different to introducing a new API. Also, would it be ...
by wuyuanyi
Tue Dec 06, 2022 6:31 am
Forum: General Discussion
Topic: esp_event: event finalization callback function
Replies: 4
Views: 2492

Re: esp_event: event finalization callback function

Hi wuyuanyi, What you describe should be possible. We could introduce something like esp_event_post_moved which would take ownership of the pointer and would accept the deletion callback argument instead of event_data_size. Internally the deletion callback (finalizer) could be stored in an esp_even...
by wuyuanyi
Sun Nov 27, 2022 5:23 am
Forum: General Discussion
Topic: esp_event: event finalization callback function
Replies: 4
Views: 2492

esp_event: event finalization callback function

Hi, I am looking into using the esp_event to exchange data between my components. Currently, I am facing such an issue: my data is a non-trivial c++ class (e.g., stl containers), hence relying on the pass-by-copy mechanism of the event loop does not work for me. The alternative is to allocate the ob...