mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 23:33:58 +08:00
* Safe and efficient asynchronous writing parameters * call putNonBlocking in locationd * remove space * ->AsyncWriter * remove semicolon * use member function * asyc write multiple times * add test case for AsyncWriter * merge master * add missing include * public * cleanup * create once * cleanup * update that * explicit waiting * improve test case * pass prefix to asywriter * move to params * assert(queue.empty()) * add comment * add todo * test_power_monitoring: remove patch * rm laikad.py * fix import --------- Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
19 lines
449 B
Python
19 lines
449 B
Python
from openpilot.common.params_pyx import Params, ParamKeyType, UnknownKeyName
|
|
assert Params
|
|
assert ParamKeyType
|
|
assert UnknownKeyName
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
|
|
params = Params()
|
|
key = sys.argv[1]
|
|
assert params.check_key(key), f"unknown param: {key}"
|
|
|
|
if len(sys.argv) == 3:
|
|
val = sys.argv[2]
|
|
print(f"SET: {key} = {val}")
|
|
params.put(key, val)
|
|
elif len(sys.argv) == 2:
|
|
print(f"GET: {key} = {params.get(key)}")
|