Check IsTakingSnapshot is not set before starting snapshot

old-commit-hash: 7cd2c4c18f76143f7d71e001a3c934fd43e65089
This commit is contained in:
Willem Melching
2020-03-17 11:42:17 -07:00
parent 209e2250d8
commit 84e2f106db
+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