diff --git a/sw/airborne/boards/apogee/baro_board.c b/sw/airborne/boards/apogee/baro_board.c index f889786aec..fd18669bad 100644 --- a/sw/airborne/boards/apogee/baro_board.c +++ b/sw/airborne/boards/apogee/baro_board.c @@ -36,6 +36,16 @@ #include "subsystems/abi.h" #include "led.h" +// sd-log +#if APOGEE_BARO_SDLOG +#include "sdLog.h" +#include "subsystems/chibios-libopencm3/chibios_sdlog.h" +#include "subsystems/gps.h" +bool_t log_apogee_baro_started; +int count_sd_writes; +#endif + + /** Normal frequency with the default settings * * the baro read function should be called at 5 Hz @@ -72,6 +82,12 @@ void baro_init(void) LED_OFF(BARO_LED); #endif startup_cnt = BARO_STARTUP_COUNTER; + +#if APOGEE_BARO_SDLOG + log_apogee_baro_started = FALSE; + count_sd_writes=0; +#endif + } void baro_periodic(void) @@ -105,6 +121,26 @@ void apogee_baro_event(void) float temp = apogee_baro.temperature / 16.0f; AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, temp); apogee_baro.data_available = FALSE; + +#if APOGEE_BARO_SDLOG + if (pprzLogFile != -1) { + if (!log_apogee_baro_started) { + sdLogWriteLog(pprzLogFile, "APOGEE_BARO: Pres(Pa) GPS_fix TOW(ms) Week Lat(1e7deg) Lon(1e7deg) HMSL(mm) gpseed(cm/s) course(1e7deg) climb(cm/s)\n"); + log_apogee_baro_started = TRUE; + } + if (count_sd_writes == 0) { + sdLogWriteLog(pprzLogFile, "apogee_baro: %9.4f %9.4f %d %d %d %d %d %d %d %d %d\n", + pressure,temp, + gps.fix, gps.tow, gps.week, + gps.lla_pos.lat, gps.lla_pos.lon, gps.hmsl, + gps.gspeed, gps.course, -gps.ned_vel.z); + } + count_sd_writes++; + if (count_sd_writes > 8) {count_sd_writes=0;} + } +#endif + + } } diff --git a/sw/airborne/modules/meteo/humid_sht.c b/sw/airborne/modules/meteo/humid_sht.c index 0a8e862e2d..e444c60e5d 100644 --- a/sw/airborne/modules/meteo/humid_sht.c +++ b/sw/airborne/modules/meteo/humid_sht.c @@ -355,7 +355,7 @@ void humid_sht_periodic(void) #if SHT_SDLOG if (pprzLogFile != -1) { if (!log_sht_started) { - sdLogWriteLog(pprzLogFile, "SHT75: Humid(pct) Temp(degC) H(usec) GPS_fix TOW(ms) Week Lat(1e7rad) Lon(1e7rad) HMSL(mm) gpseed(cm/s) course(1e7rad) climb(cm/s)\n"); + sdLogWriteLog(pprzLogFile, "SHT75: Humid(pct) Temp(degC) GPS_fix TOW(ms) Week Lat(1e7deg) Lon(1e7deg) HMSL(mm) gspeed(cm/s) course(1e7deg) climb(cm/s)\n"); log_sht_started = TRUE; } sdLogWriteLog(pprzLogFile, "sht75: %9.4f %9.4f %d %d %d %d %d %d %d %d %d\n", diff --git a/sw/airborne/modules/meteo/temp_temod.c b/sw/airborne/modules/meteo/temp_temod.c index 7bc6ad70f2..9c0b6821bc 100644 --- a/sw/airborne/modules/meteo/temp_temod.c +++ b/sw/airborne/modules/meteo/temp_temod.c @@ -90,7 +90,7 @@ void temod_event(void) #if TEMP_TEMOD_SDLOG if (pprzLogFile != -1) { if (!log_temod_started) { - sdLogWriteLog(pprzLogFile, "TEMOD: Temp(degC) H(usec) GPS_fix TOW(ms) Week Lat(1e7rad) Lon(1e7rad) HMSL(mm) gpseed(cm/s) course(1e7rad) climb(cm/s)\n"); + sdLogWriteLog(pprzLogFile, "TEMOD: Temp(degC) GPS_fix TOW(ms) Week Lat(1e7deg) Lon(1e7deg) HMSL(mm) gspeed(cm/s) course(1e7deg) climb(cm/s)\n"); log_temod_started = TRUE; } else { diff --git a/sw/airborne/modules/sensors/airspeed_ets.c b/sw/airborne/modules/sensors/airspeed_ets.c index 39c54b353a..af83126e15 100644 --- a/sw/airborne/modules/sensors/airspeed_ets.c +++ b/sw/airborne/modules/sensors/airspeed_ets.c @@ -83,12 +83,14 @@ PRINT_CONFIG_VAR(AIRSPEED_ETS_I2C_DEV) #endif PRINT_CONFIG_VAR(AIRSPEED_ETS_START_DELAY) +#ifndef SITL #if AIRSPEED_ETS_SDLOG #include "sdLog.h" #include "subsystems/chibios-libopencm3/chibios_sdlog.h" #include "subsystems/gps.h" bool_t log_airspeed_ets_started; #endif +#endif // Global variables @@ -131,9 +133,11 @@ void airspeed_ets_init(void) airspeed_ets_delay_done = FALSE; SysTimeTimerStart(airspeed_ets_delay_time); +#ifndef SITL #if AIRSPEED_ETS_SDLOG log_airspeed_ets_started = FALSE; #endif +#endif } void airspeed_ets_read_periodic(void) @@ -234,9 +238,10 @@ void airspeed_ets_read_event(void) #if AIRSPEED_ETS_SDLOG +#ifndef SITL if (pprzLogFile != -1) { if (!log_airspeed_ets_started) { - sdLogWriteLog(pprzLogFile, "AIRSPEED_ETS: raw offset airspeed(m/s) GPS_fix TOW(ms) Week Lat(1e7rad) Lon(1e7rad) HMSL(mm) gpseed(cm/s) course(1e7rad) climb(cm/s)\n"); + sdLogWriteLog(pprzLogFile, "AIRSPEED_ETS: raw offset airspeed(m/s) GPS_fix TOW(ms) Week Lat(1e7deg) Lon(1e7deg) HMSL(mm) gpseed(cm/s) course(1e7rad) climb(cm/s)\n"); log_airspeed_ets_started = TRUE; } sdLogWriteLog(pprzLogFile, "airspeed_ets: %d %d %8.4f %d %d %d %d %d %d %d %d %d\n", @@ -246,6 +251,7 @@ void airspeed_ets_read_event(void) gps.gspeed, gps.course, -gps.ned_vel.z); } #endif +#endif