Jerry I
Joined: 14 Sep 2003 Posts: 96 Location: Toronto, Ontario, Canada
|
Porting C-Code from GCC Compiler to CCS help |
Posted: Tue Aug 25, 2015 6:56 pm |
|
|
HI,
I found a serial protocol C-code example from Circuit Cellar example and I wanted to try to port the code to run on the CCS C-compiler. The software is Arduino compatible.
The start of errors are in 2 structures. I do not know how to handle.
Both structures have a callback function (described in comments) below.
The error occurs at this point. The error is -> Unknown Type
Code: |
void (*cback)(uint8_t, uint8_t, uint8_t); // callback function
void (*func)(uint8_t); // callback for new stable state
|
Is there a way to handle this in CCS C-Compiler?
Thanks for any help.
Jerry
Code: |
struct vtimer { // one per timer
uint16_t rtics; // remaining clock tics
uint16_t otics; // original tic count (for repeating events)
struct vtimer *next; // next in list
void (*cback)(uint8_t, uint8_t, uint8_t); // callback function
uint8_t tid; // timer ID (1 - 127)
uint8_t tstats; // timer status
uint8_t remain; // timeouts remaining
uint8_t uident; // user identification
};
struct dbounce {
volatile uint8_t *input; // which PIN the switch is on
uint8_t pmask; // which bit (0 - 7) as a mask
uint8_t nread; // number of consecutive reads that make it stable
uint8_t trans; // which transitions we care about
void (*func)(uint8_t); // callback for new stable state
uint8_t swstat; // switch status (callback pending, stable)
uint8_t rcount; // number of consecutive reads we've done
uint8_t last_rd; // last value read
uint8_t last_ok; // last stable value
};
|
|
|