cmake_minimum_required(VERSION 2.8  )

include(generic-gcc-avr.cmake)

project(bulb_mm C ASM)

set(CMAKE_BUILD_TYPE MinSizeRel)
 
# Adjust for your ISP
set(AVR_MCU attiny2313)

#set(AVR_PROGRAMMER usbtiny)
#set(AVR_PROGRAMMER avr910)
set(AVR_PROGRAMMER avrisp2)
#set(AVR_UPLOADTOOL_PORT /dev/ttyUSB0)
#set(AVR_UPLOADTOOL_OPTIONS -b 115200)

set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -std=c99)

include_directories(/usr/avr/include/avr)
set_source_files_properties(bulb.asm PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")

#add_avr_executable(bulb_orig
#    bulb.asm)

add_avr_executable(bulb
    bulb.c)

add_avr_executable(bulb_dim
    bulb_dim.c)

add_avr_executable(bulb_animation
    bulb_animation.c)
