SHARE
TWEET

Untitled

a guest Jul 18th, 2013 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int HantekDSOIO::tpTransform(unsigned *triggerPoint)
  2. {
  3.     unsigned tp1 = *triggerPoint;
  4.     unsigned tp2 = 1;
  5.     while(tp1 > 0) {
  6.         tp1 >>= 1;
  7.         tp2 <<= 1;
  8.     }
  9.  
  10.     if(tp2 == 0)
  11.     {
  12.         return -1;
  13.     }
  14.  
  15.     unsigned var_1 = tp2 - 1;
  16.     unsigned var_2 = 0;
  17.  
  18.     unsigned var_C = 0;
  19.     unsigned var_10 = 0;
  20.  
  21.     bool flag = true;
  22.     while (var_1 > var_2)
  23.     {
  24.         var_C = (var_1 - var_2 + 1)/2 + var_10;
  25.         if ((var_C > *triggerPoint) == flag)
  26.         {
  27.             if (!flag)
  28.             {
  29.                 var_10 = var_C;
  30.             }
  31.             var_1 = (var_1 + var_2 - 1)/2;
  32.             flag = true;
  33.         }
  34.         else
  35.         {
  36.             if (flag)
  37.             {
  38.                 var_10 = var_C;
  39.             }
  40.             var_2 = (var_2 + var_1 + 1)/2;
  41.             flag = false;
  42.         }
  43.     }
  44.  
  45.     *triggerPoint = var_2;
  46.  
  47.     return 0;
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top