mirror of https://github.com/g4klx/MMDVM.git
Merge pull request #12 from phl0/mmdvmmenu
Enable for selection of board layout
This commit is contained in:
commit
3434109972
|
@ -1,4 +1,4 @@
|
||||||
#! /bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
|
@ -10,23 +10,23 @@
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# On a Linux based system, such as a Raspberry Pi, this script will perform
|
# On a Linux based system, such as a Raspberry Pi, this script will perform
|
||||||
# Modafacation to the Config.c file for most options. It makes a Back up when
|
# Modafacation to the Config.c file for most options. It makes a Back up when
|
||||||
# you staet the script if none is present. You must recompile and load firmwhare
|
# you staet the script if none is present. You must recompile and load firmwhare
|
||||||
# on Due if changes are made.
|
# on Due if changes are made.
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
|
@ -44,7 +44,7 @@ confbak=Config.h.bak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check for backup file and make one if not present
|
# Check for backup file and make one if not present
|
||||||
|
|
||||||
if [ ! -f $confbak ];then
|
if [ ! -f $confbak ];then
|
||||||
|
|
||||||
|
@ -57,27 +57,36 @@ do
|
||||||
clear
|
clear
|
||||||
cat<<EOF
|
cat<<EOF
|
||||||
==============================================================
|
==============================================================
|
||||||
MMDVM COnfiguration Options
|
MMDVM Configuration Options
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
Please enter your choice:
|
Please enter your choice:
|
||||||
|
|
||||||
(1) Enable 12.0 MHZ CLock (4) Use the COS to lockout the modem
|
(1) Enable 12.0 MHZ Clock
|
||||||
(2) Enable 14.4 MHz Clock (5) Use pins to output the current mode
|
(2) Enable 14.4 MHz Clock
|
||||||
(3) Enable 19.2 MHz Clock (6) Return to Default
|
(3) Enable 19.2 MHz Clock
|
||||||
|
(4) Use the COS to lockout the modem
|
||||||
|
(5) Use pins to output the current mode
|
||||||
|
(6) Use original Arduino Due layout
|
||||||
|
(7) Use new Arduino Due layout
|
||||||
|
(8) Use layout for SP8NTH board
|
||||||
|
(9) Return to Default
|
||||||
|
|
||||||
(Q)uit
|
(Q)uit
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
EOF
|
EOF
|
||||||
read -n1 -s
|
read -n1 -s
|
||||||
case "$REPLY" in
|
case "$REPLY" in
|
||||||
"1") sudo sed -e 's/\/\/ #define EXTERNAL_OSC 12/ #define EXTERNAL_OSC 12/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "12.0 MHZ CLock Enabled";;
|
"1") sed -e 's/\/\/ #define EXTERNAL_OSC 12000000/#define EXTERNAL_OSC 12000000/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "12.0 MHz clock enabled";;
|
||||||
"2") sudo sed -e 's/\/\/ #define EXTERNAL_OSC 14/ #define EXTERNAL_OSC 14/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "14.4 MHZ CLock Enabled";;
|
"2") sed -e 's/\/\/ #define EXTERNAL_OSC 14400000/#define EXTERNAL_OSC 14400000/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "14.4 MHz clock enabled";;
|
||||||
"3") sudo sed -e 's/\/\/ #define EXTERNAL_OSC 19/ #define EXTERNAL_OSC 19/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "19.2 MHZ CLock Enabled";;
|
"3") sed -e 's/\/\/ #define EXTERNAL_OSC 19200000/#define EXTERNAL_OSC 19200000/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "19.2 MHz clock enabled";;
|
||||||
"4") sudo sed -e 's/\/\/ #define USE/ #define USE/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "COS As Lockout Enabled";;
|
"4") sed -e 's/\/\/ #define USE_COS_AS_LOCKOUT /#define USE_COS_AS_LOCKOUT/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "COS as Lockout enabled";;
|
||||||
"5") sudo sed -e 's/\/\/ #define ARDUINO_MODE/ #define ARDUINO_MODE/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "Mode Pins Enabled";;
|
"5") sed -e 's/\/\/ #define ARDUINO_MODE_PINS/#define ARDUINO_MODE_PINS/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "Mode pins Enabled";;
|
||||||
"6") MV -f $confbak $conf ;;
|
"6") sed -e 's/\/\/ #define ARDUINO_DUE_PAPA/#define ARDUINO_DUE_PAPA/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "Original Arduino Due layout enabled";;
|
||||||
"Q") echo "If any changes are made you need to upload to MMDVM" && exit;;
|
"7") sed -e 's/\/\/ #define ARDUINO_DUE_ZUM/#define ARDUINO_DUE_ZUM/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "New Arduino Due layout enabled";;
|
||||||
"q") echo "If any changes are made you need to upload to MMDVM" && exit;;
|
"8") sed -e 's/\/\/ #define ARDUINO_DUE_NTH/#define ARDUINO_DUE_NTH/' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "Layout for SP8NTH board enabled";;
|
||||||
|
"9") mv -f $confbak $conf ;;
|
||||||
|
"Q") echo "If any changes are made you need to (re-)upload the firmware to MMDVM" && exit;;
|
||||||
|
"q") echo "If any changes are made you need to (re-)upload the firmware to MMDVM" && exit;;
|
||||||
* ) echo "invalid option" ;;
|
* ) echo "invalid option" ;;
|
||||||
esac
|
esac
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
Loading…
Reference in New Issue