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()
+
)
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()
-
-
+++ /dev/null
-#!/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
+#!/bin/bash
+
+# Load via dfu-util
+# Used for McHCK based uCs
+dfu-util -D @TARGET_BIN@
+
+exit $?
+
--- /dev/null
+#!/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 $?
+
+++ /dev/null
-#!/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
+#!/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 $?
+