changeset 207:8b11031e38a7

Adding convenience loader scripts for DFU based microcontrollers
author Jacob Alexander <haata@kiibohd.com>
date Sun, 14 Sep 2014 16:22:27 -0700
parents c6a90fe8cf2f
children 5805b1abb5d4
files Lib/CMake/build.cmake Lib/CMake/modules.cmake LoadFile/load LoadFile/load.dfu LoadFile/load.teensy LoadFile/winload LoadFile/winload.teensy
diffstat 7 files changed, 64 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/CMake/build.cmake	Sun Sep 14 16:03:10 2014 -0700
+++ b/Lib/CMake/build.cmake	Sun Sep 14 16:22:27 2014 -0700
@@ -79,3 +79,25 @@
 	COMMENT "Chip usage for ${CHIP}"
 )
 
+
+
+###
+# Setup Loader Script and Program
+#
+
+#| First check for DFU based controllers
+if( DEFINED DFU )
+	configure_file( LoadFile/load.dfu load NEWLINE_STYLE UNIX )
+
+#| Next check for Teensy based
+elseif ( DEFINED TEENSY )
+	# Provides the user with the correct teensy-loader-cli command for the built .HEX file
+	# Windows
+	if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+		configure_file( LoadFile/winload.teensy load NEWLINE_STYLE UNIX )
+	# Default
+	else()
+		configure_file( LoadFile/load.teensy load NEWLINE_STYLE UNIX )
+	endif()
+endif()
+
--- a/Lib/CMake/modules.cmake	Sun Sep 14 16:03:10 2014 -0700
+++ b/Lib/CMake/modules.cmake	Sun Sep 14 16:22:27 2014 -0700
@@ -264,19 +264,3 @@
 	)
 endif()
 
-
-
-###
-# Setup Loader Script and Program
-#
-
-#| Provides the user with the correct teensy-loader-cli command for the built .HEX file
-#| Windows
-if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-	configure_file( LoadFile/winload load NEWLINE_STYLE UNIX )
-#| Default
-else()
-	configure_file( LoadFile/load load NEWLINE_STYLE UNIX )
-endif()
-
-
--- a/LoadFile/load	Sun Sep 14 16:03:10 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-#| First check to see teensy-loader-cli has been compiled
-if [ ! -e teensy-loader-cli/teensy-loader-cli ]; then
-	# Compile teensy-loader-cli
-	mkdir -p teensy-loader-cli
-	cd teensy-loader-cli
-	cmake -G "Unix Makefiles" @CMAKE_SOURCE_DIR@/LoadFile
-	make
-	cd -
-fi
-
-#| Loads the hex file onto the teensy
-teensy-loader-cli/teensy-loader-cli -mmcu=@MCU@ -w @TARGET_HEX@
-
-exit 0
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LoadFile/load.dfu	Sun Sep 14 16:22:27 2014 -0700
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Load via dfu-util
+# Used for McHCK based uCs
+dfu-util -D @TARGET_BIN@
+
+exit $?
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LoadFile/load.teensy	Sun Sep 14 16:22:27 2014 -0700
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+#| First check to see teensy-loader-cli has been compiled
+if [ ! -e teensy-loader-cli/teensy-loader-cli ]; then
+	# Compile teensy-loader-cli
+	mkdir -p teensy-loader-cli
+	cd teensy-loader-cli
+	cmake -G "Unix Makefiles" @CMAKE_SOURCE_DIR@/LoadFile
+	make
+	cd -
+fi
+
+#| Loads the hex file onto the teensy
+teensy-loader-cli/teensy-loader-cli -mmcu=@MCU@ -w @TARGET_HEX@
+
+exit $?
+
--- a/LoadFile/winload	Sun Sep 14 16:03:10 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-#| First check to see teensy-loader-cli has been compiled
-if [ ! -e teensy-loader-cli/teensy-loader-cli ]; then
-	# Compile teensy-loader-cli
-	mkdir -p teensy-loader-cli
-	cd teensy-loader-cli
-	cmake -G "Unix Makefiles" $(cygpath -u @CMAKE_SOURCE_DIR@/LoadFile)
-	make
-	cd -
-fi
-
-#| Loads the hex file onto the teensy
-teensy-loader-cli/teensy-loader-cli -mmcu=@MCU@ -w @TARGET_HEX@
-
-exit 0
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LoadFile/winload.teensy	Sun Sep 14 16:22:27 2014 -0700
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+#| First check to see teensy-loader-cli has been compiled
+if [ ! -e teensy-loader-cli/teensy-loader-cli ]; then
+	# Compile teensy-loader-cli
+	mkdir -p teensy-loader-cli
+	cd teensy-loader-cli
+	cmake -G "Unix Makefiles" $(cygpath -u @CMAKE_SOURCE_DIR@/LoadFile)
+	make
+	cd -
+fi
+
+#| Loads the hex file onto the teensy
+teensy-loader-cli/teensy-loader-cli -mmcu=@MCU@ -w @TARGET_HEX@
+
+exit $?
+