Skip to content

Commit

Permalink
Allow MSP clients to know if the target has a flash bootloer.
Browse files Browse the repository at this point in the history
Targets with flash bootloaders need a different reboot sequence for
firmware updates.
  • Loading branch information
hydra committed Aug 7, 2019
1 parent 64c8573 commit 7d72636
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/msp/msp.c
Expand Up @@ -515,6 +515,7 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
#define TARGET_HAS_VCP_BIT 0
#define TARGET_HAS_SOFTSERIAL_BIT 1
#define TARGET_IS_UNIFIED_BIT 2
#define TARGET_HAS_FLASH_BOOTLOADER_BIT 3

uint8_t targetCapabilities = 0;
#ifdef USE_VCP
Expand All @@ -526,7 +527,9 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
#if defined(USE_UNIFIED_TARGET)
targetCapabilities |= 1 << TARGET_IS_UNIFIED_BIT;
#endif

#if defined(USE_FLASH_BOOT_LOADER)
targetCapabilities |= 1 << TARGET_HAS_FLASH_BOOTLOADER_BIT;
#endif
sbufWriteU8(dst, targetCapabilities);

// Target name with explicit length
Expand Down

0 comments on commit 7d72636

Please sign in to comment.