1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Fix MSP Flash FS supported (#5670)

This commit is contained in:
Míguel Ángel Mulero Martínez 2018-04-15 02:29:49 +02:00 committed by Michael Keller
parent f63edf1a39
commit 4e024f5467
3 changed files with 13 additions and 1 deletions

View file

@ -149,6 +149,11 @@ typedef enum {
MSP_SDCARD_FLAG_SUPPORTTED = 1
} mspSDCardFlags_e;
typedef enum {
MSP_FLASHFS_FLAG_READY = 1,
MSP_FLASHFS_FLAG_SUPPORTED = 2
} mspFlashFsFlags_e;
#define RATEPROFILE_MASK (1 << 7)
#endif //USE_OSD_SLAVE
@ -281,7 +286,8 @@ static void serializeDataflashSummaryReply(sbuf_t *dst)
{
#ifdef USE_FLASHFS
const flashGeometry_t *geometry = flashfsGetGeometry();
uint8_t flags = (flashfsIsReady() ? 1 : 0) | 2 /* FlashFS is supported */;
uint8_t flags = (flashfsIsReady() ? MSP_FLASHFS_FLAG_READY : 0);
flags |= (flashfsIsSupported() ? MSP_FLASHFS_FLAG_SUPPORTED : 0);
sbufWriteU8(dst, flags);
sbufWriteU32(dst, geometry->sectors);

View file

@ -111,6 +111,11 @@ bool flashfsIsReady(void)
return m25p16_isReady();
}
bool flashfsIsSupported(void)
{
return flashfsGetSize() > 0;
}
uint32_t flashfsGetSize(void)
{
return m25p16_getGeometry()->totalSize;

View file

@ -46,6 +46,7 @@ bool flashfsFlushAsync(void);
void flashfsFlushSync(void);
void flashfsInit(void);
bool flashfsIsSupported(void);
bool flashfsIsReady(void);
bool flashfsIsEOF(void);