DataFlash: added log_num to dump interface

this will be used by the file oriented logging code
This commit is contained in:
Andrew Tridgell 2013-02-25 11:32:57 +11:00
parent c52ef80f06
commit 7b524d15fa
3 changed files with 9 additions and 4 deletions

View File

@ -39,8 +39,9 @@ public:
virtual void get_log_boundaries(uint8_t log_num, uint16_t & start_page, uint16_t & end_page) = 0;
virtual uint8_t get_num_logs(void) = 0;
virtual void start_new_log(void) = 0;
virtual uint16_t log_read_process(uint16_t start_page, uint16_t end_page,
void (*callback)(uint8_t msgid)) = 0;
virtual uint16_t log_read_process(uint8_t log_num,
uint16_t start_page, uint16_t end_page,
void (*callback)(uint8_t msgid)) = 0;
virtual void DumpPageInfo(AP_HAL::BetterStream *port) = 0;
virtual void ShowDeviceInfo(AP_HAL::BetterStream *port) = 0;

View File

@ -40,7 +40,8 @@ public:
void get_log_boundaries(uint8_t log_num, uint16_t & start_page, uint16_t & end_page);
uint8_t get_num_logs(void);
void start_new_log(void);
uint16_t log_read_process(uint16_t start_page, uint16_t end_page,
uint16_t log_read_process(uint8_t log_num,
uint16_t start_page, uint16_t end_page,
void (*callback)(uint8_t msgid));
void DumpPageInfo(AP_HAL::BetterStream *port);
void ShowDeviceInfo(AP_HAL::BetterStream *port);

View File

@ -234,8 +234,11 @@ uint16_t DataFlash_Block::find_last_page_of_log(uint16_t log_number)
Read the DataFlash log memory
Call the callback() function on each log message found in the page
range. Return the number of log messages found
Note that for the block oriented backend the log_num is ignored
*/
uint16_t DataFlash_Block::log_read_process(uint16_t start_page, uint16_t end_page,
uint16_t DataFlash_Block::log_read_process(uint8_t log_num,
uint16_t start_page, uint16_t end_page,
void (*callback)(uint8_t msgid))
{
uint8_t log_step = 0;