diff --git a/Source/main.c b/Source/main.c --- a/Source/main.c +++ b/Source/main.c @@ -24,8 +24,12 @@ #include "config.h" #include "error.h" -//#include "pressure.h" -#include "bme280.h" + +#ifdef LPS25H + #include "lps25h.h" +#else + #include "bme280.h" +#endif #include "gps.h" #include "system/gpio.h" @@ -49,8 +53,13 @@ int main(void) si446x_init(); si446x_init(); gps_poweron(); -// pressure_init(); - bme280_init(); + + #ifdef LPS25H + lps25h_init(); + #else + bme280_init(); + #endif + // Software timers uint32_t last_transmission = HAL_GetTick(); uint32_t last_led = HAL_GetTick(); @@ -61,8 +70,13 @@ int main(void) if(HAL_GetTick() - last_transmission > 700) { gps_update_data(); // Will always return at 1hz rate (default measurement rate) - //pressure_read(); - bme280_update(); + + #ifdef LPS25H + lps25h_read(); + #else + bme280_update(); + #endif + while(afsk_busy()); // ensure previous message finished aprs_send();