Skip to content

Commit

Permalink
Command set target address page replaced by rewind target address
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-b-jakobsson committed Aug 25, 2024
1 parent e5d1392 commit 4b0b78a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,9 @@ This command returns the bootloader version.

Available since bootloader v3.

## Command 0x84 = Set target address page (master write)
## Command 0x84 = Rewind target address (master write)

Sets the target address page that is used when reading from or writing
to the SMC.

The byte address is 64 * page.
Rewinds the target address to 0.

Available since bootloader v3.

Expand Down
18 changes: 5 additions & 13 deletions command.inc
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,12 @@ cmd_reboot_3:
.endm

;******************************************************************************
; Function...: CMD_SET_ADDR_PAGE
; Description: Sets target address page. Byte address is page * 64.
; In.........: r16 address page
; Function...: CMD_REWIND_TARGET_ADDR
; Description: Sets target address to 0
; In.........: Nothing
; Out........: Nothing
.macro CMD_SET_ADDR_PAGE
; Move input to address register high byte (=> page * 256)
mov target_addrH, r16
clr target_addrL
; Divide by 4 to get byte address (=> page * 256 / 4 = page * 64)
lsr target_addrH
ror target_addrL
lsr target_addrH
ror target_addrL
.macro CMD_REWIND_TARGET_ADDR
movw ZH:ZL, zeroH:zeroL
.endm

;******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion i2c.asm
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ i2c_receive2:
i2c_receive3:
cpi i2c_command, 0x84
brne i2c_receive4
CMD_SET_ADDR_PAGE
CMD_REWIND_TARGET_ADDR

i2c_receive4:
clr i2c_command
Expand Down

0 comments on commit 4b0b78a

Please sign in to comment.