Copter: fixed logging for new API
This commit is contained in:
parent
df27b8b35d
commit
61c2befd4d
@ -29,13 +29,6 @@ MENU2(log_menu, "Log", log_menu_commands, print_log_menu);
|
||||
static bool
|
||||
print_log_menu(void)
|
||||
{
|
||||
uint16_t log_start;
|
||||
uint16_t log_end;
|
||||
uint16_t temp;
|
||||
uint16_t last_log_num = DataFlash.find_last_log();
|
||||
|
||||
uint16_t num_logs = DataFlash.get_num_logs();
|
||||
|
||||
cliSerial->printf_P(PSTR("logs enabled: "));
|
||||
|
||||
if (0 == g.log_bitmask) {
|
||||
@ -60,23 +53,8 @@ print_log_menu(void)
|
||||
|
||||
cliSerial->println();
|
||||
|
||||
if (num_logs == 0) {
|
||||
cliSerial->printf_P(PSTR("\nNo logs\n\n"));
|
||||
}else{
|
||||
cliSerial->printf_P(PSTR("\n%u logs\n"), (unsigned)num_logs);
|
||||
DataFlash.ListAvailableLogs(cliSerial);
|
||||
|
||||
for(int16_t i=num_logs; i>=1; i--) {
|
||||
uint16_t last_log_start = log_start, last_log_end = log_end;
|
||||
temp = last_log_num-i+1;
|
||||
DataFlash.get_log_boundaries(temp, log_start, log_end);
|
||||
cliSerial->printf_P(PSTR("Log %d, start %d, end %d\n"), (int)temp, (int)log_start, (int)log_end);
|
||||
if (last_log_start == log_start && last_log_end == log_end) {
|
||||
// we are printing bogus logs
|
||||
break;
|
||||
}
|
||||
}
|
||||
cliSerial->println();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
@ -105,13 +83,7 @@ dump_log(uint8_t argc, const Menu::arg *argv)
|
||||
}
|
||||
|
||||
DataFlash.get_log_boundaries(dump_log, dump_log_start, dump_log_end);
|
||||
/*cliSerial->printf_P(PSTR("Dumping Log number %d, start %d, end %d\n"),
|
||||
* dump_log,
|
||||
* dump_log_start,
|
||||
* dump_log_end);
|
||||
*/
|
||||
Log_Read((uint8_t)dump_log, dump_log_start, dump_log_end);
|
||||
//cliSerial->printf_P(PSTR("Done\n"));
|
||||
Log_Read((uint16_t)dump_log, dump_log_start, dump_log_end);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -1267,20 +1239,20 @@ static void Log_Read_WPNav()
|
||||
|
||||
// 1 2 3 4 5 6 7 8 9 10
|
||||
cliSerial->printf_P(PSTR("WPNAV, %4.2f, %4.2f, %4.2f, %4.2f, %4.2f, %4.2f, %4.2f, %4.2f, %ld, %ld\n"),
|
||||
(float)pkt.pos_error_x, // 1 position error in cm in lat direction
|
||||
(float)pkt.pos_error_y, // 2 position error in cm in lon direction
|
||||
(float)pkt.desired_velocity_x, // 3 desired velocity in cm/s in lat direction
|
||||
(float)pkt.desired_velocity_y, // 4 desired velocity in cm/s in lon direction
|
||||
(float)pkt.velocity_x, // 5 velocity in cm/s in lat direction
|
||||
(float)pkt.velocity_y, // 6 velocity in cm/s in lon direction
|
||||
(float)pkt.desired_accel_x, // 7 desired acceleration in cm/s/s in lat direction
|
||||
(float)pkt.desired_accel_y, // 8 desired acceleration in cm/s/s in lon direction
|
||||
pkt.pos_error_x, // 1 position error in cm in lat direction
|
||||
pkt.pos_error_y, // 2 position error in cm in lon direction
|
||||
pkt.desired_velocity_x, // 3 desired velocity in cm/s in lat direction
|
||||
pkt.desired_velocity_y, // 4 desired velocity in cm/s in lon direction
|
||||
pkt.velocity_x, // 5 velocity in cm/s in lat direction
|
||||
pkt.velocity_y, // 6 velocity in cm/s in lon direction
|
||||
pkt.desired_accel_x, // 7 desired acceleration in cm/s/s in lat direction
|
||||
pkt.desired_accel_y, // 8 desired acceleration in cm/s/s in lon direction
|
||||
(long)pkt.desired_roll, // 9 accel based lat from home
|
||||
(long)pkt.desired_pitch); // 12 accel based lon velocity
|
||||
}
|
||||
|
||||
// Read the DataFlash log memory
|
||||
static void Log_Read(uint8_t log_num, int16_t start_page, int16_t end_page)
|
||||
static void Log_Read(uint16_t log_num, uint16_t start_page, uint16_t end_page)
|
||||
{
|
||||
#ifdef AIRFRAME_NAME
|
||||
cliSerial->printf_P(PSTR((AIRFRAME_NAME)));
|
||||
|
Loading…
Reference in New Issue
Block a user