Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   WPILIB: WriteSerialPortOne(unsigned char) Warning on Compile (http://www.chiefdelphi.com/forums/showthread.php?t=62406)

Chris_Elston 24-01-2008 09:09

WPILIB: WriteSerialPortOne(unsigned char) Warning on Compile
 
1 Attachment(s)
We are trying to write a new ASCII driver function within EasyC Pro.

I see that WPILIB supports WriteSerialPortOne(unsigned char).

If we add this as a C Code block and call the serial port write function, the code complies but we get a WARNING.

Is this a normal warning to see?
"suspicious pointer conversion"

The supported WPILIB serial functions we are aware of.

unsigned char ReadSerialPortOne(void);
void WriteSerialPortOne(unsigned char);
unsigned char ReadSerialPortTwo(void);
void WriteSerialPortTwo(unsigned char);
unsigned char GetSerialPort2ByteCount(void);
unsigned char GetSerialPort1ByteCount(void);
void OpenSerialPortOne(unsigned baudRate);
void OpenSerialPortTwo(unsigned baudRate);

Joe Ross 24-01-2008 09:28

Re: WPILIB: WriteSerialPortOne(unsigned char) Warning on Compile
 
Double quotes denote a string, which is a pointer in C. For a character, use single quotes.

Chris_Elston 24-01-2008 09:44

Re: WPILIB: WriteSerialPortOne(unsigned char) Warning on Compile
 
Quote:

Originally Posted by Joe Ross (Post 684905)
Double quotes denote a string, which is a pointer in C. For a character, use single quotes.

Gotcha!

WriteSerialPortOne('J');

Works like a champ. I got PLC code on the brain this morning...not C code...need more coffee....


All times are GMT -5. The time now is 23:21.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi