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

F_CPU define is missing #221

Open
blackketter opened this issue May 13, 2021 · 4 comments
Open

F_CPU define is missing #221

blackketter opened this issue May 13, 2021 · 4 comments

Comments

@blackketter
Copy link

The preprocessor define for CPU speed, F_CPU, is not defined for RaspberryPi Pico, but seems to be defined for other Arduino boards. Any sketch or library that uses this definition will fail to build.

Thanks!

@RudolfAtHome
Copy link

That would be a very important addition! The only library for the DHT22 sensor therefore does not work. And some others probably too.

@RudolfAtHome
Copy link

Any fast work around?

@facchinm
Copy link
Member

facchinm commented Jun 7, 2021

A library using F_CPU to calculate timing is unlikely to work with this core (since the underlying RTOS does not guarantee that a busy loop is not getting interrupted).
For the DHT22, Adafruit's DHT library has already been ported to a plethora of architectures and just works fine without F_CPU definition. For any other library, I'd add something like https://github.com/facchinm/ArduinoCore-mbed/pull/new/f_cpu_defined to make the compiler happy but the user aware that the resulting sketch will likely not work.
@sebromero any idea / comment?

@blackketter
Copy link
Author

My use case was for printing debug information, so setting F_CPU to zero isn't that helpful. The fact that some libraries use the CPU speed for timing without taking architecture into account need to be fixed in any case.

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