# HG changeset patch # User Jacob Alexander # Date 1410736947 25200 # Node ID 8b11031e38a7094dbd1262448e8cf5eca4b93e18 # Parent c6a90fe8cf2f251dcf3caf222093f9bef8073590 Adding convenience loader scripts for DFU based microcontrollers diff -r c6a90fe8cf2f -r 8b11031e38a7 Lib/CMake/build.cmake --- 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() + diff -r c6a90fe8cf2f -r 8b11031e38a7 Lib/CMake/modules.cmake --- 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() - - diff -r c6a90fe8cf2f -r 8b11031e38a7 LoadFile/load --- 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 - diff -r c6a90fe8cf2f -r 8b11031e38a7 LoadFile/load.dfu --- /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 $? + diff -r c6a90fe8cf2f -r 8b11031e38a7 LoadFile/load.teensy --- /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 $? + diff -r c6a90fe8cf2f -r 8b11031e38a7 LoadFile/winload --- 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 - diff -r c6a90fe8cf2f -r 8b11031e38a7 LoadFile/winload.teensy --- /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 $? +