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

Fixed missing parenthesis in word build up from byes. #26

Merged
merged 1 commit into from
May 24, 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
4 changes: 2 additions & 2 deletions PyICe/twi_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2940,7 +2940,7 @@ def read_register_list(self, addr7, command_codes, data_size, use_pec):
packet = self.parser.read_message()
# sorted_cc_list = sorted(list(set(command_codes)))
# results_dict = {cc: ChannelReadException('listread unknown err') for cc in sorted_cc_list } # Start with results dictionary filled with ChannelReadException(s).
return dict(list(zip(command_codes, [byte for byte in packet["payload"]])))
return dict(list(zip(command_codes, [byte for byte in packet["payload"]]))) # TODO - WON'T Work with Words!!!!
def write_register(self, addr7, commandCode, data, data_size, use_pec):
payload = int.to_bytes(self.SMBUS_WRITE_REGISTER, length=1, byteorder="big") # Transaction hint for client
payload += int.to_bytes(addr7, length=1, byteorder="big")
Expand All @@ -2958,7 +2958,7 @@ def read_register(self, addr7, commandCode, data_size, use_pec):
payload += int.to_bytes(data_size, length=1, byteorder="big") # Will be 8 or 16
self.interface.write_raw(self.talker.assemble(source=self.src_id, destination=self.dest_id, payload=payload.decode(encoding=STR_ENCODING)))
packet = self.parser.read_message()
return packet["payload"][1] * 256 if data_size==16 else 0 + packet["payload"][0]
return (packet["payload"][1] * 256 if data_size==16 else 0) + packet["payload"][0]
def receive_byte(self, addr7, use_pec=False): #TODO PyICe is broken here, needs to support receive_byte with Pec
payload = int.to_bytes(self.SMBUS_RECEIVE_BYTE, length=1, byteorder="big") # Transaction hint for client
payload += int.to_bytes(addr7, length=1, byteorder="big")
Expand Down