Check IsTakingSnapshot is not set before starting snapshot

This commit is contained in:
Willem Melching
2020-03-17 11:42:17 -07:00
parent 58ab243bdb
commit 7cd2c4c18f
+3
View File
@@ -22,6 +22,9 @@ def snapshot():
params = Params()
front_camera_allowed = int(params.get("RecordFront"))
if params.get("IsTakingSnapshot") == b"1":
return None
params.put("IsTakingSnapshot", "1")
params.put("Offroad_IsTakingSnapshot", json.dumps(OFFROAD_ALERTS["Offroad_IsTakingSnapshot"]))
time.sleep(2.0) # Give thermald time to read the param, or if just started give camerad time to start