mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Cleanup sonar driver
* spend less time in interrupt handler. * avoid pointer usage to prevent the inclination adjusted reading being replaced by the interrupt handler's calculation. * only calculate the actual distance based on the measurement when required.
This commit is contained in:
parent
bd29298197
commit
db14bd80cb
5 changed files with 38 additions and 32 deletions
|
@ -22,4 +22,5 @@ extern int32_t sonarAlt;
|
|||
void Sonar_init(void);
|
||||
void Sonar_update(void);
|
||||
|
||||
int32_t sonarRead(void);
|
||||
int32_t sonarCalculateAltitude(int32_t sonarAlt, int16_t tiltAngle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue