XilinxProcessorIPLib/drivers/axiethernet/examples/avb/xavb_ptp_packets.c
u16 XAvb_ConvertLogMeanToDuration(char logMeanVal) {

  u8  logMeanAbs;

  logMeanAbs = (u8)(abs(logMeanVal));

  return (logMeanVal < 0) ?
         (128 >> logMeanAbs) :
         (logMeanVal > 0) ?
         (128 << logMeanAbs) :
         128;
}
/****************************************************************************/
/**
*
* A function to convert a logMean (power of 2) value into a fraction of 128
* that is compatible with Signalling data.
*
* @param  logMeanVal is the base2 value that is to be converted

* @return logMeanVal represented as a fraction of 128
*
* @note   None.
*
*****************************************************************************/
A function to convert a logMean (power of 2) value into a fraction of 128
that is compatible with Signalling data.
A function to convert a logMean ( power of 2 ) value into a fraction of 128 that is compatible with Signalling data .
u16 XAvb_ConvertLogMeanToDuration(char logMeanVal) {
  u8  logMeanAbs;
  logMeanAbs = (u8)(abs(logMeanVal));
  return (logMeanVal < 0) ?
         (128 >> logMeanAbs) :
         (logMeanVal > 0) ?
         (128 << logMeanAbs) :
         128;
}
u16 XAvb_ConvertLogMeanToDuration ( char logMeanVal ) { u8 logMeanAbs ; logMeanAbs = ( u8 ) ( abs ( logMeanVal ) ) ; return ( logMeanVal < 0 ) ? ( 128 >> logMeanAbs ) : ( logMeanVal > 0 ) ? ( 128 << logMeanAbs ) : 128 ; }
A function to convert a logMean (power of 2) value into a fraction of 128
that is compatible with Signalling data.
A function to convert a logMean ( power of 2 ) value into a fraction of 128 that is compatible with Signalling data .