comparison arm.cmake @ 118:b61ca96b7c24

File and macro modifications for supporting Teensy 3.1
author Jacob Alexander <haata@kiibohd.com>
date Sun, 02 Feb 2014 17:33:23 -0800
parents 6704aba435f0
children 0bad1499ec19
comparison
equal deleted inserted replaced
117:5ffefdf89b37 118:b61ca96b7c24
1 ###| CMAKE Kiibohd Controller |### 1 ###| CMAKE Kiibohd Controller |###
2 # 2 #
3 # Jacob Alexander 2011-2013 3 # Jacob Alexander 2011-2014
4 # Due to this file's usefulness: 4 # Due to this file's usefulness:
5 # 5 #
6 # Released into the Public Domain 6 # Released into the Public Domain
7 # 7 #
8 # Freescale ARM CMake Build Configuration 8 # Freescale ARM CMake Build Configuration
32 #| Chip Name (Linker) 32 #| Chip Name (Linker)
33 #| You _MUST_ set this to match the board you are using 33 #| You _MUST_ set this to match the board you are using
34 #| type "make clean" after changing this, so all files will be rebuilt 34 #| type "make clean" after changing this, so all files will be rebuilt
35 #| 35 #|
36 #| "mk20dx128" # Teensy 3.0 36 #| "mk20dx128" # Teensy 3.0
37 #| "mk20dx256" # Teensy 3.1
37 set( CHIP "mk20dx128" ) 38 set( CHIP "mk20dx128" )
39 #set( CHIP "mk20dx256" )
38 40
39 message( STATUS "Chip Selected:" ) 41 message( STATUS "Chip Selected:" )
40 message( "${CHIP}" ) 42 message( "${CHIP}" )
41 set( MCU "${CHIP}" ) # For loading script compatibility 43 set( MCU "${CHIP}" ) # For loading script compatibility
42 44
43 45
46 #| Chip Base Type
47 #| Automatically chosed based on the chip name.
48 if ( "${CHIP}" MATCHES "^mk20dx.*$" )
49 set( CHIP_FAMILY "mk20dx" )
50 message( STATUS "Chip Family:" )
51 message( "${CHIP_FAMILY}" )
52 else ()
53 message( FATAL_ERROR "Unknown chip family: ${CHIP}" )
54 endif ()
55
56
44 #| CPU Type 57 #| CPU Type
45 #| You _MUST_ set this to match the board you are using 58 #| You _MUST_ set this to match the board you are using
46 #| type "make clean" after changing this, so all files will be rebuilt 59 #| type "make clean" after changing this, so all files will be rebuilt
47 #| 60 #|
48 #| "cortex-m4" # Teensy 3.0 61 #| "cortex-m4" # Teensy 3.0, 3.1
49 set( CPU "cortex-m4" ) 62 set( CPU "cortex-m4" )
50 63
51 message( STATUS "CPU Selected:" ) 64 message( STATUS "CPU Selected:" )
52 message( "${CPU}" ) 65 message( "${CPU}" )
53 66
54 67
55 #| Extra Compiler Sources 68 #| Extra Compiler Sources
56 #| Mostly for convenience functions like interrupt handlers 69 #| Mostly for convenience functions like interrupt handlers
57 set( COMPILER_SRCS 70 set( COMPILER_SRCS
58 Lib/${CHIP}.c 71 Lib/${CHIP_FAMILY}.c
59 Lib/delay.c 72 Lib/delay.c
60 ) 73 )
61 74
62 message( STATUS "Compiler Source Files:" ) 75 message( STATUS "Compiler Source Files:" )
63 message( "${COMPILER_SRCS}" ) 76 message( "${COMPILER_SRCS}" )
85 #| -f...: tuning, see GCC manual 98 #| -f...: tuning, see GCC manual
86 #| NOTE: -fshort-wchar is specified to allow USB strings be passed conveniently 99 #| NOTE: -fshort-wchar is specified to allow USB strings be passed conveniently
87 set( TUNING "-mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar" ) 100 set( TUNING "-mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar" )
88 101
89 102
90 #| Optimization level, can be [0, 1, 2, 3, s]. 103 #| Optimization level, can be [0, 1, 2, 3, s].
91 #| 0 = turn off optimization. s = optimize for size. 104 #| 0 = turn off optimization. s = optimize for size.
92 #| (Note: 3 is not always the best optimization level.) 105 #| (Note: 3 is not always the best optimization level.)
93 set( OPT "s" ) 106 set( OPT "s" )
94 107
95 108