A simple skeleton of a program, yet it gives bizarre errors on compile:
/*--------------------------------------------------------------------------------------
Includes
--------------------------------------------------------------------------------------*/
#include <arduino.h>
/*--------------------------------------------------------------------------------------
Defines
--------------------------------------------------------------------------------------*/
// Wire Node Descriptor
typedef struct
{
char *Signal;
char *Conn;
int ConnPin;
char *Color;
uint8_t IOPin;
} t_CableNode;
/****************************************************************************************
* Start of Data
***************************************************************************************/
t_CableNode PDBRevECable[] =
{
// 8-Pin PDB Connector
{ "GND3", "PDB8", 1, "Black", A0 },
{ "VCC", "PDB8", 2, "Red", A1 },
{ "GND4", "PDB8", 3, "Gray", A2 },
{ "ENA", "PDB8", 4, "Blue", A3 },
{ "FWD", "PDB8", 5, "Yellow", A4 },
{ "JOG", "PDB8", 6, "Orange", A5 },
{ "LSENSE", "PDB8", 7, "Purple", A6 },
{ "PROBE", "PDB8", 8, "Brown", A7 },
// 2-Pin PCB E-Stop Connector
{ "ESTOP", "PDB2", 1, "Green", A8 },
{ "GND2", "PDB2", 2, "White", A9 },
// 6-Pin BOB VFD Connector
{ "GND1", "BOB6", 1, "Black", 0 },
{ "VC", "BOB6", 2, "Red", 1 },
{ "GND2", "BOB6", 3, "White", 2 },
{ "ENA", "BOB6", 4, "Blue", 3 },
{ "ESTOP", "BOB6", 5, "Green", 4 },
{ "REV", "BOB6", 6, "White", 5 },
// 4-Pin BOB PDB Connector
{ "GND3", "BOB4", 1, "Black", 6 },
{ "PROBE", "BOB4", 2, "Brown", 7 },
{ "VCC", "BOB4", 4, "Red", 8 },
// 3-Wire BOB VFD Harness
{ "REV", "BOBVFD", 1, "White", 14 },
{ "VC", "BOBVFD", 2, "Red", 15 },
{ "GND1", "BOBVFD", 3, "Black", 16 },
// 4-Wire PDB VFD Harness
{ "LSENSE", "PDBVFD", 1, "Brown", 18 },
{ "FWD", "PDBVFD", 2, "Yellow", 19 },
{ "JOG", "PDBVFD", 3, "Orange", 20 },
{ "GND4", "PDBVFD", 4, "Black", 21 },
{ NULL, NULL, 0, NULL, 0 }
};
void TestCable(t_CableNode *p)
{
}
void setup()
{
}
void loop()
{
}
If I just change the type of the argument to TestCable to anything other than t_CableNode, all is well....
Note the error it flags is weird:
"PDBCableTester.ino:7:16: error: variable or field 'TestCable' declared void"
variable or field??? Why does it not recognize it as a function?
This is compiled for a Mega, so no problems with memory.
Regards,
Ray L.