]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - avr.cmake
Added more CLI commands.
[kiibohd-controller.git] / avr.cmake
index 7b0a1787cc469976601b05cbd1463f91728ac25e..c39ed0daa6eb43b11827700eeacca9f9061a0e4f 100644 (file)
--- a/avr.cmake
+++ b/avr.cmake
@@ -40,6 +40,9 @@ set( SIZE    "avr-size"    )
 #set( MCU "atmega32u4" )
 set( MCU "at90usb1286" )
 
+message( STATUS "MCU Selected:" )
+message( "${MCU}" )
+
 
 #| Extra Compiler Sources
 #| Mostly for convenience functions like interrupt handlers
@@ -48,6 +51,11 @@ set( COMPILER_SRCS
 )
 
 
+#| USB Defines
+set( VENDOR_ID  "0x16C0" )
+set( PRODUCT_ID "0x047D" )
+
+
 #| Compiler flag to set the C Standard level.
 #|     c89   = "ANSI" C
 #|     gnu89 = c89 plus GCC extensions
@@ -63,6 +71,7 @@ set( WARN "-Wall -Wstrict-prototypes" )
 
 #| Tuning Options
 #|  -f...:        tuning, see GCC manual and avr-libc documentation
+#| NOTE: -fshort-wchar is specified to allow USB strings be passed conveniently
 set( TUNING "-funsigned-char -funsigned-bitfields -ffunction-sections -fpack-struct -fshort-enums" )
 
 
@@ -91,7 +100,7 @@ set( GENDEPFLAGS "-MMD -MP" )
 
 
 #| Compiler Flags
-add_definitions( "-mmcu=${MCU} -DF_CPU=${F_CPU} -O${OPT} ${TUNING} ${WARN} ${CSTANDARD} ${GENDEPFLAGS}" )
+add_definitions( "-mmcu=${MCU} -DF_CPU=${F_CPU} -D_${MCU}_=1 -O${OPT} ${TUNING} ${WARN} ${CSTANDARD} ${GENDEPFLAGS}" )
 
 
 #| Linker Flags
@@ -102,7 +111,7 @@ set( LINKER_FLAGS "-mmcu=${MCU} -Wl,-Map=${TARGET}.map,--cref -Wl,--relax -Wl,--
 set( HEX_FLAGS -O ${FORMAT} -R .eeprom -R .fuse -R .lock -R .signature )
 
 
-#| Eep Flags
+#| Eep Flags (XXX, I've removed this target from the builds, but keeping the set line as a note)
 set( EEP_FLAGS -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ${FORMAT} )