*~
*.bat~
*.swp
+Build
+Build*
-SET(APPLIST "")
+set(APPLIST "")
if(TINYAPP_LED0)
- LIST(APPEND APPLIST Led0)
+ list(APPEND APPLIST Led0)
endif()
if(TINYAPP_DCMOTOR)
- LIST(APPEND APPLIST DCMotor)
+ list(APPEND APPLIST DCMotor)
endif()
if(TINYAPP_SHUTTERCTRL)
- LIST(APPEND APPLIST ShutterCtrl)
+ list(APPEND APPLIST ShutterCtrl)
endif()
if(TINYAPP_POWERSWITCH)
- LIST(APPEND APPLIST PowerSwitch)
+ list(APPEND APPLIST PowerSwitch)
endif()
if(TINYAPP_WORKHOURMETER)
- LIST(APPEND APPLIST WorkhourMeter)
+ list(APPEND APPLIST WorkhourMeter)
endif()
-OPTION(TINYAPP_LED0 "Build Led application" ON)
-OPTION(TINYAPP_DCMOTOR "Build DC Motor application" OFF)
-OPTION(TINYAPP_SHUTTERCTRL "Build Shutter Handler application" ON)
-OPTION(TINYAPP_POWERSWITCH "Build Powerswitch application" ON)
-OPTION(TINYAPP_WORKHOURMETER "Build WorkHourMeter application" ON)
+option(TINYAPP_LED0 "Build Led application" ON)
+option(TINYAPP_DCMOTOR "Build DC Motor application" OFF)
+option(TINYAPP_SHUTTERCTRL "Build Shutter Handler application" ON)
+option(TINYAPP_POWERSWITCH "Build Powerswitch application" ON)
+option(TINYAPP_WORKHOURMETER "Build WorkHourMeter application" ON)
subdirs(${APPLIST})
-#subdirs(Led0 DCMotor PowerSwitch ShutterCtrl WorkhourMeter)
+# subdirs(Led0 DCMotor PowerSwitch ShutterCtrl WorkhourMeter)
-#####################################################################
+# ##############################################################################
# simple AVR executable
-#####################################################################
-add_avr_executable(
- dcmotor
- main.cpp
- Led0.cpp
- DCMotor.cpp
- MotorHandler.cpp
- )
-if (AVR_MCU)
-target_link_libraries(
- dcmotor-${AVR_MCU}.elf
- avrHAL-${AVR_MCU}
- avrDrivers-${AVR_MCU}
- avrComm-${AVR_MCU}
- avrPtf-${AVR_MCU}
- avrDCMotorParameters-${AVR_MCU}
-)
-IF (${AVR_MCU} EQUAL "atmega328p")
- SET(AVRPROG arduino)
- SET(AVRPROG_MCU Atmega328p)
-ELSE(${AVR_MCU} EQUAL "atmega328p")
- SET(AVRPROG avr109)
- SET(AVRPROG_MCU m32u4)
-ENDIF(${AVR_MCU} EQUAL "atmega328p")
+# ##############################################################################
+add_avr_executable(dcmotor main.cpp Led0.cpp DCMotor.cpp MotorHandler.cpp)
+if(AVR_MCU)
+ target_link_libraries(
+ dcmotor-${AVR_MCU}.elf avrHAL-${AVR_MCU} avrDrivers-${AVR_MCU}
+ avrComm-${AVR_MCU} avrPtf-${AVR_MCU} avrDCMotorParameters-${AVR_MCU})
+ if(${AVR_MCU} EQUAL "atmega328p")
+ set(AVRPROG arduino)
+ set(AVRPROG_MCU Atmega328p)
+ else(${AVR_MCU} EQUAL "atmega328p")
+ set(AVRPROG avr109)
+ set(AVRPROG_MCU m32u4)
+ endif(${AVR_MCU} EQUAL "atmega328p")
elseif(STM32_MCU)
-target_link_libraries(
- dcmotor-${STM32_MCU}.elf
- avrHAL-${STM32_MCU}
- avrDrivers-${STM32_MCU}
- avrComm-${STM32_MCU}
- avrPtf-${STM32_MCU}
- avrDCMotorParameters-${STM32_MCU}
-)
+ target_link_libraries(
+ dcmotor-${STM32_MCU}.elf avrHAL-${STM32_MCU} avrDrivers-${STM32_MCU}
+ avrComm-${STM32_MCU} avrPtf-${STM32_MCU} avrDCMotorParameters-${STM32_MCU})
endif()
add_custom_target(
- flash_dcmotor
- COMMAND
- avrdude -c ${AVRPROG} -P ${AVRDUDE_PORT} -p ${AVRPROG_MCU} -b 57600 -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
- DEPENDS dcmotor-${AVR_MCU}.hex
- )
-
+ flash_dcmotor
+ COMMAND avrdude -c ${AVRPROG} -P ${AVRDUDE_PORT} -p ${AVRPROG_MCU} -b 57600
+ -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
+ DEPENDS dcmotor-${AVR_MCU}.hex)
-#####################################################################
+# ##############################################################################
# simple AVR executable
-#####################################################################
-add_avr_executable(
- toggle-led-cpp
- main.cpp
- Led0.cpp
- )
-
+# ##############################################################################
+add_avr_executable(toggle-led-cpp main.cpp Led0.cpp)
-#####################################################################
+# ##############################################################################
# simple AVR executable
-#####################################################################
-add_avr_executable(
- powerswitch
- main.cpp
- Led0.cpp
- Switch.cpp
- PowerswitchHandler.cpp
- )
+# ##############################################################################
+add_avr_executable(powerswitch main.cpp Led0.cpp Switch.cpp
+ PowerswitchHandler.cpp)
target_link_libraries(
- powerswitch-${AVR_MCU}.elf
- avrHAL-${AVR_MCU}
- avrDrivers-${AVR_MCU}
- avrComm-${AVR_MCU}
- avrPS-Ptf-${AVR_MCU}
- avrPowerswitchParameters-${AVR_MCU}
-)
+ powerswitch-${AVR_MCU}.elf avrHAL-${AVR_MCU} avrDrivers-${AVR_MCU}
+ avrComm-${AVR_MCU} avrPS-Ptf-${AVR_MCU} avrPowerswitchParameters-${AVR_MCU})
-IF ( "${AVR_MCU}" STREQUAL "atmega328p")
- SET(AVRPROG arduino)
- SET(AVRPROG_MCU Atmega328p)
- MESSAGE("AVR_MCU = ${AVR_MCU} Yes atmega")
-ELSE( "${AVR_MCU}" STREQUAL "atmega32u4")
- SET(AVRPROG avr109)
- SET(AVRPROG_MCU m32u4)
- MESSAGE("AVR_MCU = '${AVR_MCU}' if atmega328p not goot at all")
-ENDIF("${AVR_MCU}" STREQUAL "atmega328p")
+if("${AVR_MCU}" STREQUAL "atmega328p")
+ set(AVRPROG arduino)
+ set(AVRPROG_MCU Atmega328p)
+ message("AVR_MCU = ${AVR_MCU} Yes atmega")
+else("${AVR_MCU}" STREQUAL "atmega32u4")
+ set(AVRPROG avr109)
+ set(AVRPROG_MCU m32u4)
+ message("AVR_MCU = '${AVR_MCU}' if atmega328p not goot at all")
+endif("${AVR_MCU}" STREQUAL "atmega328p")
add_custom_target(
- flash_powerswitch
- COMMAND
- # avrdude -c arduino -P ${AVRDUDE_PORT} -p Atmega328p -b 57600 -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
- avrdude -c ${AVRPROG} -P ${AVRDUDE_PORT} -p ${AVRPROG_MCU} -b 57600 -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/powerswitch-${AVR_MCU}.hex:i
- DEPENDS powerswitch-${AVR_MCU}.hex
- )
-
+ flash_powerswitch
+ COMMAND # avrdude -c arduino -P ${AVRDUDE_PORT} -p Atmega328p -b 57600
+ # -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
+ avrdude -c ${AVRPROG} -P ${AVRDUDE_PORT} -p ${AVRPROG_MCU} -b 57600
+ -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/powerswitch-${AVR_MCU}.hex:i
+ DEPENDS powerswitch-${AVR_MCU}.hex)
-#####################################################################
+# ##############################################################################
# simple AVR executable
-#####################################################################
-add_avr_executable(
- shutterctrl
- main.cpp
- Led0.cpp
- ShutterHandler.cpp
- TouchScrHandler.cpp
- )
+# ##############################################################################
+add_avr_executable(shutterctrl main.cpp Led0.cpp ShutterHandler.cpp
+ TouchScrHandler.cpp)
target_link_libraries(
- shutterctrl-${AVR_MCU}.elf
- avrHAL-${AVR_MCU}
- avrDrivers-${AVR_MCU}
- avrComm-${AVR_MCU}
- avrSC-Ptf-${AVR_MCU}
- avrShutterCtrlParameters-${AVR_MCU}
-)
+ shutterctrl-${AVR_MCU}.elf avrHAL-${AVR_MCU} avrDrivers-${AVR_MCU}
+ avrComm-${AVR_MCU} avrSC-Ptf-${AVR_MCU} avrShutterCtrlParameters-${AVR_MCU})
-IF (${AVR_MCU} EQUAL "atmega328p")
- SET(AVRPROG arduino)
- SET(AVRPROG_MCU Atmega328p)
-ELSE(${AVR_MCU} EQUAL "atmega328p")
- SET(AVRPROG avr109)
- SET(AVRPROG_MCU m32u4)
-ENDIF(${AVR_MCU} EQUAL "atmega328p")
+if(${AVR_MCU} EQUAL "atmega328p")
+ set(AVRPROG arduino)
+ set(AVRPROG_MCU Atmega328p)
+else(${AVR_MCU} EQUAL "atmega328p")
+ set(AVRPROG avr109)
+ set(AVRPROG_MCU m32u4)
+endif(${AVR_MCU} EQUAL "atmega328p")
add_custom_target(
- flash_shutter
- COMMAND
- # avrdude -c arduino -P ${AVRDUDE_PORT} -p Atmega328p -b 57600 -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
- avrdude -c ${AVRPROG} -P ${AVRDUDE_PORT} -p ${AVRPROG_MCU} -b 57600 -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
- DEPENDS dcmotor-${AVR_MCU}.hex
- )
-
+ flash_shutter
+ COMMAND # avrdude -c arduino -P ${AVRDUDE_PORT} -p Atmega328p -b 57600
+ # -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
+ avrdude -c ${AVRPROG} -P ${AVRDUDE_PORT} -p ${AVRPROG_MCU} -b 57600
+ -Uflash:w:${CMAKE_CURRENT_BINARY_DIR}/dcmotor-${AVR_MCU}.hex:i
+ DEPENDS dcmotor-${AVR_MCU}.hex)
-#####################################################################
+# ##############################################################################
# simple AVR executable
-#####################################################################
-add_avr_executable(
- workmeter
- main.cpp
- Led0.cpp
- WorkMeterHandler.cpp
- Scheduler.cpp
- )
+# ##############################################################################
+add_avr_executable(workmeter main.cpp Led0.cpp WorkMeterHandler.cpp
+ Scheduler.cpp)
-set_target_properties(
- workmeter-${AVR_MCU}.elf PROPERTIES
- COMPILE_DEFINITIONS WORKMETER_PARAMETERS
- )
+set_target_properties(workmeter-${AVR_MCU}.elf PROPERTIES COMPILE_DEFINITIONS
+ WORKMETER_PARAMETERS)
target_link_libraries(
- workmeter-${AVR_MCU}.elf
- avrHAL-${AVR_MCU}
- avrDrivers-${AVR_MCU}
- avrComm-${AVR_MCU}
- avrWM-Ptf-${AVR_MCU}
- avrWorkMeterParameters-${AVR_MCU}
-)
-
-IF ( "${AVR_MCU}" STREQUAL "atmega328p")
- SET(AVRPROG arduino)
- SET(AVRPROG_MCU Atmega328p)
- MESSAGE("AVR_MCU = ${AVR_MCU} Yes atmega")
-ELSE( "${AVR_MCU}" STREQUAL "atmega32u4")
- SET(AVRPROG avr109)
- SET(AVRPROG_MCU m32u4)
- MESSAGE("AVR_MCU = '${AVR_MCU}' if atmega328p not goot at all")
-ENDIF("${AVR_MCU}" STREQUAL "atmega328p")
+ workmeter-${AVR_MCU}.elf avrHAL-${AVR_MCU} avrDrivers-${AVR_MCU}
+ avrComm-${AVR_MCU} avrWM-Ptf-${AVR_MCU} avrWorkMeterParameters-${AVR_MCU})
+if("${AVR_MCU}" STREQUAL "atmega328p")
+ set(AVRPROG arduino)
+ set(AVRPROG_MCU Atmega328p)
+ message("AVR_MCU = ${AVR_MCU} Yes atmega")
+else("${AVR_MCU}" STREQUAL "atmega32u4")
+ set(AVRPROG avr109)
+ set(AVRPROG_MCU m32u4)
+ message("AVR_MCU = '${AVR_MCU}' if atmega328p not goot at all")
+endif("${AVR_MCU}" STREQUAL "atmega328p")
project(tinyapp)
set(OPTSUBDIRS "")
-set(BUILD_TARGET "stm32g030" CACHE STRING "Target [stm32g030, stm32F103, atmega328p,atmega32u4]")
+set(BUILD_TARGET
+ "stm32g030"
+ CACHE STRING "Target [stm32g030, stm32F103, atmega328p,atmega32u4]")
if("${BUILD_TARGET}" STREQUAL "atmega328p")
include(${CMAKE_CURRENT_SOURCE_DIR}/rules/target-atmega328p.cmake)
-elseif ("${BUILD_TARGET}" STREQUAL "atmega32u4")
+elseif("${BUILD_TARGET}" STREQUAL "atmega32u4")
include(${CMAKE_CURRENT_SOURCE_DIR}/rules/target-atmega32u4.cmake)
list(APPEND OPTSUBDIRS Externals/LUFA-210130)
-elseif ("${BUILD_TARGET}" STREQUAL "stm32g030")
+elseif("${BUILD_TARGET}" STREQUAL "stm32g030")
include(${CMAKE_CURRENT_SOURCE_DIR}/rules/target-stm32g030.cmake)
else()
include(${CMAKE_CURRENT_SOURCE_DIR}/rules/target-atmega328p.cmake)
endif()
-if (NOT CMAKE_BUILD_TYPE)
+if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
-SUBDIRS(HAL Application Platform Communication Metadata ${OPTSUBDIRS})
+subdirs(HAL Application Platform Communication Metadata ${OPTSUBDIRS})
-INCLUDE_DIRECTORIES("${tinyapp_SOURCE_DIR}")
-INCLUDE_DIRECTORIES("${tinyapp_SOURCE_DIR}/HAL")
-INCLUDE_DIRECTORIES("${tinyapp_BINARY_DIR}")
-INCLUDE_DIRECTORIES("${tinyapp_BINARY_DIR}/Application")
+include_directories("${tinyapp_SOURCE_DIR}")
+include_directories("${tinyapp_SOURCE_DIR}/HAL")
+include_directories("${tinyapp_BINARY_DIR}")
+include_directories("${tinyapp_BINARY_DIR}/Application")
+option(TINYAPP_LED0 "Build Led application" ON)
+option(TINYAPP_DCMOTOR "Build DC Motor application" OFF)
+option(TINYAPP_SHUTTERCTRL "Build Shutter Handler application" ON)
+option(TINYAPP_POWERSWITCH "Build Powerswitch application" ON)
+if(WIN32)
+ set(AVRDUDE_PORT
+ "COM3"
+ CACHE STRING "Avrdude port to use for flashing")
+endif(WIN32)
-OPTION(TINYAPP_LED0 "Build Led application" ON)
-OPTION(TINYAPP_DCMOTOR "Build DC Motor application" OFF)
-OPTION(TINYAPP_SHUTTERCTRL "Build Shutter Handler application" ON)
-OPTION(TINYAPP_POWERSWITCH "Build Powerswitch application" ON)
+if(LINUX)
+ set(AVRDUDE_PORT
+ "/dev/ttyS3"
+ CACHE STRING "Avrdude port to use for flashing")
+endif(LINUX)
-IF (WIN32)
- SET(AVRDUDE_PORT "COM3" CACHE STRING "Avrdude port to use for flashing")
-ENDIF(WIN32)
-
-IF(LINUX)
-SET(AVRDUDE_PORT "/dev/ttyS3" CACHE STRING "Avrdude port to use for flashing")
-ENDIF(LINUX)
-
-# new way
-#CONFIGURE_FILE(${antcc_SOURCE_DIR}/src/antcc/config.h.cmake
-# ${antcc_BINARY_DIR}/src/antcc/config.h)
+# new way CONFIGURE_FILE(${antcc_SOURCE_DIR}/src/antcc/config.h.cmake
+# ${antcc_BINARY_DIR}/src/antcc/config.h)
-#####################################################################
+# ##############################################################################
# simple AVR library
-#####################################################################
+# ##############################################################################
add_avr_library(
avrHAL
AvrTimer0.cpp
AvrAdc.cpp
AvrPwm.cpp
AvrSpi.cpp
- AvrI2C.cpp
- )
-
+ AvrI2C.cpp)
-#####################################################################
+# ##############################################################################
# simple AVR library
-#####################################################################
+# ##############################################################################
add_avr_library(
avrDrivers
NetString.cpp
LiquidCrystal.cpp
PN532Interface_I2C.cpp
PN532.cpp
- Eeprom24C32_64.cpp
- )
-
+ Eeprom24C32_64.cpp)