added 15 second uptime extension for FSK mode

Removed unnecessary sleep and mode handling logic.
master-fsk-cw
Alan Johnston 2 weeks ago committed by GitHub
parent c6bc2c9647
commit 98335a753a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -228,8 +228,6 @@ output(txLed, txLedOn)
sleep(1)
output(txLed, txLedOff)
sleep(10) # to fix FSK no CW ID
battery_saver_check()
# print(txLedOn)
@ -265,6 +263,17 @@ if __name__ == "__main__":
except:
print("Pi Zero 2 not detected")
if ( mode == "y"):
try:
file = open("/home/pi/CubeSatSim/.mode")
mode = file.read(1)
except:
mode = "f"
if (debug_mode == 1):
print("Can't open .mode file, defaulting to FSK")
print("Mode is: ")
print(mode)
try:
system("cat /proc/uptime > /home/pi/CubeSatSim/uptime")
file = open("/home/pi/CubeSatSim/uptime")
@ -272,7 +281,10 @@ if __name__ == "__main__":
print(up)
uptime = float(up)
print(uptime)
if (uptime < uptime_time):
extra = 0
if (mode == 'f')
extra = 15
if (uptime < (uptime_time + extra)):
print("Uptime < threshold seconds")
else:
print("Uptime > threshold seconds")
@ -283,17 +295,8 @@ if __name__ == "__main__":
print("Can't open /proc/uptime")
print(skip)
if ( mode == "y"):
try:
file = open("/home/pi/CubeSatSim/.mode")
mode = file.read(1)
except:
mode = "f"
if (debug_mode == 1):
print("Can't open .mode file, defaulting to FSK")
print("Mode is: ")
print(mode)
if (mode == 'f')
sleep(10) # wait to avoid restart and truncated cw id
try:
file = open("/home/pi/CubeSatSim/beacon_off")
file.close()

Loading…
Cancel
Save

Powered by TurnKey Linux.