fix fm tune
This commit is contained in:
@@ -118,11 +118,13 @@ def process_command(tef: AutoFMAM, data: bytes, state: State, conn: socket.socke
|
||||
if cmd.startswith(b"T"):
|
||||
freq = int(cmd.decode().removeprefix("T").strip())
|
||||
if freq < 153 or freq > 108000: continue
|
||||
mode = TEF6686.TuneTo_Mode.FM_Jump
|
||||
if tef.modulation == Modulation.AM: mode = TEF6686.TuneTo_Mode.Preset
|
||||
tef.set_modulation(freq)
|
||||
match tef.modulation:
|
||||
case Modulation.FM:
|
||||
freq //= 10
|
||||
tef.Tune_To(TEF6686.TuneTo_Mode.FM_Jump, freq)
|
||||
tef.Tune_To(mode, freq)
|
||||
state.last_tune_fm = freq
|
||||
case Modulation.AM:
|
||||
tef.Tune_To(TEF6686.TuneTo_Mode.Preset, freq)
|
||||
|
||||
Reference in New Issue
Block a user