Old serial system
This commit is contained in:
@ -220,7 +220,7 @@ CMAKE_CACHEFILE_DIR:INTERNAL=/home/philipp/Programming/RGBcontroller
|
||||
//Major version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
|
||||
//Minor version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=9
|
||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=11
|
||||
//Patch version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_PATCH_VERSION:INTERNAL=4
|
||||
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
|
||||
@ -283,6 +283,8 @@ CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
|
||||
CMAKE_EXTRA_GENERATOR:INTERNAL=
|
||||
//Name of generator.
|
||||
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
|
||||
//Generator instance identifier.
|
||||
CMAKE_GENERATOR_INSTANCE:INTERNAL=
|
||||
//Name of generator platform.
|
||||
CMAKE_GENERATOR_PLATFORM:INTERNAL=
|
||||
//Name of generator toolset.
|
||||
@ -319,7 +321,7 @@ CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_RANLIB
|
||||
CMAKE_RANLIB-ADVANCED:INTERNAL=1
|
||||
//Path to CMake installation.
|
||||
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.9
|
||||
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.11
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
||||
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
||||
|
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# Relative path conversion top directories.
|
||||
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/philipp/Programming/RGBcontroller")
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# The generator used is:
|
||||
set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
|
||||
@ -7,92 +7,27 @@ set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
|
||||
# The top level Makefile was generated from the following files:
|
||||
set(CMAKE_MAKEFILE_DEPENDS
|
||||
"CMakeCache.txt"
|
||||
"CMakeFiles/3.9.4/CMakeCCompiler.cmake"
|
||||
"CMakeFiles/3.9.4/CMakeCXXCompiler.cmake"
|
||||
"CMakeFiles/3.9.4/CMakeSystem.cmake"
|
||||
"CMakeFiles/feature_tests.c"
|
||||
"CMakeFiles/feature_tests.cxx"
|
||||
"CMakeFiles/3.11.4/CMakeCCompiler.cmake"
|
||||
"CMakeFiles/3.11.4/CMakeCXXCompiler.cmake"
|
||||
"CMakeFiles/3.11.4/CMakeSystem.cmake"
|
||||
"CMakeLists.txt"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCCompiler.cmake.in"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCCompilerABI.c"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCInformation.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCXXCompiler.cmake.in"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCXXInformation.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCommonLanguageInclude.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeCompilerIdDetection.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeDetermineCCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeDetermineCXXCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeDetermineCompileFeatures.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeDetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeDetermineCompilerABI.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeDetermineCompilerId.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeDetermineSystem.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeFindBinUtils.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeGenericSystem.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeLanguageInformation.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeParseImplicitLinkInfo.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeSystem.cmake.in"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeSystemSpecificInformation.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeSystemSpecificInitialize.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeTestCCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeTestCXXCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/CMakeTestCompilerCommon.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/ADSP-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/ARMCC-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/AppleClang-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Borland-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Bruce-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Clang-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Clang-DetermineCompilerInternal.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Compaq-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Cray-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Embarcadero-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Fujitsu-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GHS-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU-C-FeatureTests.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU-C.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU-CXX-FeatureTests.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU-CXX.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU-FindBinUtils.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/GNU.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/HP-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/HP-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/IAR-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Intel-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/MIPSpro-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/MSVC-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/NVIDIA-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/PGI-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/PathScale-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/SCO-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/SDCC-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/SunPro-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/TI-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/Watcom-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/XL-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/XL-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/zOS-C-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Internal/FeatureTesting.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Platform/Linux-Determine-CXX.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Platform/Linux-GNU-C.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Platform/Linux-GNU-CXX.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Platform/Linux-GNU.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Platform/Linux.cmake"
|
||||
"/usr/share/cmake-3.9/Modules/Platform/UnixPaths.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeCInformation.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeCXXInformation.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeCommonLanguageInclude.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeGenericSystem.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeInitializeConfigs.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeLanguageInformation.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeSystemSpecificInformation.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/CMakeSystemSpecificInitialize.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Compiler/GNU-C.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Compiler/GNU-CXX.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Compiler/GNU.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Platform/Linux-GNU-C.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Platform/Linux-GNU-CXX.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Platform/Linux-GNU.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Platform/Linux.cmake"
|
||||
"/usr/share/cmake-3.11/Modules/Platform/UnixPaths.cmake"
|
||||
)
|
||||
|
||||
# The corresponding makefile is:
|
||||
@ -103,11 +38,6 @@ set(CMAKE_MAKEFILE_OUTPUTS
|
||||
|
||||
# Byproducts of CMake generate step:
|
||||
set(CMAKE_MAKEFILE_PRODUCTS
|
||||
"CMakeFiles/3.9.4/CMakeSystem.cmake"
|
||||
"CMakeFiles/3.9.4/CMakeCCompiler.cmake"
|
||||
"CMakeFiles/3.9.4/CMakeCXXCompiler.cmake"
|
||||
"CMakeFiles/3.9.4/CMakeCCompiler.cmake"
|
||||
"CMakeFiles/3.9.4/CMakeCXXCompiler.cmake"
|
||||
"CMakeFiles/CMakeDirectoryInformation.cmake"
|
||||
)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
|
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# Delete rule output on recipe failure.
|
||||
.DELETE_ON_ERROR:
|
||||
|
@ -1,3 +1,3 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# Delete rule output on recipe failure.
|
||||
.DELETE_ON_ERROR:
|
||||
|
Binary file not shown.
@ -9,6 +9,8 @@
|
||||
/home/philipp/Programming/RGBcontroller/WirelessRelay.cpp
|
||||
WirelessRelay.h
|
||||
/home/philipp/Programming/RGBcontroller/WirelessRelay.h
|
||||
avr/io.h
|
||||
-
|
||||
|
||||
/home/philipp/Programming/RGBcontroller/WirelessRelay.h
|
||||
util/delay.h
|
||||
@ -25,6 +27,8 @@ stdio.h
|
||||
-
|
||||
stdlib.h
|
||||
-
|
||||
avr/pgmspace.h
|
||||
-
|
||||
serial.h
|
||||
/home/philipp/Programming/RGBcontroller/serial.h
|
||||
writepin.h
|
||||
@ -71,6 +75,8 @@ string.h
|
||||
-
|
||||
stdlib.h
|
||||
-
|
||||
avr/pgmspace.h
|
||||
-
|
||||
|
||||
/home/philipp/Programming/RGBcontroller/writepin.h
|
||||
avr/io.h
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# Delete rule output on recipe failure.
|
||||
.DELETE_ON_ERROR:
|
||||
@ -70,17 +70,6 @@ CMakeFiles/rgbcontroller.dir/main.cpp.s: cmake_force
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rgbcontroller.dir/main.cpp.s"
|
||||
/usr/bin/avr-g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/philipp/Programming/RGBcontroller/main.cpp -o CMakeFiles/rgbcontroller.dir/main.cpp.s
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/main.cpp.o.requires:
|
||||
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/main.cpp.o.requires
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/main.cpp.o.provides: CMakeFiles/rgbcontroller.dir/main.cpp.o.requires
|
||||
$(MAKE) -f CMakeFiles/rgbcontroller.dir/build.make CMakeFiles/rgbcontroller.dir/main.cpp.o.provides.build
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/main.cpp.o.provides
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/main.cpp.o.provides.build: CMakeFiles/rgbcontroller.dir/main.cpp.o
|
||||
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/serial.cpp.o: CMakeFiles/rgbcontroller.dir/flags.make
|
||||
CMakeFiles/rgbcontroller.dir/serial.cpp.o: serial.cpp
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/philipp/Programming/RGBcontroller/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/rgbcontroller.dir/serial.cpp.o"
|
||||
@ -94,17 +83,6 @@ CMakeFiles/rgbcontroller.dir/serial.cpp.s: cmake_force
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rgbcontroller.dir/serial.cpp.s"
|
||||
/usr/bin/avr-g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/philipp/Programming/RGBcontroller/serial.cpp -o CMakeFiles/rgbcontroller.dir/serial.cpp.s
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/serial.cpp.o.requires:
|
||||
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/serial.cpp.o.requires
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/serial.cpp.o.provides: CMakeFiles/rgbcontroller.dir/serial.cpp.o.requires
|
||||
$(MAKE) -f CMakeFiles/rgbcontroller.dir/build.make CMakeFiles/rgbcontroller.dir/serial.cpp.o.provides.build
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/serial.cpp.o.provides
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/serial.cpp.o.provides.build: CMakeFiles/rgbcontroller.dir/serial.cpp.o
|
||||
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o: CMakeFiles/rgbcontroller.dir/flags.make
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o: WirelessRelay.cpp
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/philipp/Programming/RGBcontroller/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o"
|
||||
@ -118,17 +96,6 @@ CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.s: cmake_force
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.s"
|
||||
/usr/bin/avr-g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/philipp/Programming/RGBcontroller/WirelessRelay.cpp -o CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.s
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.requires:
|
||||
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.requires
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.provides: CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.requires
|
||||
$(MAKE) -f CMakeFiles/rgbcontroller.dir/build.make CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.provides.build
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.provides
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.provides.build: CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o
|
||||
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/pwm.cpp.o: CMakeFiles/rgbcontroller.dir/flags.make
|
||||
CMakeFiles/rgbcontroller.dir/pwm.cpp.o: pwm.cpp
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/philipp/Programming/RGBcontroller/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/rgbcontroller.dir/pwm.cpp.o"
|
||||
@ -142,17 +109,6 @@ CMakeFiles/rgbcontroller.dir/pwm.cpp.s: cmake_force
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rgbcontroller.dir/pwm.cpp.s"
|
||||
/usr/bin/avr-g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/philipp/Programming/RGBcontroller/pwm.cpp -o CMakeFiles/rgbcontroller.dir/pwm.cpp.s
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/pwm.cpp.o.requires:
|
||||
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/pwm.cpp.o.requires
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/pwm.cpp.o.provides: CMakeFiles/rgbcontroller.dir/pwm.cpp.o.requires
|
||||
$(MAKE) -f CMakeFiles/rgbcontroller.dir/build.make CMakeFiles/rgbcontroller.dir/pwm.cpp.o.provides.build
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/pwm.cpp.o.provides
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/pwm.cpp.o.provides.build: CMakeFiles/rgbcontroller.dir/pwm.cpp.o
|
||||
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/rgbled.cpp.o: CMakeFiles/rgbcontroller.dir/flags.make
|
||||
CMakeFiles/rgbcontroller.dir/rgbled.cpp.o: rgbled.cpp
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/philipp/Programming/RGBcontroller/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/rgbcontroller.dir/rgbled.cpp.o"
|
||||
@ -166,17 +122,6 @@ CMakeFiles/rgbcontroller.dir/rgbled.cpp.s: cmake_force
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rgbcontroller.dir/rgbled.cpp.s"
|
||||
/usr/bin/avr-g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/philipp/Programming/RGBcontroller/rgbled.cpp -o CMakeFiles/rgbcontroller.dir/rgbled.cpp.s
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.requires:
|
||||
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.requires
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.provides: CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.requires
|
||||
$(MAKE) -f CMakeFiles/rgbcontroller.dir/build.make CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.provides.build
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.provides
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.provides.build: CMakeFiles/rgbcontroller.dir/rgbled.cpp.o
|
||||
|
||||
|
||||
# Object files for target rgbcontroller
|
||||
rgbcontroller_OBJECTS = \
|
||||
"CMakeFiles/rgbcontroller.dir/main.cpp.o" \
|
||||
@ -203,14 +148,6 @@ CMakeFiles/rgbcontroller.dir/build: rgbcontroller
|
||||
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/build
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/requires: CMakeFiles/rgbcontroller.dir/main.cpp.o.requires
|
||||
CMakeFiles/rgbcontroller.dir/requires: CMakeFiles/rgbcontroller.dir/serial.cpp.o.requires
|
||||
CMakeFiles/rgbcontroller.dir/requires: CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o.requires
|
||||
CMakeFiles/rgbcontroller.dir/requires: CMakeFiles/rgbcontroller.dir/pwm.cpp.o.requires
|
||||
CMakeFiles/rgbcontroller.dir/requires: CMakeFiles/rgbcontroller.dir/rgbled.cpp.o.requires
|
||||
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/requires
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/clean:
|
||||
$(CMAKE_COMMAND) -P CMakeFiles/rgbcontroller.dir/cmake_clean.cmake
|
||||
.PHONY : CMakeFiles/rgbcontroller.dir/clean
|
||||
|
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o
|
||||
/home/philipp/Programming/RGBcontroller/WirelessRelay.cpp
|
||||
|
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o: WirelessRelay.cpp
|
||||
CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o: WirelessRelay.h
|
||||
|
@ -1,8 +1,8 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# compile CXX with /usr/bin/avr-g++
|
||||
CXX_FLAGS = -mmcu=atmega328p -c -g -Os -Wall -std=c++11 -fno-exceptions -ffunction-sections -fdata-sections
|
||||
CXX_FLAGS = -mmcu=atmega328p -s -c -g -Os -Wall -std=c++11 -fno-exceptions -ffunction-sections -fdata-sections
|
||||
|
||||
CXX_DEFINES = -DF_CPU=16000000
|
||||
|
||||
|
@ -1 +1 @@
|
||||
/usr/bin/avr-g++ -s -Os -Wl,--gc-sections -mmcu=atmega328p CMakeFiles/rgbcontroller.dir/main.cpp.o CMakeFiles/rgbcontroller.dir/serial.cpp.o CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o CMakeFiles/rgbcontroller.dir/pwm.cpp.o CMakeFiles/rgbcontroller.dir/rgbled.cpp.o -o rgbcontroller
|
||||
/usr/bin/avr-g++ -Os -Wl,--gc-sections -mmcu=atmega328p CMakeFiles/rgbcontroller.dir/main.cpp.o CMakeFiles/rgbcontroller.dir/serial.cpp.o CMakeFiles/rgbcontroller.dir/WirelessRelay.cpp.o CMakeFiles/rgbcontroller.dir/pwm.cpp.o CMakeFiles/rgbcontroller.dir/rgbled.cpp.o -o rgbcontroller
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -31,13 +31,13 @@ set(CMAKE_LINKER /usr/bin/avr-ld)
|
||||
|
||||
# Compiler flags
|
||||
add_definitions(-mmcu=${MCU} -DF_CPU=${CPU_SPEED})
|
||||
add_definitions(-c -g -Os -Wall -std=c++11 )
|
||||
add_definitions(-s -c -g -Os -Wall -std=c++11 )
|
||||
add_definitions(-fno-exceptions -ffunction-sections -fdata-sections)
|
||||
|
||||
# Linker flags
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # remove -rdynamic for C
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") # remove -rdynamic for CXX
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-s -Os -Wl,--gc-sections -mmcu=${MCU}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-Os -Wl,--gc-sections -mmcu=${MCU}")
|
||||
|
||||
add_executable(${PROJECT_NAME} ${ARDUINO_CORE_SRC} ${SRC_FILES})
|
||||
|
||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.11
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
|
@ -32,6 +32,11 @@ if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
set(CMAKE_INSTALL_SO_NO_EXE "0")
|
||||
endif()
|
||||
|
||||
# Is this installation the result of a crosscompile?
|
||||
if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_COMPONENT)
|
||||
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
|
||||
else()
|
||||
|
140
main.cpp
140
main.cpp
@ -11,7 +11,7 @@
|
||||
|
||||
#define MAX_RELAYS 32
|
||||
#define COMMAND_BUFFER_SIZE 32
|
||||
#define SNPRINTF_BUFFER_SIZE 32
|
||||
#define SNPRINTF_BUFFER_SIZE 64
|
||||
|
||||
char buffer[SNPRINTF_BUFFER_SIZE];
|
||||
|
||||
@ -29,25 +29,29 @@ inline static void printHelp(Serial* serial)
|
||||
{
|
||||
|
||||
serial->write_p(PSTR("Available Commands: \n\
|
||||
help : Show this prompt \n\
|
||||
relay add [id] : Add Wireless Relay\n\
|
||||
relay list : Print list of saved Wireless Relays \n\
|
||||
relay machine [on/off] : Get machine readable relay state when state changes\n\
|
||||
relay [on/off] [nn] : Turn on/off nth relay\n\
|
||||
relay state : Get machine readable relay state\n\
|
||||
erase : Erase epprom\n\
|
||||
help : Show this prompt.\n\
|
||||
relay add [id] : Add Wireless Relay.\n\
|
||||
relay delete : Delete last Relay.\n\
|
||||
relay list : Print list of saved Wireless Relays.\n\
|
||||
relay machine [on/off] : Get machine readable relay state when state changes.\n\
|
||||
relay [on/off] [nn] : Turn on/off nth relay.\n\
|
||||
relay state : Get machine readable relay state.\n\
|
||||
erase : Erase epprom.\n\
|
||||
rgb [on/off] : Turn on/off RGB leds at current value.\n\
|
||||
rgb print : Print current RGB value.\n\
|
||||
rgb set [RRR] [GGG] [BBB] : Set RGB value, pattern must be 0.\n\
|
||||
rgb pattern [id] : RGB pattern\n\
|
||||
rgb preset [id] : set preset color\n\
|
||||
rgb fade [on/off] : turn Colorfade on or off\n\
|
||||
version : Print Version.\n"));
|
||||
rgb pattern [id] : RGB pattern.\n\
|
||||
rgb preset [id] : set preset color.\n\
|
||||
rgb fade [on/off] : turn Colorfade on or off.\n\
|
||||
aux [on/off] : Turn on/off PWM Channel.\n\
|
||||
aux set [VAL] : Set PWM value, pattern must be 0.\n"));
|
||||
}
|
||||
|
||||
void writeState( WirelessRelayStore* relays, Serial* serial )
|
||||
void writeState( WirelessRelayStore* relays, Pwm16b* auxPwm, Serial* serial )
|
||||
{
|
||||
serial->write("ST");
|
||||
serial->write(auxPwm.isOn() ? auxPwm.getValueA() : 0);
|
||||
serial->putChar(',');
|
||||
serial->write(relays->count);
|
||||
for(uint8_t i = 0; i < relays->count; i++)
|
||||
{
|
||||
@ -61,7 +65,7 @@ void relayDispatch(WirelessRelayStore* relays, char* inBuffer, Serial* serial)
|
||||
{
|
||||
if( strncmp(inBuffer, "add", 3) == 0 && inBuffer[3] != '\0')
|
||||
{
|
||||
uint16_t id = strtol( inBuffer+4, nullptr, 16 );
|
||||
uint16_t id = strtol( inBuffer+3, nullptr, 16 );
|
||||
if(id != 0 && relays->count < MAX_RELAYS)
|
||||
{
|
||||
relays->array[relays->count].init(id);
|
||||
@ -69,13 +73,20 @@ void relayDispatch(WirelessRelayStore* relays, char* inBuffer, Serial* serial)
|
||||
EEPROM_write_char( 0, relays->count+1 );
|
||||
EEPROM_write_string( relays->count*2+1, (char*) &id, 2 );
|
||||
|
||||
snprintf(buffer, SNPRINTF_BUFFER_SIZE, "Relay saved! NUMBER: %u ID: %X\n", relays->count, id);
|
||||
serial->write(buffer, SNPRINTF_BUFFER_SIZE);
|
||||
uint8_t size = snprintf(buffer, SNPRINTF_BUFFER_SIZE, "Relay saved! NUMBER: %u ID: %X \n", relays->count, id);
|
||||
serial->write(buffer, size);
|
||||
|
||||
relays->count++;
|
||||
}
|
||||
else serial->write_p(PSTR("Usage: relay add [id] [id] being a 16bit hex nummber\n"));
|
||||
}
|
||||
else if( strncmp(inBuffer, "delete", 6) == 0 && inBuffer[5] != '\0')
|
||||
{
|
||||
serial->write_p(PSTR("Relay: "));
|
||||
serial->write(relays->count);
|
||||
serial->write_p(PSTR(" deleted\n"));
|
||||
relays->count--;
|
||||
}
|
||||
else if( strncmp(inBuffer, "list", 4) == 0)
|
||||
{
|
||||
serial->write_p(PSTR("Relays:\n"));
|
||||
@ -112,14 +123,10 @@ void relayDispatch(WirelessRelayStore* relays, char* inBuffer, Serial* serial)
|
||||
}
|
||||
else serial->write("No sutch Relay\n");
|
||||
}
|
||||
else if( strncmp(inBuffer, "state", 5) == 0 && inBuffer[5] != '\0')
|
||||
{
|
||||
writeState(relays, serial);
|
||||
}
|
||||
else if( strncmp(inBuffer, "machine on", 7) == 0 )
|
||||
{
|
||||
relays->printState = true;
|
||||
serial->write("Turned on State printing\n");
|
||||
serial->write_p(PSTR("Turned on State printing\n"));
|
||||
}
|
||||
else if( strncmp(inBuffer, "machine off", 8) == 0 )
|
||||
{
|
||||
@ -129,7 +136,7 @@ void relayDispatch(WirelessRelayStore* relays, char* inBuffer, Serial* serial)
|
||||
else
|
||||
{
|
||||
serial->write(inBuffer, COMMAND_BUFFER_SIZE-5);
|
||||
serial->write_p(PSTR(" is not a valid subcommand: relay [add/list/on/off]\n"));
|
||||
serial->write_p(PSTR(" is not a valid subcommand: relay [add/delete/list/on/off/state/machine]\n"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,11 +194,42 @@ void rgbDispatch(RgbLed* rgbled, char* inBuffer, Serial* serial)
|
||||
else
|
||||
{
|
||||
serial->write(inBuffer, COMMAND_BUFFER_SIZE-4);
|
||||
serial->write_p(PSTR(" is not a valid subcommand: rgb [/on/off/print/set/pattern/preset]\n"));
|
||||
serial->write_p(PSTR(" is not a valid subcommand: rgb [on/off/print/set/pattern/preset]\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void serialDispatch(Serial* serial , WirelessRelayStore* relays, RgbLed* rgbled)
|
||||
void auxDispatch(Pwm16b* auxPwm, char* inBuffer, Serial* serial)
|
||||
{
|
||||
if( strncmp(inBuffer, "on", 2) == 0 )
|
||||
{
|
||||
auxPwm->on();
|
||||
serial->write_p(PSTR("Aux pwm on\n"));
|
||||
}
|
||||
else if( strncmp(inBuffer, "off", 3) == 0 )
|
||||
{
|
||||
auxPwm->off();
|
||||
serial->write_p(PSTR("Aux pwm off\n"));
|
||||
}
|
||||
else if( strncmp(inBuffer, "set", 3) == 0 )
|
||||
{
|
||||
uint8_t i = 0;
|
||||
for(; inBuffer[i] != '\0' && i < COMMAND_BUFFER_SIZE-4; i++ );
|
||||
if( i > 4)
|
||||
{
|
||||
auxPwm->setDutyA(atoi(inBuffer+4) << 8);
|
||||
serial->write_p(PSTR("Set PWM value\n"));
|
||||
}
|
||||
else serial->write_p(PSTR("Usage: aux set [VALUE]\n"));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
serial->write(inBuffer, COMMAND_BUFFER_SIZE-4);
|
||||
serial->write_p(PSTR(" is not a valid subcommand: aux [on/off/set]\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void serialDispatch(Serial* serial , WirelessRelayStore* relays, RgbLed* rgbled, Pwm16b* auxPwm)
|
||||
{
|
||||
|
||||
if(serial->dataIsWaiting())
|
||||
@ -208,9 +246,13 @@ void serialDispatch(Serial* serial , WirelessRelayStore* relays, RgbLed* rgbled)
|
||||
{
|
||||
rgbDispatch(rgbled, buffer+4, serial);
|
||||
}
|
||||
else if(length > 4 && strncmp(buffer, "state", 3) == 0)
|
||||
else if(length > 2 && strncmp(buffer, "aux", 3) == 0)
|
||||
{
|
||||
rgbDispatch(rgbled, buffer+4, serial);
|
||||
auxDispatch(auxPwm, buffer+4, serial);
|
||||
}
|
||||
else if(length > 4 && strncmp(buffer, "state", 5) == 0)
|
||||
{
|
||||
writeState(relays, auxPwm, serial);
|
||||
}
|
||||
else if(length > 4 && strncmp(buffer, "erase", 5) == 0)
|
||||
{
|
||||
@ -252,9 +294,15 @@ int main()
|
||||
DDRB = (1 << PB5) | ( 1 << PB1);
|
||||
DDRD = (1 << PD3) | (1 << PD5)| (1 << PD6);
|
||||
|
||||
PORTB = 0x00;
|
||||
//door watcher
|
||||
PORTB = (1<< PB3) | (1<< PB4); //Enable pull up on door watcher pins;
|
||||
|
||||
bool doorOne = readPin(&PINB, PB3);
|
||||
bool doorTow = readPin(&PINB, PB4);
|
||||
uint16_t openCount = 0;
|
||||
|
||||
sei();
|
||||
|
||||
Serial serial;
|
||||
|
||||
Pwm8b pwmTc0( &TCCR0A, &TCCR0B, &OCR0A, &OCR0B, 0b00000011, true, true );
|
||||
@ -264,16 +312,48 @@ int main()
|
||||
|
||||
RgbLed rgbled( &pwmTc0, &pwmTc2 );
|
||||
|
||||
Pwm16b pwmTc1 ( &TCCR1A, &TCCR1B, &OCR1A, &OCR1B, &ICR1, 0b00000001, true, false);
|
||||
|
||||
relays.count=0;
|
||||
|
||||
restore_relays(&relays);
|
||||
|
||||
serial.write_p(PSTR("RGBController v0.4 starting\n"));
|
||||
serial.write_p(PSTR("RGBController v0.6 starting\n"));
|
||||
while(true)
|
||||
{
|
||||
serialDispatch(&serial, &relays, &rgbled);
|
||||
serialDispatch(&serial, &relays, &rgbled, &pwmTc1);
|
||||
rgbled.logic();
|
||||
|
||||
if(doorOne != readPin(&PINB, PB3))
|
||||
{
|
||||
_delay_ms(10);
|
||||
if(doorOne != readPin(&PINB, PB3))
|
||||
{
|
||||
doorOne = readPin(&PINB, PB3);
|
||||
serial.write("D1");
|
||||
doorOne ? serial.write("O\n") : serial.write("C\n");
|
||||
}
|
||||
}
|
||||
|
||||
if(doorTow != readPin(&PINB, PB4))
|
||||
{
|
||||
_delay_ms(10);
|
||||
if(doorTow != readPin(&PINB, PB4))
|
||||
{
|
||||
doorTow = readPin(&PINB, PB4);
|
||||
serial.write("D2");
|
||||
doorTow ? serial.write("O\n") : serial.write("C\n");
|
||||
}
|
||||
}
|
||||
if(doorTow) openCount++;
|
||||
if(openCount > 60000)
|
||||
{
|
||||
serial.write("Door Open Warning\n");
|
||||
openCount = 0;
|
||||
}
|
||||
|
||||
_delay_ms(2);
|
||||
}
|
||||
|
||||
return 0; //master interupt.
|
||||
return 0;
|
||||
}
|
||||
|
80
pwm.cpp
80
pwm.cpp
@ -2,31 +2,64 @@
|
||||
|
||||
//16bit
|
||||
|
||||
Pwm16b::Pwm16b()
|
||||
Pwm16b::Pwm16b( volatile unsigned char *timerControlRegisterA, volatile unsigned char *timerControlRegisterB, volatile uint16_t *compareRegisterA, volatile uint16_t *compareRegisterB, volatile uint16_t *inputCaptureRegister, const uint8_t speed, const bool enableA, const bool enableB)
|
||||
{
|
||||
DDRB |= (1<<PB1);
|
||||
OCR1A = 0x00; //0% pwm to start A
|
||||
TCNT1=0;
|
||||
TCCR1A|=(1<<COM1A1); //enable OCR1A only;
|
||||
ICR1=100;
|
||||
on();
|
||||
|
||||
_timerControlRegisterA = timerControlRegisterA;
|
||||
_compareRegisterA = compareRegisterA;
|
||||
_compareRegisterB = compareRegisterB;
|
||||
|
||||
_enableA =enableA;
|
||||
_enableB =enableB;
|
||||
|
||||
*_timerControlRegisterA = 0x00;
|
||||
*timerControlRegisterB = 0x00;
|
||||
*inputCaptureRegister = 0xFFFF;
|
||||
*timerControlRegisterB |= (1<<WGM13) | (1<<WGM12);
|
||||
*timerControlRegisterB |= 0b00000111 & speed;
|
||||
*_timerControlRegisterA|= (1<<WGM11);
|
||||
|
||||
*_compareRegisterA = 0;
|
||||
*_compareRegisterB = 0;
|
||||
}
|
||||
|
||||
bool Pwm16b::isOn()
|
||||
{
|
||||
return (*_timerControlRegisterA != (1<<WGM11));
|
||||
}
|
||||
|
||||
void Pwm16b::off()
|
||||
{
|
||||
TCCR1B = 0x00;
|
||||
*_timerControlRegisterA = 0x00;
|
||||
*_timerControlRegisterA |= (1<<WGM11);
|
||||
}
|
||||
|
||||
void Pwm16b::on()
|
||||
{
|
||||
// Phase and freq correct 16 bit PWM start pwm with /1024 prescaller
|
||||
TCCR1B|=(1<<WGM13) | (1<<WGM10);
|
||||
TCCR1B|= (1 << CS00) | (1 << CS01);
|
||||
off();
|
||||
if(_enableA) *_timerControlRegisterA|= (1<<COM1A1);
|
||||
if(_enableB) *_timerControlRegisterA|= (1<<COM1B1);
|
||||
}
|
||||
|
||||
void Pwm16b::setDuty(const uint16_t duty)
|
||||
uint16_t Pwm16b::getValueA()
|
||||
{
|
||||
OCR1A = duty;
|
||||
return *_compareRegisterA;
|
||||
}
|
||||
|
||||
uint16_t Pwm16b::getValueB()
|
||||
{
|
||||
return *_compareRegisterB;
|
||||
}
|
||||
|
||||
|
||||
void Pwm16b::setDutyA(const uint16_t duty)
|
||||
{
|
||||
*_compareRegisterA = duty;
|
||||
}
|
||||
|
||||
void Pwm16b::setDutyB(const uint16_t duty)
|
||||
{
|
||||
*_compareRegisterB = duty;
|
||||
}
|
||||
|
||||
Pwm16b::~Pwm16b()
|
||||
@ -36,7 +69,7 @@ Pwm16b::~Pwm16b()
|
||||
|
||||
//8bit
|
||||
|
||||
Pwm8b::Pwm8b( volatile unsigned char *timerControlRegisterA, volatile unsigned char *timerControlRegisterB, volatile unsigned char *compareRegisterA, volatile unsigned char *compareRegisterB, const uint8_t speed, const bool enableA, const bool enableB, const uint8_t dutyA, const uint8_t dutyB)
|
||||
Pwm8b::Pwm8b( volatile unsigned char *timerControlRegisterA, volatile unsigned char *timerControlRegisterB, volatile unsigned char *compareRegisterA, volatile unsigned char *compareRegisterB, const uint8_t speed, const bool enableA, const bool enableB)
|
||||
{
|
||||
_timerControlRegisterA = timerControlRegisterA;
|
||||
_compareRegisterA = compareRegisterA;
|
||||
@ -47,7 +80,6 @@ Pwm8b::Pwm8b( volatile unsigned char *timerControlRegisterA, volatile unsigned c
|
||||
|
||||
*_timerControlRegisterA = 0x00;
|
||||
*timerControlRegisterB = 0x00;
|
||||
//off();
|
||||
|
||||
//fast 8 bit PWM pwm A
|
||||
if(_enableA) *_timerControlRegisterA|= (1<<COM0A1);
|
||||
@ -58,8 +90,11 @@ Pwm8b::Pwm8b( volatile unsigned char *timerControlRegisterA, volatile unsigned c
|
||||
|
||||
*_compareRegisterA = 0; //0% pwm to start0
|
||||
*_compareRegisterB = 0; //0% pwm to start0
|
||||
|
||||
//on();
|
||||
}
|
||||
|
||||
bool Pwm8b::isOn()
|
||||
{
|
||||
return (*_timerControlRegisterA & 0x11111100) != 0);
|
||||
}
|
||||
|
||||
void Pwm8b::off()
|
||||
@ -75,6 +110,17 @@ void Pwm8b::on()
|
||||
|
||||
}
|
||||
|
||||
uint8_t Pwm8b::getValueA()
|
||||
{
|
||||
return *_compareRegisterA;
|
||||
}
|
||||
|
||||
uint8_t Pwm8b::getValueB()
|
||||
{
|
||||
return *_compareRegisterB;
|
||||
}
|
||||
|
||||
|
||||
void Pwm8b::setDutyA(const uint8_t duty)
|
||||
{
|
||||
*_compareRegisterA = duty;
|
||||
|
19
pwm.h
19
pwm.h
@ -5,10 +5,20 @@
|
||||
|
||||
class Pwm16b //TC1 pwm on PB1 & PB2
|
||||
{
|
||||
private:
|
||||
volatile unsigned char *_timerControlRegisterA; //TCCRxA
|
||||
volatile uint16_t *_compareRegisterA; //OCRxA
|
||||
volatile uint16_t *_compareRegisterB; //OCRxB
|
||||
bool _enableA;
|
||||
bool _enableB;
|
||||
|
||||
public:
|
||||
Pwm16b();
|
||||
Pwm16b( volatile unsigned char *timerControlRegisterA, volatile unsigned char *timerControlRegisterB, volatile uint16_t *compareRegisterA, volatile uint16_t *compareRegisterB, volatile uint16_t *inputCaptureRegister, const uint8_t speed = 0b00000011, const bool enableA = true, const bool enableB = true);
|
||||
~Pwm16b();
|
||||
void setDuty( const uint16_t duty );
|
||||
void setDutyA(const uint16_t duty);
|
||||
void setDutyB(const uint16_t duty);
|
||||
uint16_t getValue();
|
||||
bool isOn();
|
||||
void off();
|
||||
void on();
|
||||
};
|
||||
@ -24,10 +34,13 @@ private:
|
||||
bool _enableB;
|
||||
|
||||
public:
|
||||
Pwm8b( volatile unsigned char *timerControlRegisterA, volatile unsigned char *timerControlRegisterB, volatile unsigned char *compareRegisterA, volatile unsigned char *compareRegisterB, const uint8_t speed = 0b00000011, const bool enableA = true, const bool enableB = true, const uint8_t dutyA = 0, const uint8_t dutyB = 0 );
|
||||
Pwm8b( volatile unsigned char *timerControlRegisterA, volatile unsigned char *timerControlRegisterB, volatile unsigned char *compareRegisterA, volatile unsigned char *compareRegisterB, const uint8_t speed = 0b00000011, const bool enableA = true, const bool enableB = true);
|
||||
~Pwm8b();
|
||||
void setDutyA(const uint8_t duty);
|
||||
void setDutyB(const uint8_t duty);
|
||||
uint8_t getValueA();
|
||||
uint8_t getValueB();
|
||||
bool isOn();
|
||||
void off();
|
||||
void on();
|
||||
};
|
||||
|
BIN
rgbcontroller
BIN
rgbcontroller
Binary file not shown.
1281
rgbcontroller.hex
1281
rgbcontroller.hex
File diff suppressed because it is too large
Load Diff
2
serial.h
2
serial.h
@ -23,7 +23,7 @@ public:
|
||||
void putChar(const char c);
|
||||
void write(const char* in, const unsigned int length);
|
||||
void write(const char in[]);
|
||||
void write_p(const char in[]);
|
||||
void write_p(const char in[]); //for flash space strigns
|
||||
void write(const int32_t in);
|
||||
bool dataIsWaiting();
|
||||
char getChar();
|
||||
|
Reference in New Issue
Block a user