OpenCom Compiler warning

A private (members-only) forum for discussing all issues related to the Beta test of Native mode devices.
Locked
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

OpenCom Compiler warning

Post by Don_Kirby »

I'm not sure if this is a native mode specific question or not, but just to be safe, this is being posted here. I am currently modifying the application to compile under a non-beta compiler for further testing.

That said, here's what I am seeing.
Compiler wrote:MainTask.bas:145: Warning(3): parameter 1 of OpenCom, Comm port 1 is not valid for target device "ZX24n"
Similar errors appear when calling DefineCom for Com1.
MainTask.bas:144: Warning(3): parameter 1 of DefineCom, Comm port 1 is not valid for target device "ZX24n"
MainTask.bas:144: Warning(3): parameter 2 of DefineCom, pin 2 is not a valid I/O pin for target processor "ZX24n"
MainTask.bas:144: Warning(3): parameter 3 of DefineCom, pin 1 is not a valid I/O pin for target processor "ZX24n"
These last two, I had assumed, should just be ignored by the compiler, as the hardware USART has to use the hardware Tx and Rx pins.

The same errors appear when compiling for VM devices, although, as I mentioned above, I've only tested this on the beta compiler.

I thought I understood the implementation requirements as stated in the library reference, but perhaps I've missed something simple again?

-Don
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: OpenCom Compiler warning

Post by dkinzer »

You're seeing two different but related problems. For OpenCom(), the warning was introduced in the latest revision and shouldn't be there. For DefineCom(), the warning is also present in the released version of the compiler and has apparently been there for some time. Both have been resolved internally.

You can either ignore the warnings or add the #pragma to suppress it:

Code: Select all

#pragma warning(push; 3:off)
  DefineCom(1, 0, 0, 8, 2)
#pragma warning(pop)
It is recommended that you use zero for the pin number parameters to DefineCom() for hardware comm ports but the values are ignored.
- Don Kinzer
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Re: OpenCom Compiler warning

Post by Don_Kirby »

dkinzer wrote: It is recommended that you use zero for the pin number parameters to DefineCom() for hardware comm ports but the values are ignored.
I specifically didn't use zeros, as the system library makes mention that 1 or both of the pins needs to be valid for the port to open. I guess I was being a bit thick when I read it.


-Don
Locked