Browse Source

shortened strings

mission-4.1.18
Jason Short 13 years ago
parent
commit
7ffa2c4347
  1. 29
      ArduPlane/Log.pde

29
ArduPlane/Log.pde

@ -19,17 +19,17 @@ static int8_t select_logs(uint8_t argc, const Menu::arg *argv); @@ -19,17 +19,17 @@ static int8_t select_logs(uint8_t argc, const Menu::arg *argv);
// This is the help function
// PSTR is an AVR macro to read strings from flash memory
// printf_P is a version of print_f that reads from flash memory
static int8_t help_log(uint8_t argc, const Menu::arg *argv)
{
//static int8_t help_log(uint8_t argc, const Menu::arg *argv)
/*{
Serial.printf_P(PSTR("\n"
"Commands:\n"
" dump <n> dump log <n>\n"
" erase erase all logs\n"
" enable <name>|all enable logging <name> or everything\n"
" disable <name>|all disable logging <name> or everything\n"
" dump <n>"
" erase (all logs)\n"
" enable <name> | all\n"
" disable <name> | all\n"
"\n"));
return 0;
}
}*/
// Creates a constant array of structs representing menu options
// and stores them in Flash memory, not RAM.
@ -39,8 +39,7 @@ static const struct Menu::command log_menu_commands[] PROGMEM = { @@ -39,8 +39,7 @@ static const struct Menu::command log_menu_commands[] PROGMEM = {
{"dump", dump_log},
{"erase", erase_logs},
{"enable", select_logs},
{"disable", select_logs},
{"help", help_log}
{"disable", select_logs}
};
// A Macro to create the Menu
@ -58,6 +57,7 @@ print_log_menu(void) @@ -58,6 +57,7 @@ print_log_menu(void)
//Serial.print("num logs: "); Serial.println(num_logs, DEC);
Serial.printf_P(PSTR("logs enabled: "));
if (0 == g.log_bitmask) {
Serial.printf_P(PSTR("none"));
}else{
@ -78,18 +78,18 @@ print_log_menu(void) @@ -78,18 +78,18 @@ print_log_menu(void)
PLOG(CUR);
#undef PLOG
}
Serial.println();
if (num_logs == 0) {
Serial.printf_P(PSTR("\nNo logs available for download\n"));
Serial.printf_P(PSTR("\nNo logs\nType 'dump 0'.\n\n"));
}else{
Serial.printf_P(PSTR("\n%d logs\n"), num_logs);
Serial.printf_P(PSTR("\n%d logs available for download\n"), num_logs);
for(int i=num_logs;i>=1;i--) {
temp = g.log_last_filenumber-i+1;
get_log_boundaries(temp, log_start, log_end);
Serial.printf_P(PSTR("Log number %d, start page %d, end page %d\n"),
temp, log_start, log_end);
Serial.printf_P(PSTR("Log %d, start %d, end %d\n"), temp, log_start, log_end);
}
Serial.println();
}
@ -226,7 +226,7 @@ static byte get_num_logs(void) @@ -226,7 +226,7 @@ static byte get_num_logs(void)
// This function starts a new log file in the DataFlash
static void start_new_log()
{
uint16_t last_page;
uint16_t last_page;
if(g.log_last_filenumber < 1) {
last_page = 0;
@ -754,6 +754,7 @@ static int Log_Read_Process(int start_page, int end_page) @@ -754,6 +754,7 @@ static int Log_Read_Process(int start_page, int end_page)
DataFlash.StartRead(start_page);
while (page < end_page && page != -1){
data = DataFlash.ReadByte();
switch(log_step) // This is a state machine to read the packets
{
case 0:

Loading…
Cancel
Save