diff --git a/CMakeLists.txt b/CMakeLists.txt index e348c42..8bf5fb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,30 @@ cmake_minimum_required(VERSION 2.8.9) project(sharedInterfaces) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wno-comment -Wno-missing-field-initializers -Werror -pedantic") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wno-comment -Wno-missing-field-initializers -fpermissive") file(GLOB SOURCES "source/include/*.hpp" "source/src/*.cpp") file(GLOB SOURCES_GTEST "source/include/*.hpp" "test/*.cpp" "test/*.hpp") +list(REMOVE_ITEM SOURCES_GTEST ${CMAKE_CURRENT_SOURCE_DIR}/source/src/HwlibTestCode.cpp) include_directories( ../deps/gtest-1.7.0/include - ../deps/gtest-1.7.0) + ../deps/gtest-1.7.0 + ../deps/hwlib + ../deps/ADT/source/include) + +link_directories( + ../deps/gtest-1.7.0/src + ../deps/hwlib + ../deps/ADT/source/source) -link_directories(../deps/gtest-1.7.0/src) ADD_LIBRARY(gtest ../deps/gtest-1.7.0/src/gtest-all.cc) ADD_LIBRARY(gtest_main ../deps/gtest-1.7.0/src/gtest_main.cc) +ADD_LIBRARY(hwlib "../deps/hwlib/hwlib.c") +ADD_LIBRARY(ADT "../deps/adt/source/adt-all.cpp") + +add_executable(sensorInterfaces ${SOURCES}) +#add_executable(sensorInterfaces_test ${GTEST} ${SOURCES_GTEST}) -add_executable(sensorInterfaces_test ${GTEST} ${SOURCES_GTEST}) -target_link_libraries(sensorInterfaces_test gtest gtest_main) +target_link_libraries(sensorInterfaces hwlib ADT) +#target_link_libraries(sensorInterfaces_test hwlib ADT) \ No newline at end of file diff --git a/hwlib.rar b/hwlib.rar new file mode 100644 index 0000000..880980f Binary files /dev/null and b/hwlib.rar differ diff --git a/source/src/HwlibTestCode.cpp b/source/src/HwlibTestCode.cpp new file mode 100644 index 0000000..534d4f3 --- /dev/null +++ b/source/src/HwlibTestCode.cpp @@ -0,0 +1,51 @@ +//// +// Roborescue +// +// \file HwlibTestCode.cpp +// \date Created: 08-04-16 +// \version 0.1.0 +// +// \author Mathijs van Bremen +// +// \section LICENSE +// License: newBSD +// +// Copyright © 2016, HU University of Applied Sciences Utrecht. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +// - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +// - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +// - Neither the name of the HU University of Applied Sciences Utrecht nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE HU UNIVERSITY OF APPLIED SCIENCES UTRECHT +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +//// +extern "C" { + //#include "hwlib.c" + //#include "hwlib-demo.inc" +} + +#include "Length.hpp" +#include + +int main() { + r2d2::Length lt = 5.0 * r2d2::Length::METER; + std::cout << lt; + + //int pin1 = 2; + + //pin_direction_set_output(pin1); + + //hwlib_blink_pin_ms(pin1, 500); + + return 0; +} \ No newline at end of file diff --git a/source/src/UltrasonicSensorTestCode.cpp b/source/src/UltrasonicSensorTestCode.cpp index 421e7a0..0609f6f 100644 --- a/source/src/UltrasonicSensorTestCode.cpp +++ b/source/src/UltrasonicSensorTestCode.cpp @@ -30,13 +30,12 @@ // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //// -#include "../include/UltrasonicSensor.hpp" -int main() { +//int main() { // const int ultrasonic_sensor_trigger_pin = 0; // const int ultrasonic_sensor_echo_pin = 0; // UltrasonicSensor ultrasonic_sensor(0, 0, ultrasonic_sensor_trigger_pin, ultrasonic_sensor_echo_pin); - return 0; -} \ No newline at end of file +// return 0; +//} \ No newline at end of file