From 19e568fb93a4113012714bac32b41a67ef00e4d7 Mon Sep 17 00:00:00 2001 From: polymurph Date: Wed, 19 May 2021 17:34:33 +0200 Subject: [PATCH] work on finite state machine --- temp/finite_state_machine/Makefile | 20 ++++++++++++++++++++ temp/finite_state_machine/heate.hpp | 15 +++++++++++++++ temp/finite_state_machine/heaterCtrl.cpp | 1 + temp/finite_state_machine/heaterCtrl.hpp | 21 +++++++++++++++++++++ temp/finite_state_machine/main.cpp | 16 ++++++++++++++++ temp/finite_state_machine/oven.hpp | 20 ++++++++++++++++++++ temp/finite_state_machine/ovenCtrl.hpp | 14 ++++++++++++++ 7 files changed, 107 insertions(+) create mode 100644 temp/finite_state_machine/Makefile create mode 100644 temp/finite_state_machine/heate.hpp create mode 100644 temp/finite_state_machine/heaterCtrl.cpp create mode 100644 temp/finite_state_machine/heaterCtrl.hpp create mode 100644 temp/finite_state_machine/main.cpp create mode 100644 temp/finite_state_machine/oven.hpp create mode 100644 temp/finite_state_machine/ovenCtrl.hpp diff --git a/temp/finite_state_machine/Makefile b/temp/finite_state_machine/Makefile new file mode 100644 index 0000000..80e8516 --- /dev/null +++ b/temp/finite_state_machine/Makefile @@ -0,0 +1,20 @@ +cpp_src = $(wildcard *.cpp) + +cpp_obj = $(cpp_src:.cpp=.o) +c_obj = $(c_src:.c=.o) +CC = g++ +CFLAGS = -Wall -pedantic #-li2c -lpthread +LDFLAGS = +EXEC = runtest + + +all : $(EXEC) + +$(EXEC): $(cpp_obj) $(c_obj) + $(CC) -pthread -o $@ $^ $(LDFLAGS) + +clean: + rm -rf $(c_obj) $(cpp_obj) $(EXEC) + +cleanall: + rm -rf $(c_obj) $(cpp_obj) $(EXEC) diff --git a/temp/finite_state_machine/heate.hpp b/temp/finite_state_machine/heate.hpp new file mode 100644 index 0000000..1281294 --- /dev/null +++ b/temp/finite_state_machine/heate.hpp @@ -0,0 +1,15 @@ +#ifndef _HEATER_HPP_ +#define _HEATER_HPP_ + +class Heater +{ + public: + Heater(); + + + private: + + +}; + +#endif // _HEATER_HPP_ diff --git a/temp/finite_state_machine/heaterCtrl.cpp b/temp/finite_state_machine/heaterCtrl.cpp new file mode 100644 index 0000000..907b292 --- /dev/null +++ b/temp/finite_state_machine/heaterCtrl.cpp @@ -0,0 +1 @@ +#include "heaterCtrl.hpp" diff --git a/temp/finite_state_machine/heaterCtrl.hpp b/temp/finite_state_machine/heaterCtrl.hpp new file mode 100644 index 0000000..01c69ec --- /dev/null +++ b/temp/finite_state_machine/heaterCtrl.hpp @@ -0,0 +1,21 @@ +#ifndef _HEATERCTRL_HPP_ +#define _HEATERCTRL_HPP_ + +class HeaterController +{ + public: + + enum Event{ + + }; + + HeaterController(); + + + + private: + + +}; + +#endif // _HEATERCTRL_HPP_ diff --git a/temp/finite_state_machine/main.cpp b/temp/finite_state_machine/main.cpp new file mode 100644 index 0000000..87dba11 --- /dev/null +++ b/temp/finite_state_machine/main.cpp @@ -0,0 +1,16 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + + return 0; +} + diff --git a/temp/finite_state_machine/oven.hpp b/temp/finite_state_machine/oven.hpp new file mode 100644 index 0000000..616b1fa --- /dev/null +++ b/temp/finite_state_machine/oven.hpp @@ -0,0 +1,20 @@ +#ifndef _OVEN_HPP_ +#define _OVEN_HPP_ + +class Oven +{ + public: + + // has a sensor and has a heater + + Oven(); + + void setHeaterDutyCycle(); + void turnOffHeater(); + float getTemperature_C(); + + private: + +}; + +#endif // _OVEN_HPP_ diff --git a/temp/finite_state_machine/ovenCtrl.hpp b/temp/finite_state_machine/ovenCtrl.hpp new file mode 100644 index 0000000..15f87db --- /dev/null +++ b/temp/finite_state_machine/ovenCtrl.hpp @@ -0,0 +1,14 @@ +#ifndef _OVENCTRL_HPP_ +#define _OVENCTRL_HPP_ + +class OvenControll +{ + public: + OvenControll(); + + + private: + +}; + +#endif // _OVEMCTRL_HPP_