Fix slot based busy detection

This commit is contained in:
Mashintime 2023-05-13 09:08:01 -04:00
parent 93f92ac8b8
commit 21f46e9a7f

View file

@ -1251,11 +1251,11 @@ class RF:
range_end = range[1]
# define the area, we are detecting busy state
#dfft = dfft[120:176] if TNC.low_bandwidth_mode else dfft[65:231]
dfft = dfft[range_start:range_end]
slotdfft = dfft[range_start:range_end]
# Check for signals higher than average by checking for "100"
# If we have a signal, increment our channel_busy delay counter
# so we have a smoother state toggle
if np.sum(dfft[dfft > avg + 15]) >= 400 and not TNC.transmitting:
if np.sum(slotdfft[slotdfft > avg + 15]) >= 400 and not TNC.transmitting:
ModemParam.channel_busy = True
ModemParam.channel_busy_slot[slot] = True
# Limit delay counter to a maximum of 200. The higher this value,