Skip to content

Commit

Permalink
SIYI: cope with 2 voltage packet sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Jul 12, 2024
1 parent 1888343 commit 1db8384
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MAVProxy/modules/mavproxy_SIYI/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,10 @@ def parse_packet(self, pkt):
self.have_horizon_lines = False

elif cmd == READ_VOLTAGES:
y,p,r, = self.unpack(cmd, "<hhh", data)
if len(data) == 11:
y,p,r,_,_,_ = self.unpack(cmd, "<hhhhhb", data)
else:
y,p,r = self.unpack(cmd, "<hhh", data)
self.last_volt_t = time.time()
self.voltages = (r*0.001,p*0.001,y*0.001)
self.send_named_float('VLT_R', self.voltages[0])
Expand Down

0 comments on commit 1db8384

Please sign in to comment.