File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ async def setup(self, use_cam: bool = False) -> None:
124124 await self .io .set_flowctrl (SIO_RTS_CTS_HS )
125125 await self .io .set_rts (True )
126126
127+ await self ._abort ()
128+
127129 # see if we need to adjust baudrate. This appears to be the case sometimes.
128130 try :
129131 self ._version = await self .get_firmware_version ()
@@ -692,7 +694,10 @@ async def read_luminescence(
692694 resp = await self .send_command ("O" )
693695 assert resp == b"\x06 0000\x03 "
694696
695- body = await self ._read_until (b"\x03 " , timeout = 60 * 3 )
697+ # 2m10s of reading per 1 second of integration time
698+ # allow 60 seconds flat
699+ timeout = 60 + integration_time_seconds * (2 * 60 + 10 )
700+ body = await self ._read_until (b"\x03 " , timeout = timeout )
696701 assert body is not None
697702 return self ._parse_body (body )
698703
You can’t perform that action at this time.
0 commit comments