From 1d14bc38c5f4e01462287393ab73ddf901ba5d5b Mon Sep 17 00:00:00 2001 From: Martijn Plak Date: Wed, 24 Jan 2024 16:32:46 +0100 Subject: [PATCH] Rename CMD_READ_MEM_DOWNLOAD flag. It got included in pm3_cmd.lua but shouldn't be because it's not a command. Also, the bitshift in the value upsets some versions of lua. --- armsrc/appmain.c | 2 +- bootrom/bootrom.c | 2 +- client/src/comms.c | 2 +- include/pm3_cmd.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 06adfce88..ad21ac940 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -2374,7 +2374,7 @@ static void PacketReceived(PacketCommandNG *packet) { bool isok = true; uint8_t *base = NULL; - bool raw_address_mode = (flags & CMD_READ_MEM_DOWNLOAD_RAW) != 0; + bool raw_address_mode = (flags & READ_MEM_DOWNLOAD_FLAG_RAW) != 0; if (!raw_address_mode) { base = (uint8_t *) _flash_start; diff --git a/bootrom/bootrom.c b/bootrom/bootrom.c index 7f23ce3e9..3c9c096ad 100644 --- a/bootrom/bootrom.c +++ b/bootrom/bootrom.c @@ -169,7 +169,7 @@ static void UsbPacketReceived(uint8_t *packet) { bool isok = true; uint8_t *base = NULL; - bool raw_address_mode = (flags & CMD_READ_MEM_DOWNLOAD_RAW) != 0; + bool raw_address_mode = (flags & READ_MEM_DOWNLOAD_FLAG_RAW) != 0; if (!raw_address_mode) { base = (uint8_t *) _flash_start; diff --git a/client/src/comms.c b/client/src/comms.c index c47c24cb7..9098b7d81 100644 --- a/client/src/comms.c +++ b/client/src/comms.c @@ -1136,7 +1136,7 @@ bool GetFromDevice(DeviceMemType_t memtype, uint8_t *dest, uint32_t bytes, uint3 } case MCU_FLASH: case MCU_MEM: { - uint32_t flags = memtype == MCU_MEM ? CMD_READ_MEM_DOWNLOAD_RAW : 0; + uint32_t flags = memtype == MCU_MEM ? READ_MEM_DOWNLOAD_FLAG_RAW : 0; SendCommandBL(CMD_READ_MEM_DOWNLOAD, start_index, bytes, flags, NULL, 0); return dl_it(dest, bytes, response, ms_timeout, show_warning, CMD_READ_MEM_DOWNLOADED); } diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index 45da25e6d..80d6f50dd 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -897,7 +897,7 @@ typedef struct { #define BL_VERSION_1_0_0 BL_MAKE_VERSION(1, 0, 0) /* CMD_READ_MEM_DOWNLOAD flags */ -#define CMD_READ_MEM_DOWNLOAD_RAW (1<<0) +#define READ_MEM_DOWNLOAD_FLAG_RAW (1<<0) /* CMD_START_FLASH may have three arguments: start of area to flash, end of area to flash, optional magic.