Merge pull request #1512 from igua/sdlog

Sdlog
This commit is contained in:
Gautier Hattenberger
2016-03-18 09:50:47 +01:00
4 changed files with 39 additions and 3 deletions
+30
View File
@@ -36,6 +36,15 @@
#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;
#endif
/** Normal frequency with the default settings
*
* the baro read function should be called at 5 Hz
@@ -72,6 +81,11 @@ void baro_init(void)
LED_OFF(BARO_LED);
#endif
startup_cnt = BARO_STARTUP_COUNTER;
#if APOGEE_BARO_SDLOG
log_apogee_baro_started = FALSE;
#endif
}
void baro_periodic(void)
@@ -105,6 +119,22 @@ 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) Temp(degC) 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;
}
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);
}
#endif
}
}
+1 -1
View File
@@ -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",
+1 -1
View File
@@ -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 {
+7 -1
View File
@@ -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