-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
barometer: Add ICP10100 and ICP1011 #18451
Conversation
|
||
// constants for presure calculation | ||
const float _pcal[3] = { 45000.0, 80000.0, 105000.0 }; | ||
const float _lut_lower = 3.5 * 0x100000; // 1<<20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these constants into the header or even the method where they're used?
You can also make them static constexpr float
.
} | ||
|
||
// software reset time to be greater than 170us | ||
usleep(250); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is small enough, but ideally we shouldn't have any sleeps in these drivers because they'll potentially impact other devices on the same bus. For example see the simple state machine within any of the newer drivers.
PX4-Autopilot/src/drivers/magnetometer/isentek/ist8308/IST8308.cpp
Lines 109 to 116 in b35dd86
case STATE::RESET: | |
// CNTL3: Software Reset | |
RegisterWrite(Register::CNTL3, CNTL3_BIT::SRST); | |
_reset_timestamp = now; | |
_failure_count = 0; | |
_state = STATE::WAIT_FOR_RESET; | |
perf_count(_reset_perf); | |
ScheduleDelayed(50_ms); // Power On Reset: max 50ms |
void _calculate(void); | ||
bool dataReady(); | ||
float getTemperatureC(void); | ||
float getTemperatureF(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float getTemperatureF(void); |
e1d400b
to
945671b
Compare
945671b
to
2aed49b
Compare
No description provided.