Skip to content

Commit

Permalink
Ensure numeric arguments are integers in ARMH7Interface (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
iory authored Jan 10, 2024
1 parent 593603a commit df31a12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rcb4/armh7interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def memory_cstruct(self, cls, v_idx=0, addr=None, size=None):
return cls(buf)

def memory_write(self, addr, length, data):
addr = int(addr) # for numpy
cnt = 1
e_size = length
skip_size = 0
Expand All @@ -311,10 +312,10 @@ def cfunc_call(self, func_string, *args):
byte_list = bytearray(n)
byte_list[0] = n
byte_list[1] = 0xfa
byte_list[2:6] = addr.to_bytes(4, byteorder='little')
byte_list[2:6] = int(addr).to_bytes(4, byteorder='little')
byte_list[6] = argc
for i in range(argc):
byte_list[7 + i * 4] = args[i].to_bytes(4, byteorder='little')
byte_list[7 + i * 4] = int(args[i]).to_bytes(4, byteorder='little')
byte_list[n - 1] = rcb4_checksum(byte_list[0:n-1])
return self.serial_write(byte_list)

Expand Down

1 comment on commit df31a12

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.