Change bytes per line
This commit is contained in:
parent
b70d022604
commit
2388d4f96e
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ def persist_calib_data(calib_data):
|
||||||
def calibrate(calib_data_path='calib-data.bin'):
|
def calibrate(calib_data_path='calib-data.bin'):
|
||||||
# no idea what this is:
|
# no idea what this is:
|
||||||
write_hw_reg32(0x8000205c, 7)
|
write_hw_reg32(0x8000205c, 7)
|
||||||
if read_hw_reg32(0x80002080) != 3:
|
if read_hw_reg32(0x80002080) not in [2, 3]:
|
||||||
raise Exception('Unexpected register value')
|
raise Exception('Unexpected register value')
|
||||||
|
|
||||||
dev=identify_sensor()
|
dev=identify_sensor()
|
||||||
|
|
@ -82,7 +82,7 @@ def calibrate(calib_data_path='calib-data.bin'):
|
||||||
with open(calib_data_path, 'wb') as f:
|
with open(calib_data_path, 'wb') as f:
|
||||||
f.write(calib_data)
|
f.write(calib_data)
|
||||||
|
|
||||||
lines=[calib_data[i:i+0x90+8] for i in range(0, len(calib_data), 0x90+8)] # TODO work out where "bytes per line" constant is comming from
|
lines=[calib_data[i:i+0x70+8] for i in range(0, len(calib_data), 0x70+8)] # TODO work out where "bytes per line" constant is comming from
|
||||||
lines=[Line(i) for i in lines]
|
lines=[Line(i) for i in lines]
|
||||||
frame4=[i.serialize() for i in lines if i.frame == 4] # why 4?
|
frame4=[i.serialize() for i in lines if i.frame == 4] # why 4?
|
||||||
frame4=b''.join(frame4)
|
frame4=b''.join(frame4)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue