1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

Successfully blackbox logged 46kB of flawless log data on the bench

Data read back using MSP
This commit is contained in:
Nicholas Sherlock 2015-01-31 00:35:17 +13:00
parent ebff1bdcd7
commit f7d227a208
2 changed files with 16 additions and 7 deletions

View file

@ -551,6 +551,7 @@ static void serializeDataflashReadReply(uint32_t address, uint8_t size)
enum { DATAFLASH_READ_REPLY_CHUNK_SIZE = 128 };
uint8_t buffer[DATAFLASH_READ_REPLY_CHUNK_SIZE];
int bytesRead;
if (size > DATAFLASH_READ_REPLY_CHUNK_SIZE) {
size = DATAFLASH_READ_REPLY_CHUNK_SIZE;
@ -561,9 +562,10 @@ static void serializeDataflashReadReply(uint32_t address, uint8_t size)
serialize32(address);
flashfsSeekAbs(address);
flashfsRead(buffer, size);
// bytesRead will be lower than that requested if we reach end of volume
bytesRead = flashfsRead(buffer, size);
for (int i = 0; i < size; i++) {
for (int i = 0; i < bytesRead; i++) {
serialize8(buffer[i]);
}
}
@ -1203,9 +1205,8 @@ static bool processOutCommand(uint8_t cmdMSP)
case MSP_DATAFLASH_READ:
{
uint32_t readAddress = read32();
uint8_t readSize = read8();
serializeDataflashReadReply(readAddress, readSize);
serializeDataflashReadReply(readAddress, 128);
}
break;
#endif