1
0
Fork 0
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:
Dominic Clifton 2014-12-24 01:30:47 +00:00
parent bd29298197
commit db14bd80cb
5 changed files with 38 additions and 32 deletions

View file

@ -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);