The serial data is read no problem, and actually I figured out most of my
other problems, I also have a bit and byte swapping function that I'm going
to post that works pretty darn good.

Thanks,
Jason

Sample Swap_byte_function

/**************************************************************************
* Byte swap_byte(Byte):  Jason Simpkins Apexx Software LLC.               *
* Vars: Byte old_byte  Byte to be converted                   *
*       Byte new_byte  Converted Byte                                     *
**************************************************************************/
Byte swap_byte(Byte old_byte){

  Byte new_byte;
  Byte working_byte[8];
  int  i;


  new_byte=0x00; // zero out new_byte

  for(i=0;i<8;i++)
    working_byte[i]=0x00;  // zero out working bytes

  working_byte[0]=(old_byte << 7); // bit 1

  working_byte[1]=(old_byte >> 1); // bit 2
  working_byte[1]=(working_byte[1] << 7);
  working_byte[1]=(working_byte[1] >> 1);

  working_byte[2]=(old_byte >> 2); // bit 3
  working_byte[2]=(working_byte[2] << 7);
  working_byte[2]=(working_byte[2] >> 2);

  working_byte[3]=(old_byte >> 3); // bit 4
  working_byte[3]=(working_byte[3] << 7);
  working_byte[3]=(working_byte[3] >> 3);

  working_byte[4]=(old_byte >> 4); // bit 5
  working_byte[4]=(working_byte[4] << 7);
  working_byte[4]=(working_byte[4] >> 4);

  working_byte[5]=(old_byte >> 5); // bit 6
  working_byte[5]=(working_byte[5] << 7);
  working_byte[5]=(working_byte[5] >> 5);

  working_byte[6]=(old_byte >> 6); // bit 7
  working_byte[6]=(working_byte[6] << 7);
  working_byte[6]=(working_byte[6] >> 6);

  working_byte[7]=(old_byte >> 7); // bit 8



  for(i=0;i<8;i++){

     new_byte=(new_byte | working_byte[i]);

  }  // end for loop

  return(new_byte);

} // end function

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Thursday, May 11, 2000 11:08 PM
Subject: Re: Byte order


> Do you like working at Emwerks?
>
> I looked at the web site.
>
> Thank you
> Rob
> [EMAIL PROTECTED]
>
> ----- Original Message -----
> From: "Shekar Mantha" <[EMAIL PROTECTED]>
> Date: Monday, May 8, 2000 6:50 pm
> Subject: Re: Byte order
>
> > The Palm uses the Motorola byte order format -- depending on how
> > you are
> > reading the bits you may need to shift them in
> > to get the right order.
> >
> > Shekar Mantha
> > Emwerks, Inc.
> > ----- Original Message -----
> > From: Jason Simpkins <[EMAIL PROTECTED]>
> > To: Palm Developer Forum <[EMAIL PROTECTED]>
> > Sent: Monday, May 08, 2000 5:52 PM
> > Subject: Byte order
> >
> >
> > > Hi all,
> > >
> > > Can somebody tell what the byte order is for the Palm OS
> > devices?   Such
> > as
> > >
> > > MSB first, or is it LSB first?   High byte first or is it low
> > byte first?
> > >
> > > The reason I ask is that I'm dealing with binary data coming in
> > from the
> > > serial port and it is
> > > low byte/high byte and least significant bit first.   I need
> > know if  I
> > need
> > > to conver this to the palm
> > > format.
> > >
> > >
> > > Thanks,
> > > Jason
> > >
> > >
> > >
> > > --
> > > For information on using the Palm Developer Forums, or to
> > unsubscribe,please see http://www.palmos.com/dev/tech/support/forums/
> > >
> >
> >
> > --
> > For information on using the Palm Developer Forums, or to
> > unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
> >
> >
> >
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to