1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 17:55:28 +03:00

Cleanup project structure. Update unit test Makefile to place object

files in obj/test
This commit is contained in:
Dominic Clifton 2014-05-31 22:43:06 +01:00
parent fb9e3a2358
commit d19a5e7046
330 changed files with 657 additions and 638 deletions

28
src/main/sensors/sonar.c Normal file
View file

@ -0,0 +1,28 @@
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "drivers/sonar_hcsr04.h"
#include "config/runtime_config.h"
#include "sensors/sensors.h"
#include "sensors/sonar.h"
int32_t sonarAlt; // to think about the unit
#ifdef SONAR
void Sonar_init(void)
{
hcsr04_init(sonar_rc78);
sensorsSet(SENSOR_SONAR);
sonarAlt = 0;
}
void Sonar_update(void)
{
hcsr04_get_distance(&sonarAlt);
}
#endif