DataFlash: updated ESC logging format

support higher voltages and higher RPMs
added total current logging
This commit is contained in:
Andrew Tridgell 2018-04-02 14:21:56 +10:00
parent 71eb9bac03
commit 061277040b
2 changed files with 13 additions and 11 deletions

View File

@ -1700,10 +1700,11 @@ void DataFlash_Class::Log_Write_ESC(void)
struct log_Esc pkt = {
LOG_PACKET_HEADER_INIT((uint8_t)(LOG_ESC1_MSG + i)),
time_us : time_us,
rpm : (int16_t)(esc_status.esc[i].esc_rpm/10),
voltage : (int16_t)(esc_status.esc[i].esc_voltage*100.0f + .5f),
current : (int16_t)(esc_status.esc[i].esc_current*100.0f + .5f),
temperature : (int16_t)(esc_status.esc[i].esc_temperature*100.0f + .5f)
rpm : (int32_t)(esc_status.esc[i].esc_rpm/10),
voltage : (uint16_t)(esc_status.esc[i].esc_voltage*100.0f + .5f),
current : (uint16_t)(esc_status.esc[i].esc_current*100.0f + .5f),
temperature : (int16_t)(esc_status.esc[i].esc_temperature*100.0f + .5f),
current_tot : 0
};
WriteBlock(&pkt, sizeof(pkt));

View File

@ -820,10 +820,11 @@ struct PACKED log_GPS_SBF_EVENT {
struct PACKED log_Esc {
LOG_PACKET_HEADER;
uint64_t time_us;
int16_t rpm;
int16_t voltage;
int16_t current;
int32_t rpm;
uint16_t voltage;
uint16_t current;
int16_t temperature;
uint16_t current_tot;
};
struct PACKED log_AIRSPEED {
@ -1069,10 +1070,10 @@ struct PACKED log_DSTL {
#define BARO_UNITS "smPOnsmO"
#define BARO_MULTS "F00B0C?0"
#define ESC_LABELS "TimeUS,RPM,Volt,Curr,Temp"
#define ESC_FMT "Qcccc"
#define ESC_UNITS "sqvAO"
#define ESC_MULTS "FBBBB"
#define ESC_LABELS "TimeUS,RPM,Volt,Curr,Temp,CTot"
#define ESC_FMT "QeCCcH"
#define ESC_UNITS "sqvAO-"
#define ESC_MULTS "FBBBB-"
#define GPA_LABELS "TimeUS,VDop,HAcc,VAcc,SAcc,VV,SMS,Delta"
#define GPA_FMT "QCCCCBIH"