PreviousNext
Interval detection optimization
Help > Appendix > Code Optimization > Interval detection optimization

FLASH-                        RAM-               Speed+

 

uns8 GetRfRxFilter  ( uns8 rxFilter )

{

  if ( rxFilter < 20 )

       return _FLT_5;

 
 
if ( rxFilter < 35 )

       return _FLT_20;

 
 
if ( rxFilter < 50 )

       return _FLT_35;

  else

       return _FLT_50;

}

uns8 GetRfRxFilter  ( uns8 rxFilter @ W )

{

  W -= 20;

  if ( !Carry )

       return _FLT_5;

  W -= 35 - 20;

  if ( !Carry )

       return _FLT_20;

  W -= 50 - 35;

  if ( !Carry )

       return _FLT_35;

  else

       return _FLT_50;

}