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.
This commit is contained in:
Martijn Plak 2024-01-24 16:32:46 +01:00
commit 1d14bc38c5
4 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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);
}

View file

@ -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.