diff --git a/conf/modules/airspeed_ets.xml b/conf/modules/airspeed_ets.xml index 2f6dfcff9e..51cb506ba4 100644 --- a/conf/modules/airspeed_ets.xml +++ b/conf/modules/airspeed_ets.xml @@ -25,6 +25,7 @@ +
diff --git a/conf/modules/humid_sht.xml b/conf/modules/humid_sht.xml index 3c0824d9ba..0fbe7cc44a 100644 --- a/conf/modules/humid_sht.xml +++ b/conf/modules/humid_sht.xml @@ -8,6 +8,7 @@ +
diff --git a/conf/modules/temp_temod.xml b/conf/modules/temp_temod.xml index 9876ea042f..f80f626a86 100644 --- a/conf/modules/temp_temod.xml +++ b/conf/modules/temp_temod.xml @@ -5,6 +5,7 @@ Hygrosens TEMOD-I2C-Rx temperature sensor +
diff --git a/sw/airborne/modules/meteo/humid_sht.c b/sw/airborne/modules/meteo/humid_sht.c index ba77043e91..0a8e862e2d 100644 --- a/sw/airborne/modules/meteo/humid_sht.c +++ b/sw/airborne/modules/meteo/humid_sht.c @@ -35,6 +35,14 @@ #include "subsystems/datalink/downlink.h" #include "humid_sht.h" +// sd-log +#if SHT_SDLOG +#include "sdLog.h" +#include "subsystems/chibios-libopencm3/chibios_sdlog.h" +#include "subsystems/gps.h" +bool_t log_sht_started; +#endif + //#include "led.h" #define noACK 0 @@ -299,6 +307,11 @@ void humid_sht_init(void) humid_sht_available = FALSE; humid_sht_status = SHT_IDLE; + +#if SHT_SDLOG + log_sht_started = FALSE; +#endif + } void humid_sht_periodic(void) @@ -338,6 +351,21 @@ void humid_sht_periodic(void) humid_sht_status = SHT_MEASURING_HUMID; DOWNLINK_SEND_SHT_STATUS(DefaultChannel, DefaultDevice, &humidsht, &tempsht, &fhumidsht, &ftempsht); humid_sht_available = FALSE; + +#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"); + log_sht_started = TRUE; + } + sdLogWriteLog(pprzLogFile, "sht75: %9.4f %9.4f %d %d %d %d %d %d %d %d %d\n", + fhumidsht, ftempsht, + gps.fix, gps.tow, gps.week, + gps.lla_pos.lat, gps.lla_pos.lon, gps.hmsl, + gps.gspeed, gps.course, -gps.ned_vel.z); + } +#endif + } } } diff --git a/sw/airborne/modules/meteo/temp_temod.c b/sw/airborne/modules/meteo/temp_temod.c index e45251260f..7bc6ad70f2 100644 --- a/sw/airborne/modules/meteo/temp_temod.c +++ b/sw/airborne/modules/meteo/temp_temod.c @@ -33,6 +33,14 @@ #include "messages.h" #include "subsystems/datalink/downlink.h" +// sd-log +#if TEMP_TEMOD_SDLOG +#include "sdLog.h" +#include "subsystems/chibios-libopencm3/chibios_sdlog.h" +#include "subsystems/gps.h" +bool_t log_temod_started; +#endif + float ftmd_temperature; struct i2c_transaction tmd_trans; @@ -50,11 +58,16 @@ struct i2c_transaction tmd_trans; void temod_init(void) { tmd_trans.status = I2CTransDone; + +#if TEMP_TEMOD_SDLOG + log_temod_started = FALSE; +#endif } void temod_periodic(void) { i2c_receive(&TEMOD_I2C_DEV, &tmd_trans, TEMOD_SLAVE_ADDR, 2); + } void temod_event(void) @@ -72,6 +85,24 @@ void temod_event(void) DOWNLINK_SEND_TMP_STATUS(DefaultChannel, DefaultDevice, &tmd_temperature, &ftmd_temperature); tmd_trans.status = I2CTransDone; + + +#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"); + log_temod_started = TRUE; + } + else { + sdLogWriteLog(pprzLogFile, "temod: %9.4f %d %d %d %d %d %d %d %d %d\n", + ftmd_temperature, + gps.fix, gps.tow, gps.week, + gps.lla_pos.lat, gps.lla_pos.lon, gps.hmsl, + gps.gspeed, gps.course, -gps.ned_vel.z); + } + } +#endif + } } diff --git a/sw/airborne/modules/sensors/airspeed_ets.c b/sw/airborne/modules/sensors/airspeed_ets.c index 748fce7df8..39c54b353a 100644 --- a/sw/airborne/modules/sensors/airspeed_ets.c +++ b/sw/airborne/modules/sensors/airspeed_ets.c @@ -83,6 +83,13 @@ PRINT_CONFIG_VAR(AIRSPEED_ETS_I2C_DEV) #endif PRINT_CONFIG_VAR(AIRSPEED_ETS_START_DELAY) +#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 + // Global variables uint16_t airspeed_ets_raw; @@ -123,6 +130,10 @@ void airspeed_ets_init(void) airspeed_ets_delay_done = FALSE; SysTimeTimerStart(airspeed_ets_delay_time); + +#if AIRSPEED_ETS_SDLOG + log_airspeed_ets_started = FALSE; +#endif } void airspeed_ets_read_periodic(void) @@ -221,6 +232,23 @@ void airspeed_ets_read_event(void) airspeed_ets = 0.0; } + +#if AIRSPEED_ETS_SDLOG + 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"); + log_airspeed_ets_started = TRUE; + } + sdLogWriteLog(pprzLogFile, "airspeed_ets: %d %d %8.4f %d %d %d %d %d %d %d %d %d\n", + airspeed_ets_raw, airspeed_ets_offset, airspeed_ets, + gps.fix, gps.tow, gps.week, + gps.lla_pos.lat, gps.lla_pos.lon, gps.hmsl, + gps.gspeed, gps.course, -gps.ned_vel.z); + } +#endif + + + // Transaction has been read airspeed_ets_i2c_trans.status = I2CTransDone; }