Add HID bootloader build module (thanks to Stefan Hellermann).
This commit is contained in:
		
							parent
							
								
									532b3a18f1
								
							
						
					
					
						commit
						393fc71d8e
					
				
					 78 changed files with 219 additions and 3 deletions
				
			
		
							
								
								
									
										70
									
								
								LUFA/Build/lufa.hid.in
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								LUFA/Build/lufa.hid.in
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,70 @@
 | 
			
		|||
#
 | 
			
		||||
#             LUFA Library
 | 
			
		||||
#     Copyright (C) Dean Camera, 2012.
 | 
			
		||||
#
 | 
			
		||||
#  dean [at] fourwalledcubicle [dot] com
 | 
			
		||||
#           www.lufa-lib.org
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
LUFA_BUILD_MODULES         += HID
 | 
			
		||||
LUFA_BUILD_TARGETS         += hid hid-teensy
 | 
			
		||||
LUFA_BUILD_MANDATORY_VARS  += MCU TARGET
 | 
			
		||||
LUFA_BUILD_OPTIONAL_VARS   += 
 | 
			
		||||
LUFA_BUILD_PROVIDED_VARS   += 
 | 
			
		||||
LUFA_BUILD_PROVIDED_MACROS += 
 | 
			
		||||
 | 
			
		||||
# -----------------------------------------------------------------------------
 | 
			
		||||
#               LUFA HID Bootloader Buildsystem Makefile Module.
 | 
			
		||||
# -----------------------------------------------------------------------------
 | 
			
		||||
# DESCRIPTION:
 | 
			
		||||
#   Provides a set of targets to re-program a device currently running a HID
 | 
			
		||||
#   class bootloader with a project's FLASH files.
 | 
			
		||||
# -----------------------------------------------------------------------------
 | 
			
		||||
# TARGETS:
 | 
			
		||||
#
 | 
			
		||||
#    hid                       - Program FLASH into target via
 | 
			
		||||
#                                hid_bootloader_cli
 | 
			
		||||
#    hid-teensy                - Program FLASH into target via
 | 
			
		||||
#                                teensy_loader_cli
 | 
			
		||||
#
 | 
			
		||||
# MANDATORY PARAMETERS:
 | 
			
		||||
#
 | 
			
		||||
#    MCU                       - Microcontroller device model name
 | 
			
		||||
#    TARGET                    - Application name
 | 
			
		||||
#
 | 
			
		||||
# OPTIONAL PARAMETERS:
 | 
			
		||||
#
 | 
			
		||||
#    (None)
 | 
			
		||||
#
 | 
			
		||||
# PROVIDED VARIABLES:
 | 
			
		||||
#
 | 
			
		||||
#    (None)
 | 
			
		||||
#
 | 
			
		||||
# PROVIDED MACROS:
 | 
			
		||||
#
 | 
			
		||||
#    (None)
 | 
			
		||||
#
 | 
			
		||||
# -----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
ERROR_IF_UNSET   ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
 | 
			
		||||
ERROR_IF_EMPTY   ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
 | 
			
		||||
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
 | 
			
		||||
 | 
			
		||||
# Sanity-check values of mandatory user-supplied variables
 | 
			
		||||
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
 | 
			
		||||
$(call ERROR_IF_EMPTY, MCU)
 | 
			
		||||
$(call ERROR_IF_EMPTY, TARGET)
 | 
			
		||||
 | 
			
		||||
# Output Messages
 | 
			
		||||
MSG_HID_BOOTLOADER_CMD := ' [HID]     :'
 | 
			
		||||
 | 
			
		||||
hid: $(TARGET).hex $(MAKEFILE_LIST)
 | 
			
		||||
	@echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with hid_bootloader_cli using \"$<\"
 | 
			
		||||
	hid_bootloader_cli -mmcu=$(MCU) -v $<
 | 
			
		||||
 | 
			
		||||
hid-teensy: $(TARGET).hex $(MAKEFILE_LIST)
 | 
			
		||||
	@echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with teensy_loader_cli using \"$<\"
 | 
			
		||||
	teensy_loader_cli -mmcu=$(MCU) -v $<
 | 
			
		||||
 | 
			
		||||
# Phony build targets for this module
 | 
			
		||||
.PHONY: hid hid-teensy
 | 
			
		||||
| 
						 | 
				
			
			@ -31,5 +31,6 @@ include $(LUFA_PATH)/Build/lufa.build.in
 | 
			
		|||
include $(LUFA_PATH)/Build/lufa.cppcheck.in
 | 
			
		||||
include $(LUFA_PATH)/Build/lufa.doxygen.in
 | 
			
		||||
include $(LUFA_PATH)/Build/lufa.dfu.in
 | 
			
		||||
include $(LUFA_PATH)/Build/lufa.hid.in
 | 
			
		||||
include $(LUFA_PATH)/Build/lufa.avrdude.in
 | 
			
		||||
include $(LUFA_PATH)/Build/lufa.atprogram.in
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,6 +38,7 @@
 | 
			
		|||
 *  \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis
 | 
			
		||||
 *  \li \subpage Page_BuildModule_DFU - Device Programming
 | 
			
		||||
 *  \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation
 | 
			
		||||
 *  \li \subpage Page_BuildModule_HID - Device Programming
 | 
			
		||||
 *  \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
| 
						 | 
				
			
			@ -512,11 +513,12 @@
 | 
			
		|||
 *
 | 
			
		||||
 *  The DFU programming utility LUFA build system module, providing targets to reprogram an
 | 
			
		||||
 *  Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
 | 
			
		||||
 *  This module requires a DFU class bootloader to be running in the target.
 | 
			
		||||
 *  This module requires a DFU class bootloader to be running in the target, compatible with
 | 
			
		||||
 *  the DFU bootloader protocol as published by Atmel.
 | 
			
		||||
 *
 | 
			
		||||
 *  To use this module in your application makefile, add the following code:
 | 
			
		||||
 *  \code
 | 
			
		||||
 *  include $(LUFA_PATH)/Build/lufa.dfu.in
 | 
			
		||||
 *  include $(LUFA_PATH)/Build/lufa.dfu.in
 | 
			
		||||
 *  \endcode
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_BuildModule_DFU_Requirements Requirements
 | 
			
		||||
| 
						 | 
				
			
			@ -653,6 +655,75 @@
 | 
			
		|||
 *  </table>
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
 /** \page Page_BuildModule_HID The HID build module
 | 
			
		||||
 *
 | 
			
		||||
 *  The HID programming utility LUFA build system module, providing targets to reprogram an
 | 
			
		||||
 *  Atmel processor's FLASH memory with a project's compiled binary output file. This module
 | 
			
		||||
 *  requires a HID class bootloader to be running in the target, using a protocol compatible
 | 
			
		||||
 *  with the PJRC "HalfKay" protocol (<a>http://www.pjrc.com/teensy/halfkay_protocol.html</a>).
 | 
			
		||||
 *
 | 
			
		||||
 *  To use this module in your application makefile, add the following code:
 | 
			
		||||
 *  \code
 | 
			
		||||
 *  include $(LUFA_PATH)/Build/lufa.hid.in
 | 
			
		||||
 *  \endcode
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_BuildModule_HID_Requirements Requirements
 | 
			
		||||
 *  This module requires either the <tt>hid_bootloader_cli</tt> utility from the included LUFA HID
 | 
			
		||||
 *  class bootloader API subdirectory, or the <tt>teensy_loader_cli</tt> utility from PJRC
 | 
			
		||||
 *  (<a>http://www.pjrc.com/teensy/loader_cli.html</a>) to be available in your system's <b>PATH</b>
 | 
			
		||||
 *  variable.
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_BuildModule_HID_Targets Targets
 | 
			
		||||
 *
 | 
			
		||||
 *  <table>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td><tt>hid</tt></td>
 | 
			
		||||
 *    <td>Program the device FLASH memory with the application's executable data using <tt>hid_bootloader_cli</tt>.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td><tt>hid-teensy</tt></td>
 | 
			
		||||
 *    <td>Program the device EEPROM memory with the application's executable data using <tt>teensy_loader_cli</tt>.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters
 | 
			
		||||
 *
 | 
			
		||||
 *  <table>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td><tt>MCU</tt></td>
 | 
			
		||||
 *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td><tt>TARGET</tt></td>
 | 
			
		||||
 *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_BuildModule_HID_OptionalParams Optional Parameters
 | 
			
		||||
 *
 | 
			
		||||
 *  <table>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td><i>None</i></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_BuildModule_HID_ProvideVariables Module Provided Variables
 | 
			
		||||
 *
 | 
			
		||||
 *  <table>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td><i>None</i></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table> 
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros
 | 
			
		||||
 *
 | 
			
		||||
 *  <table>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td><i>None</i></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
 /** \page Page_BuildModule_SOURCES The SOURCES build module
 | 
			
		||||
 *
 | 
			
		||||
 *  The SOURCES LUFA build system module, providing variables listing the various LUFA source files
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue