I'm using mthreads (https://github.com/jlamothe/mthread) for my arduino. But now as the project is getting bigger, it would make sense to break it up in several files.
I successfully outsourced already a part which is not threaded. But somehow I cannot make up my mind how to use mthread in conjunction with several header files.
here is what I got:
main: call header:
#include "tcan.h"
tcan.h:
#ifndef tcan_h
#define tcan_h
#include "Arduino.h"
class tcan : public Thread {
public: tcan();
protected: bool loop();
private:
};
#endif
tcan.cpp
#include "Arduino.h"
#include "tcan.h"
#include <mcp_can.h>
bool tcan::loop() {
// lala
return true;
}
but I get an error when compiling:
tcan.h:6:28: error: expected class-name before '{' token class tcan : public Thread {
Thanks in advance