@@ -297,8 +297,8 @@ def roi_xy(self):
297
297
"""Returns the x and y coordinates of the sensor's region of interest"""
298
298
temp = self ._read_register (_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE )
299
299
300
- x = (int .from_bytes (temp ) & 0x0F ) + 1
301
- y = ((int .from_bytes (temp ) & 0xF0 ) >> 4 ) + 1
300
+ x = (int .from_bytes (temp , 'big' ) & 0x0F ) + 1
301
+ y = ((int .from_bytes (temp , 'big' ) & 0xF0 ) >> 4 ) + 1
302
302
303
303
return x , y
304
304
@@ -313,21 +313,23 @@ def roi_xy(self, data):
313
313
if x > 10 or y > 10 :
314
314
optical_center = 199
315
315
316
- self ._write_register (_ROI_CONFIG__USER_ROI_CENTRE_SPAD , optical_center .to_bytes ())
316
+ self ._write_register (
317
+ _ROI_CONFIG__USER_ROI_CENTRE_SPAD , optical_center .to_bytes (1 , 'big' )
318
+ )
317
319
self ._write_register (
318
320
_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE ,
319
- ((y - 1 ) << 4 | (x - 1 )).to_bytes (),
320
- ) # noqa: E501
321
+ ((y - 1 ) << 4 | (x - 1 )).to_bytes (1 , 'big' ),
322
+ )
321
323
322
324
@property
323
325
def roi_center (self ):
324
326
"""Returns the center of the sensor's region of interest"""
325
327
temp = self ._read_register (_ROI_CONFIG__USER_ROI_CENTRE_SPAD )
326
- return int .from_bytes (temp )
328
+ return int .from_bytes (temp , 'big' )
327
329
328
330
@roi_center .setter
329
331
def roi_center (self , center ):
330
- self ._write_register (_ROI_CONFIG__USER_ROI_CENTRE_SPAD , center .to_bytes ())
332
+ self ._write_register (_ROI_CONFIG__USER_ROI_CENTRE_SPAD , center .to_bytes (1 , 'big' ))
331
333
332
334
def _write_register (self , address , data , length = None ):
333
335
if length is None :
0 commit comments