Skip to content

Commit 7a99728

Browse files
committed
Forbid BL address for custom address
1 parent 3654834 commit 7a99728

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/change_address.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
print("Invalid address. Address must be between 0 and 127")
3838
exit(1)
3939

40+
if new_address == 100:
41+
print("The address 0x64 is reserved for bootloader mode. Please choose a different address.")
42+
exit(1)
43+
4044
print(f"Changing address of device at {hex(selected_device.address)} to {hex(new_address)}...")
4145
selected_device.change_address(new_address)
4246
sleep(1) # Give the device time to reset

0 commit comments

Comments
 (0)