Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors compiling your sample program #6

Open
Macguiwer opened this issue Dec 4, 2022 · 2 comments
Open

Errors compiling your sample program #6

Macguiwer opened this issue Dec 4, 2022 · 2 comments

Comments

@Macguiwer
Copy link

Macguiwer commented Dec 4, 2022

Hello , Nikos when compiling the example of your library with sending data via serial I get the following error

`/Users/bernat/Documents/Arduino/libraries/FreqCountESP-master/src/FreqCountESP.cpp: In function 'intr_handle_data_t* setupPcnt(uint8_t, volatile uint32_t*)':
/Users/bernat/Documents/Arduino/libraries/FreqCountESP-master/src/FreqCountESP.cpp:36:17: error: 'PCNT_CHANNEL_EDGE_ACTION_INCREASE' was not declared in this scope
.pos_mode = PCNT_CHANNEL_EDGE_ACTION_INCREASE,
^
/Users/bernat/Documents/Arduino/libraries/FreqCountESP-master/src/FreqCountESP.cpp:37:17: error: 'PCNT_CHANNEL_EDGE_ACTION_HOLD' was not declared in this scope
.neg_mode = PCNT_CHANNEL_EDGE_ACTION_HOLD,
^
/Users/bernat/Documents/Arduino/libraries/FreqCountESP-master/src/FreqCountESP.cpp: In function 'void teardownPcnt(pcnt_isr_handle_t)':
/Users/bernat/Documents/Arduino/libraries/FreqCountESP-master/src/FreqCountESP.cpp:75:32: error: 'pcnt_isr_unregister' was not declared in this scope
pcnt_isr_unregister(isrHandle);
^

exit status 1

Compilation error: exit status 1

I am using the latest version of the Arduino IDE for MacOS.
I guess the latter shouldn't be a problem.

@masmoe
Copy link

masmoe commented Dec 7, 2022

same issue...

@ESP-O-MAT
Copy link

Hello,
the pulsecounter has been redesigned:
https://docs.espressif.com/projects/esp-idf/en/v5.0/esp32/migration-guides/release-5.x/peripherals.html

You can change the following in FreqCountESP.cpp:
PCNT_COUNT_INC = PCNT_CHANNEL_EDGE_ACTION_INCREASE
PCNT_COUNT_DIS = PCNT_CHANNEL_EDGE_ACTION_HOLD

but then there's still the missing pcnt_isr_unregister function:

pcnt_isr_register and pcnt_isr_unregister are removed. Register of the ISR handler from user’s code is no longer permitted. Users should register event callbacks instead by calling pcnt_unit_register_event_callbacks().

You can comment out the line with "pcnt_isr_unregister(isrHandle);" to test the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants