From 5d07e5bdbf75dc508e9f789f24bc43fe08d0a00d Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 23 Dec 2015 14:06:58 -0200 Subject: [PATCH] DataFlash: stop using Progmem.h --- libraries/DataFlash/LogFile.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index fa8a1e79ac..7fecb66e17 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include "DataFlash.h" #include "DataFlash_SITL.h" @@ -329,8 +328,6 @@ uint16_t DataFlash_Block::find_last_page_of_log(uint16_t log_number) return -1; } -#define PGM_UINT8(addr) pgm_read_byte((const char *)addr) - /* read and print a log entry using the format strings from the given structure */ @@ -512,10 +509,8 @@ void DataFlash_Block::_print_log_formats(AP_HAL::BetterStream *port) { for (uint8_t i=0; iprintf("FMT, %u, %u, %s, %s, %s\n", - (unsigned)PGM_UINT8(&s->msg_type), - (unsigned)PGM_UINT8(&s->msg_len), - s->name, s->format, s->labels); + port->printf("FMT, %u, %u, %s, %s, %s\n", s->msg_type, s->msg_len, + s->name, s->format, s->labels); } } @@ -660,8 +655,8 @@ void DataFlash_Backend::Log_Fill_Format(const struct LogStructure *s, struct log pkt.head1 = HEAD_BYTE1; pkt.head2 = HEAD_BYTE2; pkt.msgid = LOG_FORMAT_MSG; - pkt.type = PGM_UINT8(&s->msg_type); - pkt.length = PGM_UINT8(&s->msg_len); + pkt.type = s->msg_type; + pkt.length = s->msg_len; strncpy(pkt.name, s->name, sizeof(pkt.name)); strncpy(pkt.format, s->format, sizeof(pkt.format)); strncpy(pkt.labels, s->labels, sizeof(pkt.labels));