Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure numeric arguments are integers in ARMH7Interface #13

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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