You've already forked TEF6686_Driver
unmute if needed
This commit is contained in:
3
xrd.py
3
xrd.py
@@ -64,6 +64,7 @@ def process_command(tef: TEF6686, data: bytes, state: dict, conn: socket.socket)
|
||||
state['last_tune'] = freq
|
||||
tef.FM_Tune_To(1, freq)
|
||||
if FREQ_NOT_ALLOWED_RANGE and freq >= FREQ_NOT_ALLOWED_RANGE[0] and freq <= FREQ_NOT_ALLOWED_RANGE[1]: tef.AUDIO_Set_Mute(True)
|
||||
else: tef.AUDIO_Set_Mute(False)
|
||||
out += f"T{freq*10}\n".encode()
|
||||
elif cmd.startswith(b"G"):
|
||||
eqims = int(cmd.decode().removeprefix("G").strip(), 2)
|
||||
@@ -87,6 +88,7 @@ def process_command(tef: TEF6686, data: bytes, state: dict, conn: socket.socket)
|
||||
tef.APPL_Set_OperationMode(False)
|
||||
tef.FM_Tune_To(1, state["last_tune"])
|
||||
if FREQ_NOT_ALLOWED_RANGE and state["last_tune"] >= FREQ_NOT_ALLOWED_RANGE[0] and state["last_tune"] <= FREQ_NOT_ALLOWED_RANGE[1]: tef.AUDIO_Set_Mute(True)
|
||||
else: tef.AUDIO_Set_Mute(False)
|
||||
elif cmd.startswith(b"X"):
|
||||
tef.APPL_Set_OperationMode(True)
|
||||
elif cmd.startswith(b"W"):
|
||||
@@ -122,6 +124,7 @@ def process_command(tef: TEF6686, data: bytes, state: dict, conn: socket.socket)
|
||||
|
||||
tef.FM_Tune_To(1, state["last_tune"])
|
||||
if FREQ_NOT_ALLOWED_RANGE and freq >= FREQ_NOT_ALLOWED_RANGE[0] and freq <= FREQ_NOT_ALLOWED_RANGE[1]: tef.AUDIO_Set_Mute(True)
|
||||
else: tef.AUDIO_Set_Mute(False)
|
||||
tef.FM_Set_Bandwidth((state["bw"] == 0), 2360 if (state["bw"] == 0) else (state["bw"] // 100))
|
||||
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user