whoops
This commit is contained in:
@@ -46,7 +46,7 @@ def init_tef():
|
||||
tef = TEF6686(p)
|
||||
tef.init(clock=CLOCK)
|
||||
tef.AUDIO_Set_Mute(False)
|
||||
tef.AUDIO_Set_Volume(30)
|
||||
tef.AUDIO_Set_Volume(20)
|
||||
tef.FM_Tune_To(TEF6686.TuneTo_Mode.Preset, INITIAL_FREQ)
|
||||
tef.FM_Set_RDS(1)
|
||||
tef.FM_Set_ChannelEqualizer(INITIAL_EQ)
|
||||
@@ -202,19 +202,19 @@ def send_rds_data(tef: TEF6686, conn: socket.socket, state: dict):
|
||||
data = b""
|
||||
if (status & (1 << 13) == 0):
|
||||
err = 0
|
||||
err |= ((dec_error >> 8) & 0x30) >> 4
|
||||
err |= ((dec_error >> 8) & 0xC)
|
||||
err |= ((dec_error >> 8) & 3) << 4
|
||||
err |= (dec_error & 0x30) >> 4
|
||||
err |= (dec_error & 0xC)
|
||||
err |= (dec_error & 3) << 4
|
||||
|
||||
data = b"R"
|
||||
data += f"{B:04X}{C:04X}{D:04X}{err:02X}\n".encode()
|
||||
|
||||
pi_error = (dec_error >> 14) & 0b11
|
||||
pi_error = (dec_error >> 8) & 0b11
|
||||
if pi_error < 3:
|
||||
data += b"P" + f"{A:04X}".encode()
|
||||
data += b"?" * pi_error + b"\n"
|
||||
elif status & (1 << 12):
|
||||
pi_error = (dec_error >> 10) & 0b11
|
||||
pi_error = (dec_error >> 2) & 0b11
|
||||
if pi_error < 3:
|
||||
data += b"P" + f"{C:04X}".encode()
|
||||
data += b"?" * pi_error + b"\n"
|
||||
|
||||
Reference in New Issue
Block a user