mirror of
https://codeberg.org/SiB64/turbo_weather.git
synced 2026-06-28 23:49:51 +02:00
Compare commits
No commits in common. "54f7c7bcdecc5d88830a1a32cf27ca65457dc99e" and "68fa884b4ca0895ec316df863e616a6fec31d530" have entirely different histories.
54f7c7bcde
...
68fa884b4c
1 changed files with 5 additions and 10 deletions
15
src/turbo.py
15
src/turbo.py
|
|
@ -168,9 +168,7 @@ def clock(line):
|
|||
freq.add(t, c)
|
||||
s = freq.solve()
|
||||
if s is None:
|
||||
if t is None:
|
||||
t = time.time()
|
||||
return echo(line, f"{c} {t:.1f}")
|
||||
return echo(line)
|
||||
return echo(line, f"{c} {t:.1f}", *("%.4g" % ss for ss in s[0]))
|
||||
|
||||
Data = {}
|
||||
|
|
@ -179,11 +177,9 @@ def data(line):
|
|||
ll = line.split()
|
||||
try:
|
||||
c = ll[0]
|
||||
d = [int(l, 16) for l in ll[1:]]
|
||||
if ll[1:]:
|
||||
data[c] = d
|
||||
emit_data(c)
|
||||
return echo(line)
|
||||
Data[c] = [int(l, 16) for l in ll[1:]]
|
||||
emit_data(c)
|
||||
return echo(line)
|
||||
except Exception as e:
|
||||
Debug(e, line)
|
||||
return noise(line, "h")
|
||||
|
|
@ -241,7 +237,6 @@ def emit_adc(c, cc):
|
|||
if C["mode"] == turbocmd.ADC_MODE["DIFF"]:
|
||||
if a & 0x8000:
|
||||
a -= 0x10000
|
||||
a *= 2
|
||||
elif C["mode"] != turbocmd.ADC_MODE["NORM"]:
|
||||
continue
|
||||
REF = None
|
||||
|
|
@ -297,7 +292,7 @@ def emit_adc_pretty():
|
|||
if k == "RFP/2.5V":
|
||||
pretty = f" Vrf {A/500:.4f} V"
|
||||
if kk[1] == "VDD":
|
||||
units=". Vdd"
|
||||
units=" Vdd"
|
||||
try:
|
||||
AA, x = ADC_mV["VDD/1V"]
|
||||
mV = AA*10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue