A little background would probably help here.  The hardware I am using is my
hardware, I designed it from start to finish, so I'm pretty sure it supports
what I'm doing.  Basically its like you said I just stored the float
variable at the address of the UART register, and yes when its gets read its
treated as a float, I looked at the disassemble list and no the software
does not try to convert the value in any way, because it was declared as a
float so it assumes float.  And no there isn't any need to wait after a
read, the check I do before I read the UART checks to see if the total
number of bytes I am looking for is actually in the UART, so if it returns
positive, I know that the exact number of words/bytes (however I configure
the hardware) is waiting in the buffer.



On Tue, Aug 16, 2011 at 3:27 PM, Anders Gidenstam
<anders-...@gidenstam.org>wrote:

> On Tue, 16 Aug 2011, Derrick Washington wrote:
>
> > Anders
> >
> >  I have included the following line in my generic xml file
> >
> > <output>
> >      <binary_mode>true</binary_mode>
> >      <byte_order>network</byte_order>
> >
> >  My C++ code looks like this now.
> >
> > float gps_vdummy, gps_xdummy, gps_ydummy, gps_zdummy;
> >
> > if ( (quik_silva_status_reg & 0x00001000) != 0 ) { //CHECK TO SEE IF
> > SIMULATOR DATA IS AVAIABLE
> >
> >     gps_vdummy  = rs232_uart1_fp;
> >     gps_zdummy = rs232_uart1_fp;
> >     gps_xdummy = rs232_uart1_fp;
> >     gps_ydummy = rs232_uart1_fp;
> >     etc ...
> >
> >  My hardware is returning a 32bit floating point word, in hardware what
> is
> > happening is my UART is taking in the bytes one at a time of course and
> > shifting the into a 32bit register a byte at a time, and returning that
> > 32bit value.  Soooo if FG is sending the data MSB(most significant byte
> > first), then I should be getting the correct value, right?
>
> So rs232_uart1_fp is a floating point variable located at the
> address of the UART output register/port or something similar?
> Are you sure it supports that (i.e. reading it as a float)? If not could
> you try reading the 32bit value into an int variable and reinterpret it
> as a float with something like
>
> unsigned int foo = rs232_uart1_u32;
> float bar = *(float *)&foo;
>
> Also, there is no need to wait before reading the next word from the UART?
>
>
> Cheers,
>
> Anders - who hasn't programmed an UART since the 68hc11 and late Amiga
>          days.
> --
> ---------------------------------------------------------------------------
> Anders Gidenstam
> WWW: http://www.gidenstam.org/FlightGear/
>
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
>  _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to