I have followed yzoer's example and made a global.h
I have a cpp file with code, and a .h file something(?) like this. I am only making some empty code, to try to get som grasp of it, so most is removed from the RadioHead code:
Code: Select all
class RHGenericSPI;
class RHSPIDriver : public RHGenericDriver
{
public:
RHSPIDriver(uint8_t slaveSelectPin, RHGenericSPI& spi);
bool init();
void spiUsingInterrupt(uint8_t interruptNumber);
};
class RH_RF69 : public RHSPIDriver
{
public:
RH_RF69(uint8_t slaveSelectPin, uint8_t interruptPin, RHGenericSPI& spi);
// ...
};
This .h file is not included in my .xc file (it contains C++ syntax, so I guess it shouldn't). Now I am referring this in the .xc file tile this:
Code: Select all
EXTERNAL void RHGenericSPI();
EXTERNAL void RH_RF69 (uint8_t slaveSelectPin, uint8_t interruptPin, RHGenericSPI& spi); // Maybe REFERENCE_PARAM(type,value) in last param here?
But I constantly get errors, no matter how much I tweak it:
Code: Select all
../src/__arduino_on_xmos_test.xc:34:70: error: parse error before "RHGenericSPI"
EXTERNAL void RH_RF69 (uint8_t slaveSelectPin, uint8_t interruptPin, RHGenericSPI& spi); // Maybe REFERENCE_PARAM(type,value) in last param here?
^
Have I supplied enough code (and is the .h file correct)?
I guess the question is as simple as how do I specify a pointer to a class from xc? And later, to an instantiated object? Or are there other ways? I haven't found this documented(!?)
PS. I am trying to port some code for a radio board, see
Porting to XMOS / XC - disclaimer: no money, no gifts, no ads, just fun and expenses