Kiibohd Controller
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。

arm.cmake 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ###| CMAKE Kiibohd Controller |###
  2. #
  3. # Jacob Alexander 2011-2013
  4. # Due to this file's usefulness:
  5. #
  6. # Released into the Public Domain
  7. #
  8. # Freescale ARM CMake Build Configuration
  9. #
  10. ###
  11. #| Set the Compilers (must be set first)
  12. include( CMakeForceCompiler )
  13. cmake_force_c_compiler ( arm-none-eabi-gcc AVRCCompiler )
  14. cmake_force_cxx_compiler( arm-none-eabi-g++ AVRCxxCompiler )
  15. #| Compiler Binaries
  16. set( OBJCOPY "arm-none-eabi-objcopy" )
  17. set( OBJDUMP "arm-none-eabi-objdump" )
  18. set( NM "arm-none-eabi-nm" )
  19. set( SIZE "arm-none-eabi-size" )
  20. ###
  21. # ARM Defines and Linker Options
  22. #
  23. #| Chip Name (Linker)
  24. #| You _MUST_ set this to match the board you are using
  25. #| type "make clean" after changing this, so all files will be rebuilt
  26. #|
  27. #| "mk20dx128" # Teensy 3.0
  28. set( CHIP "mk20dx128" )
  29. message( STATUS "Chip Selected:" )
  30. message( "${CHIP}" )
  31. set( MCU "${CHIP}" ) # For loading script compatibility
  32. #| CPU Type
  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
  35. #|
  36. #| "cortex-m4" # Teensy 3.0
  37. set( CPU "cortex-m4" )
  38. message( STATUS "CPU Selected:" )
  39. message( "${CPU}" )
  40. #| Extra Compiler Sources
  41. #| Mostly for convenience functions like interrupt handlers
  42. set( COMPILER_SRCS
  43. Lib/${CHIP}.c
  44. Lib/delay.c
  45. )
  46. message( STATUS "Compiler Source Files:" )
  47. message( "${COMPILER_SRCS}" )
  48. #| USB Defines
  49. set( VENDOR_ID "0x16C0" )
  50. set( PRODUCT_ID "0x0487" )
  51. #| Compiler flag to set the C Standard level.
  52. #| c89 = "ANSI" C
  53. #| gnu89 = c89 plus GCC extensions
  54. #| c99 = ISO C99 standard (not yet fully implemented)
  55. #| gnu99 = c99 plus GCC extensions
  56. set( CSTANDARD "-std=gnu99" )
  57. #| Warning Options
  58. #| -Wall...: warning level
  59. set( WARN "-Wall -g" )
  60. #| Tuning Options
  61. #| -f...: tuning, see GCC manual
  62. #| NOTE: -fshort-wchar is specified to allow USB strings be passed conveniently
  63. set( TUNING "-mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar" )
  64. #| Optimization level, can be [0, 1, 2, 3, s].
  65. #| 0 = turn off optimization. s = optimize for size.
  66. #| (Note: 3 is not always the best optimization level.)
  67. set( OPT "s" )
  68. #| Output Format
  69. #| srec, ihex, binary
  70. set( FORMAT "ihex" )
  71. #| Processor frequency.
  72. #| Normally the first thing your program should do is set the clock prescaler,
  73. #| so your program will run at the correct speed. You should also set this
  74. #| variable to same clock speed. The _delay_ms() macro uses this, and many
  75. #| examples use this variable to calculate timings. Do not add a "UL" here.
  76. set( F_CPU "48000000" )
  77. #| Dependency Files
  78. #| Compiler flags to generate dependency files.
  79. set( GENDEPFLAGS "-MMD" )
  80. #| Compiler Flags
  81. add_definitions( "-mcpu=${CPU} -DF_CPU=${F_CPU} -D_${CHIP}_=1 -O${OPT} ${TUNING} ${WARN} ${CSTANDARD} ${GENDEPFLAGS}" )
  82. #| Linker Flags
  83. set( LINKER_FLAGS "-mcpu=${CPU} -Wl,-Map=${TARGET}.map,--cref -Wl,--gc-sections -mthumb -Wl,--no-wchar-size-warning -T${CMAKE_CURRENT_SOURCE_DIR}/Lib/${CHIP}.ld" )
  84. #| Hex Flags (XXX, CMake seems to have issues if you quote the arguments for the custom commands...)
  85. set( HEX_FLAGS -O ${FORMAT} -R .eeprom )
  86. #| Lss Flags
  87. set( LSS_FLAGS -h -S -z )