Search found 35 matches

by gfvalvo
Sun May 09, 2021 11:22 am
Forum: ESP-IDF
Topic: Attach ISR to Pulse Counter
Replies: 3
Views: 3170

Re: Attach ISR to Pulse Counter

Thanks. Is that distinction documented somewhere?
by gfvalvo
Sat May 08, 2021 10:48 pm
Forum: ESP-IDF
Topic: Attach ISR to Pulse Counter
Replies: 3
Views: 3170

Attach ISR to Pulse Counter

Hi All. So, scanning through the API reference, it appears there are two different methods to attach an ISR the Pulse Counter: * pcnt_isr_service_install() / pcnt_isr_handler_add() * pcnt_isr_register() However, I haven't yet found an explanation of what the difference between these two is. Anyone h...
by gfvalvo
Wed Jan 06, 2021 3:21 am
Forum: General Discussion
Topic: Accessing Variable from Either ESP32 Core
Replies: 3
Views: 2697

Re: Accessing Variable from Either ESP32 Core

OK, thanks. After thinking about it more, I realized I need read/modify/write protection across the cores. So, just to be sure I understand, this: std::atomic<int16_t> _currentValue; Will provide atomic protection for an operation like: _currentValue += 100; Also, if the variable is accessed in both...
by gfvalvo
Tue Jan 05, 2021 8:35 pm
Forum: General Discussion
Topic: Accessing Variable from Either ESP32 Core
Replies: 3
Views: 2697

Accessing Variable from Either ESP32 Core

So, if I have a volatile integer variable (say a uint32_t or int16_t), can I safely access it at any time and asynchronously from either core without taking any special precautions?

I assume that anything bigger than a 32-bit variable would be non-atomic and require some type of mutual exclusion.
by gfvalvo
Thu Dec 24, 2020 3:15 pm
Forum: ESP32 Arduino
Topic: Sending Data to Queue from Tasks in Both Cores
Replies: 1
Views: 1961

Sending Data to Queue from Tasks in Both Cores

Hello. Just starting to relearn RTOS techniques learned in college MANY years ago.

So, if I have tasks running in Core 0 and Core 1, can they each safely send data to the same FreeRTOS queue without any special precautions? Or, should the queue first be locked using a mutex?

Thanks.