GPIO classes for controlling GPIO pins and PWM

Using WiringPi (gpio command) for PWM and
sysfs control using file descriptors for control of pin read/write

Requires a tweak to the Pi SD card image to install gpio

Includes a bash script to turn LEDs on and off

Change-Id: Iaa254e026db336b09758d24eb1ddcffccfb27655
Signed-off-by: Jim Ostrowski <yimmy13@gmail.com>
diff --git a/frc971/raspi/rootfs/make_sd.sh b/frc971/raspi/rootfs/make_sd.sh
index 3bafacc..4c50a6b 100755
--- a/frc971/raspi/rootfs/make_sd.sh
+++ b/frc971/raspi/rootfs/make_sd.sh
@@ -34,9 +34,10 @@
 
 # Put a timestamp on when this card got created and by whom
 TIMESTAMP_FILE="${PARTITION}/home/pi/.DiskFlashedDate.txt"
-date > "${TIMESTAMP_FILE}"
-git rev-parse HEAD >> "${TIMESTAMP_FILE}"
-whoami >> "${TIMESTAMP_FILE}"
+echo "Date Imaged: "`date` > "${TIMESTAMP_FILE}"
+echo "Image file: ${IMAGE}"  >> "${TIMESTAMP_FILE}"
+echo "Git tag: "`git rev-parse HEAD` >> "${TIMESTAMP_FILE}"
+echo "User: "`whoami` >> "${TIMESTAMP_FILE}"
 
 echo "Starting a shell for any manual configuration"
 target /bin/bash --rcfile /root/.bashrc
diff --git a/frc971/raspi/rootfs/modify_rootfs.sh b/frc971/raspi/rootfs/modify_rootfs.sh
index 0020f35..fd9bec9 100755
--- a/frc971/raspi/rootfs/modify_rootfs.sh
+++ b/frc971/raspi/rootfs/modify_rootfs.sh
@@ -102,9 +102,9 @@
 
 # Add a file to show when this image was last modified and by whom
 TIMESTAMP_FILE="${PARTITION}/home/pi/.ImageModifiedDate.txt"
-date > "${TIMESTAMP_FILE}"
-git rev-parse HEAD >> "${TIMESTAMP_FILE}"
-whoami >> "${TIMESTAMP_FILE}"
+echo "Date modified:"`date` > "${TIMESTAMP_FILE}"
+echo "Git tag: "`git rev-parse HEAD` >> "${TIMESTAMP_FILE}"
+echo "User: "`whoami` >> "${TIMESTAMP_FILE}"
 
 # Run a prompt as root inside the target to poke around and check things.
 target /bin/bash --rcfile /root/.bashrc
diff --git a/frc971/raspi/rootfs/target_configure.sh b/frc971/raspi/rootfs/target_configure.sh
index db3fb36..6d9171e 100755
--- a/frc971/raspi/rootfs/target_configure.sh
+++ b/frc971/raspi/rootfs/target_configure.sh
@@ -41,6 +41,14 @@
   libnice-dev \
   feh
 
+# Install WiringPi gpio for PWM control
+if [[ ! -e "/usr/bin/gpio" ]]; then
+    cd /tmp
+    git clone https://github.com/WiringPi/WiringPi.git
+    cd WiringPi
+    ./build
+fi
+
 echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils
 
 # Add a .bashrc and friends for root.