diff --git a/bsl/csl/PC/peripherals/pinPC.hpp b/bsl/csl/PC/peripherals/pinPC.hpp new file mode 100644 index 0000000..8661eb1 --- /dev/null +++ b/bsl/csl/PC/peripherals/pinPC.hpp @@ -0,0 +1,15 @@ +#ifndef __PINPC_HPP__ +#define __PINPC_HPP__ + +#include + +struct Pin_PC : Pin +{ + void writeImpl(bool logic) + { + std::cout << "PC pin set to " << logic << std::endl; + } +}; + + +#endif // __PINPC_HPP__ \ No newline at end of file diff --git a/main.cpp b/main.cpp index a52103e..9e6e9bb 100644 --- a/main.cpp +++ b/main.cpp @@ -16,6 +16,14 @@ CommandManager commander; Pin_Raspberry rpin; +Pin_PC pcpin; + +template +void baa(Pin& p) +{ + p.write(true); +} + void dummy() { rpin.write(1); @@ -23,10 +31,19 @@ void dummy() } +void foo() +{ + std::cout << "foo" << std::endl; + + baa(rpin); + baa(pcpin); +} + int main(int argc, char *argv[]) { std::cout << "Main Begin" << std::endl; commander.addNewCommand("dummy", "The test command for testing the test", dummy); + commander.addNewCommand("foo", "The test command for foo was called", foo); commander(argv[1]); std::cout << "Main End" << std::endl; return 1; diff --git a/main.hpp b/main.hpp index 5e48fef..206957a 100644 --- a/main.hpp +++ b/main.hpp @@ -7,5 +7,6 @@ #include "./utils/commandManager.h" #include "./interfaces/pin.hpp" #include "bsl/csl/raspberry/peripherals/pinRaspberry.hpp" +#include "bsl/csl/PC/peripherals/pinPC.hpp" #endif // __MAIN_HPP__ diff --git a/runtest b/runtest index f1a0c3a..2685520 100755 Binary files a/runtest and b/runtest differ