A common CAN.h file looks like this:
In Arduino i just do :
after that I can use the CAN object directly.
But I cannot figure out how to do it in a wrapper !
Jan
C++:
#ifndef CAN_H
#define CAN_H
#ifdef ARDUINO_ARCH_ESP32
#include "ESP32SJA1000.h"
#else
#include "MCP2515.h"
#endif
#endif[
/CODE]
And in the 2 referenced .h files are a common definition of CAN:
[CODE=cpp]
extern MCP2515Class CAN;
extern ESP32SJA1000Class CAN;
In Arduino i just do :
C++:
#include <CAN.h>
after that I can use the CAN object directly.
But I cannot figure out how to do it in a wrapper !
Jan