Skip to content

Commit fdf0cd3

Browse files
committed
[BLE] Fix getMemoryFirstNodeAddress
1 parent f46724a commit fdf0cd3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/MPDevice.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,15 @@ QByteArray MPDevice::getMemoryFirstNodeAddress(void)
968968
if (isBLE())
969969
{
970970
/* BLE: Address format is 2 bytes little endian. last 1 bit is node number (for pages that can accomodate 2 nodes) and first 15 bits are page address */
971-
return QByteArray::fromHex("0200");
971+
auto flashMbSize = get_flashMbSize();
972+
if (1 == flashMbSize || 2 == flashMbSize || 32 == flashMbSize)
973+
{
974+
return QByteArray::fromHex("0100");
975+
}
976+
else
977+
{
978+
return QByteArray::fromHex("0200");
979+
}
972980
}
973981
/* Address format is 2 bytes little endian. last 3 bits are node number and first 13 bits are page address */
974982
switch(get_flashMbSize())

0 commit comments

Comments
 (0)