08-24-2011 03:54 PM
I am working on a WinSystems PC104 stack and need help with the serial I/O interrupt service routine for their COM8 module. WinSystems provided software for the board but LabWindows CVI doesn't like a statement in a structure in the COM8IO header file. The statement is:
void interrupt (*old_isr)();
The structure is:
struct com_port {
unsigned open_flag;
unsigned uart_base;
unsigned int_num;
long baud_rate;
void interrupt (*old_isr)();
int in_ptr;
int out_ptr;
int rx_fifo_count;
unsigned rx_int_count;
unsigned rx_char_count;
int tx_head;
int tx_tail;
int tx_fifo_count;
int tx_fifo_max;
unsigned tx_int_count;
unsigned tx_char_count;
unsigned buff_cnt;
char tx_buffer[BUFFER_SIZE];
char buffer[BUFFER_SIZE];
};
and CVI's error messages are:
"COM8IO.H"(53,25) syntax error; found '*' expecting ')'.
"COM8IO.H"(53,36) Illegal return type 'void function'.
"COM8IO.H"(53,36) Undefined size for field 'void function function'.
Any suggestions on how to get CVI to accept this statement or how I can modify it to get it to compile?
Thanks,
John
Solved! Go to Solution.
08-25-2011 07:31 AM
It looks like you are trying to compile code written for MS-DOS, where interrupts are explicitly handled. That part of the code will have to be rewritten to work under Windows, possibly by using the CVI RS-232 library.