-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix QMP6988 to work with AVR boards #4
Comments
How is this for the RISC-V (ESP32-C3) processors, could this be a problem here also? |
I haven't tested the code on any version of ESP32, so there is probably no problem with RISC-V or Xtensa LXx processors. To be clear: The main reason of the suggestion is, that the size of an int varies depending on the bitness of the processor (an int weighs 2 bytes on an AVR (8-bit) processor and 4 bytes on an ARM/RISC-V (32-bit) processor). I haven't found any other implementation of this driver, except for this implementation, but it doesn't work with the Arduino Uno without modifications too. It is also possible to use fixed-width integers for |
I'm working on ENV.III sensor with Arduino Uno and RaspberryPi Pico boards.
I found - the Pressure and Temperature from QMP6988 were incorrect because of 2 things:
1-st Issue:
M5Unit-ENV/src/QMP6988.h
Lines 12 to 13 in b1b5692
int
on avr boards isint16_t
.long
on both avr and 32-bit boards isint32_t
2-nd Issue:
M5Unit-ENV/src/QMP6988.cpp
Lines 75 to 94 in 7dc1c6f
a_data_uint8_tr[18]
anda_data_uint8_tr[0]
after leftshifting these values by 12 - they'll overflow on avr boards.changing their type to QMP6988_S32_t will solve this issue
The text was updated successfully, but these errors were encountered: