Explorar el Código

setup function PTT and can switch logic

Pierre Bourdin hace 6 días
padre
commit
bc94004349
Se han modificado 3 ficheros con 29 adiciones y 10 borrados
  1. 20 0
      functions.sh
  2. 5 9
      tx_process/0_txmire
  3. 4 1
      variables.sh

+ 20 - 0
functions.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+ptt_on () {
+if [[ $PTTLOGIC == 0 ]];
+then
+	raspi-gpio set $GPIO_PTT dl
+else
+	raspi-gpio set $GPIO_PTT dh
+fi
+}
+
+
+ptt_off () {
+if [[ $PTTLOGIC == 0 ]];
+then
+        raspi-gpio set $GPIO_PTT dh
+else    
+        raspi-gpio set $GPIO_PTT dl
+fi      
+}

+ 5 - 9
tx_process/0_txmire

@@ -1,22 +1,18 @@
 #!/bin/bash
 
+source ~/BallonSonde/variables.sh
+source ~/BallonSonde/functions.sh
+
 touch /ramfs/.canbetx
 cp /home/pi/BallonSonde/sound/mire.wav /ramfs/totx.wav
 
 # Old version stylez
 # Setup the GPIO4 as output for Tx
-raspi-gpio set 4 op && raspi-gpio set 4 dh
 
-raspi-gpio set 4 dl
+ptt_on
 sleep 1
 echo " => Playing WAV file"
 #cd ~/trxamadrmv3_7/linux
 #./txwfal 0
-#sleep 1
-#aplay ~/BallonSonde/sound/annonce_start.wav
-#sleep 1
 aplay /home/pi/BallonSonde/sound/mire.wav 
-#sleep 1
-#aplay ~/BallonSonde/sound/annonce_stop.wav
-raspi-gpio set 4 dh
-#
+ptt_off

+ 4 - 1
variables.sh

@@ -10,5 +10,8 @@ SSTV_BANNER="Ballon machin truc, mission truc."
 
 WEBSITE_REPORT="https://f4koa.fr"
 
+GPIO_PTT="22"
 
-
+# Selon comment on cable le transistor pour le PTT
+# Peux être à 1 pour activer le PTT ou 0
+LOGICPTT=1