亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? math.c

?? TDK 6521 SOC 芯片 DEMO程序
?? C
?? 第 1 頁 / 共 4 頁
字號:
void shift_right8_2 (uint8x_t *x)       // Shift right 8-byte number right 2-bits.
{
    uint8_t carry_a, carry_b;

    carry_a = *x << 6;      *x =           (*x >> 2);  x++;
    carry_b = *x << 6;      *x = carry_a | (*x >> 2);  x++;
    carry_a = *x << 6;      *x = carry_b | (*x >> 2);  x++;
    carry_b = *x << 6;      *x = carry_a | (*x >> 2);  x++;
    carry_a = *x << 6;      *x = carry_b | (*x >> 2);  x++;
    carry_b = *x << 6;      *x = carry_a | (*x >> 2);  x++;
    carry_a = *x << 6;      *x = carry_b | (*x >> 2);  x++;
    carry_b = *x << 6;      *x = carry_a | (*x >> 2);
}     
#else
void shift_right8_2 (uint8x_t *x)       // Shift right 8-byte number right 2-bits.
{
    uint8_t n = 8;
    uint8_t carry_a = 0;
    uint8_t carry_b;

    do
    {
        carry_b = *x << 6;
        *x = carry_a | (*x >> 2);
        carry_a = carry_b;
        x++;
    } while (--n);
}
#endif // MATH_FAST.
#endif // VA_ELEMENT/VA_SUMS/RMS_VALUES/CALIBRATION.
#endif

#if EXTRAS
//===========================================================================//
/*
    square = TWOto30;                            // = 2^30.

    square_root  = TWOto15;                      // = 1000 0000 0000 0000.
    square += TWOto28 + square_root * TWOto15;   // = 1000 0000 0000 0000 * 2^15.
                                                    = 1000 0000 0000 0000 0000 * 2^11.
                                                    
    square_root += TWOto14;                      // = 1100 0000 0000 0000.
    square += TWOto26 + square_root * TWOto14;   // = 1100 0000 0000 0000 * 2^14.
                                                      0110 0000 0000 0000 0000 * 2^11.

    square_root += TWOto13;                      // = 1110 0000 0000 0000.
    square += TWOto24 + square_root * TWOto13;   // = 1110 0000 0000 0000 * 2^13.
                                                      0011 1000 0000 0000 0000 * 2^11. 

    square_root += TWOto12;                      // = 1111 0000 0000 0000.
    square += TWOto22 + square_root * TWOto12;   // = 1111 0000 0000 0000 * 2^12.
                                                      0001 1110 0000 0000 0000 * 2^11.
    .............................................................................
*/

#define TWOto30 0x40000000

// Returns the 16-bit square root of the 32-bit argument 'x'.
uint16_t sqrt4_2 (int32_t x) 
{
    uint32x_t *a;
    uint8_16_32_t square_root;
    uint32_t square, square_tmp;
    uint32_t TWOto2M;
    uint8_t M1;                         // M + 1.
    
    a = (uint32x_t *) x;

    if (*a >= TWOto30)
    {
       square = TWOto30;
       square_root.l = TWOto30;         // = square_root * 2^15.
    }
    else
    {
       square = 0;
       square_root.l = 0;               // = square_root * 2^15.
    }

    TWOto2M = TWOto30 >> 2;             // = 2^M * 2^M.

    M1 = 15;
    do
    {
       square_tmp = TWOto2M + square_root.l + square;
       square_root.l >>= 1;

       if (*a >= square_tmp)
       {
          square = square_tmp;
          square_root.l |= TWOto2M;     // = square_root * 2^M.
       }

       TWOto2M >>= 2;

    } while (--M1);

    square_root.l >>= 1;
    return (* (uint16_t *) &square_root.c[ LO_HI ]);
}
#endif // EXTRAS.

#if AUTOCAL && \
    (EQUATION != _1ELEMENT_3WIRE \
     && EQUATION != _2ELEMENT_4WIRE_DELTA \
     && EQUATION != _2ELEMENT_4WIRE_WYE)
// Convert a 64 bit sum to floating point.  This can underflow 
// by as many as 40 bits, and should only be used for ratiometric
// purposes such as calibration.  In particular, do not try to
// manipulate a billing or accumulated demand register in floating point!
float s2f (uint8x_t *s)
{
    float f;
    int32_t xdata l[2];  // high and low 32-bit words of s

    // take the absolute value of the 64 bit number
    abs_x ((uint8x_t *)&l, s, 8);

    // Add in the 32-bit parts of the 64 bit number.
    // Warning:The target mantissa is only 24 bits.
    f  = ((float) l[ HI ]) * 4294967296.;		// aka 0x1 0000 0000.
    f += ((float) l[ LO ]);

    // find and set the sign of the number
    if (*s > 0x7F)
        f = -f;

    return f;
}
#endif

// standard C99 library function not provided by Keil
// converts a float to the nearest long integer.  Specifically
// handles negative and positive values.
// Keil's float->long conversion has some defects at boundaries.
// e.g. INT32_MIN  (0x8000000) doesn't convert correctly to float.
long lroundf (float f)
{
    if (f < 0.0)
    {
        if (f <= ((float)(-INT32_MAX)))
        {
            return -INT32_MAX;
        }
        else
        {
            return (long)(f - 0.5);
        }
    }
    else
    {
        if (f >= ((float)(INT32_MAX)))
        {
            return INT32_MAX;
        }
        else
        {
            return (long)(f + 0.5);
        }
    }
}
/***************************************************************************
 * History
 * $Log: math.c,v $
 * Revision 1.40  2006/10/13 00:52:35  tvander
 * Removed compile options for 6530, 6515;
 * renamed 6511 and 6513 to trace11 and trace13;
 * Binary verified unchanged from previous version.
 *
 * Revision 1.39  2006/09/10 00:30:30  Michael T. Fischer
 * First version to support DGM0915 LCD.
 *
 * Revision 1.38  2006/09/09 01:15:28  gmikef
 * *** empty log message ***
 *
 * Revision 1.37  2006/09/06 02:27:05  tvander
 * Clean build
 *
 * Revision 1.36  2006/08/30 02:09:53  gmikef
 * *** empty log message ***
 *
 * Revision 1.35  2006/07/07 01:08:04  tvander
 * Fixed misc. compilation warnings by changing the compilation flags for labs()
 *
 * Revision 1.34  2006/06/29 00:58:44  tvander
 * Added NOAREGs to reentrant code.
 *
 * Revision 1.33  2006/06/06 05:15:57  tvander
 * clean build
 *
 * Revision 1.32  2006/05/18 23:18:56  tvander
 * 16K and 32K
 * First cut at new requirements.
 * 32K 6521 is grossly tested.
 * All others have a clean compile with C51 8.02
 *
 * Revision 1.31  2006/04/14 20:21:25  tvander
 * Integrated with phased calibration
 *
 * Revision 1.30  2006/04/12 00:30:40  tvander
 * Added code for phased calibration, 6513 compiled with equations 3 and 4.
 *
 * Revision 1.29  2006/04/06 21:07:47  tvander
 * Build issue
 *
 * Revision 1.28  2006/03/17 00:45:16  tvander
 * IMAX2 needs a 64-bit product multiplication in its current revision
 *
 * Revision 1.27  2006/03/06 03:42:29  Michael T. Fischer
 * More 6530 prep.
 *
 * Revision 1.26  2006/02/10 00:53:50  tvander
 * Added routine to convert 64 bit numbers to floating point.
 *
 * Revision 1.25  2006/02/08 22:54:15  gmikef
 * *** empty log message ***
 *
 * Revision 1.24  2006/01/25 01:03:37  tvander
 * The gain adjustments were ported to floating point, and some fixed point routines became redundant.
 *
 * Revision 1.23  2006/01/16 20:11:32  tvander
 * Clean Keil build, all versions
 *
 * Revision 1.22  2006/01/10 04:12:40  gmikef
 * Added PDATA support for CE Outputs.
 *
 * Revision 1.21  2006/01/04 04:47:56  gmikef
 * Switched RMS and VA calculations to use floating point. (and Calibration).
 *
 * Revision 1.19  2005/10/31 21:58:39  tvander
 * shift8_1() and shift8_2() of the compact math would overwrite a large block of ram because their loop counters were not initialized.
 *
 * Revision 1.18  2005/10/31 17:38:05  tvander
 * Includes improved EEPROM code with uwire.
 * Clean build, all build trees (Thank-you, Mike!)
 *
 * Revision 1.17  2005/09/24 03:15:28  gmikef
 * Fixed "divide_1" function to give proper residue.
 *
 * Revision 1.16  2005/09/22 23:45:27  tvander
 * Clean build all models and unit tests, updated copyright to be fore Teridian
 *
 * Revision 1.15  2005/08/23 02:11:58  gmikef
 * *** empty log message ***
 *
 * Revision 1.14  2005/08/18 20:44:45  tvander
 * Added temperature measurement to GUI-available fields.
 * FIxed memory-space problem in add8_8
 * Added temp_x, temp_nom, ppmc and ppmc2 to register def. file.,
 * moved many other registers, whcih where in the way.
 *
 * Revision 1.13  2005/08/18 17:38:54  gmikef
 * *** empty log message ***
 *
 * Revision 1.12  2005/08/12 06:03:25  gmikef
 * Added MPU temperature compensation for GAIN_ADJ.
 * Added changes to support new CE 6521 code.
 *
 * Revision 1.11  2005/08/10 02:05:52  gmikef
 * *** empty log message ***
 *
 * Revision 1.10  2005/06/25 02:04:45  tvander
 * Integrated pulse counting
 *
 * Revision 1.9  2005/06/17 22:54:46  tvander
 * Separated imports and exports.
 * Some imports and exports were not being updated.
 *
 * Revision 1.8  2005/05/13 00:34:47  tvander
 * 6511/32k works
 * Integrated and debugged self-calibration.
 * The build has one unused segment, and no other errors or warnings.
 * default LCD and pulse displays appear OK.
 * EEPROM, software timers and hardware timers are all integrated.
 *
 * Revision 1.7  2005/05/04 01:00:36  gmikef
 * *** empty log message ***
 *
 * Revision 1.11  2005/05/03 22:29:40  gmikef
 * *** empty log message ***
 *
 * Revision 1.10  2005/05/03 02:18:55  gmikef
 * *** empty log message ***
 *
 * Revision 1.9  2005/05/02 18:03:19  gmikef
 * *** empty log message ***
 *
 * Revision 1.6  2005/04/30 02:19:05  gmikef
 * *** empty log message ***
 *
 * Revision 1.5  2005/04/28 19:12:27  tvander
 * Comments only!  Restored history comments.
 *
 * Revision 1.4  2005/04/27 23:47:23  gmikef
 * Some MATH rountines now use 'idata'.
 * Added MATH_FAST flag to 'options.h".
 * Changed "6521B.Uv2" to max optimization.
 *
 * Revision 1.3  2005/04/21 02:07:32  gmikef
 * *** empty log message ***
 *
 * Revision 1.2  2005/04/20 00:10:41  tvander
 * Revised the comments.  Hopefully they're more readable.
 *
 * Revision 1.1  2005/04/12 21:53:35  tvander
 * Library and math, compiles ok, added some comments (needs more)
 *
 * Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved.    *
 * this program is fully protected by the United States copyright          *
 * laws and is the property of Teridian Semiconductor Corporation.         *
 ***************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
香港成人在线视频| 一卡二卡欧美日韩| 91啪亚洲精品| 日本少妇一区二区| 国产精品久久久久久妇女6080| 777午夜精品免费视频| 国产精品亚洲一区二区三区在线| 一区二区三区中文字幕在线观看| 久久久精品国产免大香伊| 欧洲精品视频在线观看| 久久99热这里只有精品| 天天做天天摸天天爽国产一区| 国产欧美精品日韩区二区麻豆天美| 欧美性大战xxxxx久久久| 成人免费看的视频| 日本不卡123| 一区二区三区电影在线播| 欧美国产成人精品| 日韩欧美一级二级三级| 日本道精品一区二区三区| 国产91高潮流白浆在线麻豆| 青娱乐精品视频在线| 精品少妇一区二区三区免费观看| 欧美日本韩国一区二区三区视频| 成人av网站在线| 老汉av免费一区二区三区 | 亚洲小说欧美激情另类| 久久成人18免费观看| 欧美日韩在线一区二区| 亚洲欧美一区二区三区久本道91| 欧美午夜精品免费| 91国产免费看| a级精品国产片在线观看| 国产精品影视网| 国产乱码精品一区二区三| 日韩中文字幕不卡| 亚洲午夜在线观看视频在线| 亚洲资源中文字幕| 午夜久久福利影院| 一区二区三区91| 亚洲三级在线免费| 久久婷婷国产综合国色天香| 亚洲精品在线一区二区| 日韩一区二区三区三四区视频在线观看| 色婷婷狠狠综合| 欧美日韩aaaaaa| 欧美性生交片4| 色婷婷综合久久久久中文| 色婷婷激情综合| 91久久精品日日躁夜夜躁欧美| 成人性生交大片| 久久久午夜精品| 欧美一级一区二区| 国产精品影视天天线| 性感美女久久精品| 亚洲电影第三页| 日本成人在线一区| 五月天激情综合网| 亚洲成av人片www| 精品影视av免费| 国产一区二区不卡老阿姨| 狠狠色丁香久久婷婷综合丁香| 国产aⅴ精品一区二区三区色成熟| 国产成人av电影在线观看| 国产精品亚洲视频| 在线观看国产精品网站| 色综合天天性综合| 色悠久久久久综合欧美99| 在线国产亚洲欧美| 高清av一区二区| 成人一道本在线| 91福利视频久久久久| 欧美精品久久99久久在免费线| 欧美精品一卡二卡| www久久久久| 中文字幕日韩欧美一区二区三区| 国产三级一区二区三区| 中文字幕av一区二区三区| 久久国产三级精品| 色综合天天狠狠| 欧美性猛交一区二区三区精品| 97国产一区二区| 欧美一级午夜免费电影| 久久精品一区二区三区不卡| 综合电影一区二区三区 | 韩国三级在线一区| 成人免费毛片片v| 欧美视频中文字幕| 日韩欧美在线不卡| 国产精品毛片久久久久久| 一区二区日韩av| 亚洲成人在线观看视频| 蜜桃91丨九色丨蝌蚪91桃色| 国产一区高清在线| 色婷婷av一区二区三区大白胸 | 日韩欧美在线网站| 国产欧美综合在线观看第十页| 中文字幕在线不卡一区| 久国产精品韩国三级视频| 亚洲午夜久久久久中文字幕久| 一区av在线播放| 乱中年女人伦av一区二区| 成人av电影在线网| 欧美性受xxxx黑人xyx性爽| 26uuu亚洲综合色欧美| 一区二区三区在线免费观看| 国产一区二区三区日韩| 在线视频综合导航| 久久男人中文字幕资源站| 亚洲激情欧美激情| 国模一区二区三区白浆| 在线免费观看日韩欧美| 久久婷婷综合激情| 亚洲国产精品欧美一二99| 精品一区二区三区免费毛片爱| 一本到一区二区三区| 久久久久亚洲蜜桃| 秋霞午夜av一区二区三区| 99久精品国产| 国产日产欧美精品一区二区三区| 五月婷婷久久丁香| 91在线精品一区二区| 久久精品一区八戒影视| 国产日韩一级二级三级| 美女视频黄久久| 欧美三日本三级三级在线播放| 国产日韩欧美不卡在线| 美女一区二区三区| 欧美在线视频不卡| 国产精品久久久久一区| 亚洲chinese男男1069| 99久久婷婷国产综合精品电影| 欧美一二三区在线| 亚洲免费视频成人| caoporm超碰国产精品| 欧美精品一区二区三区高清aⅴ | 一区二区三区精品久久久| 国产精品一区二区黑丝| 欧美成va人片在线观看| 中文字幕第一区综合| 国产成人精品免费| xfplay精品久久| 国产在线播精品第三| 欧美变态tickling挠脚心| 日韩av在线发布| 日韩一区二区三区在线观看| 亚洲成人动漫av| 99国产精品一区| 欧美精品一区二区在线播放| 视频一区二区三区中文字幕| 91在线高清观看| 亚洲视频一区二区在线观看| 成人性生交大片免费看在线播放 | 久久久精品中文字幕麻豆发布| 捆绑调教美女网站视频一区| 欧美日韩中文另类| 国产精品视频一二三| 成人avav影音| 日韩毛片视频在线看| 色狠狠综合天天综合综合| 亚洲精品国产一区二区精华液 | 久久精品av麻豆的观看方式| 久久精品一区二区三区不卡| 色综合久久天天| 日韩精品一区第一页| 久久婷婷久久一区二区三区| 99re热这里只有精品视频| 午夜不卡av免费| 国产欧美一区二区精品性色| av一本久道久久综合久久鬼色| 午夜精品国产更新| 久久久蜜臀国产一区二区| 色噜噜狠狠色综合欧洲selulu| 日本91福利区| 日本一区二区不卡视频| 欧美三级电影在线看| 国产剧情一区在线| 亚洲国产色一区| 国产欧美日韩卡一| 欧美精品久久一区| 成人99免费视频| 日本一道高清亚洲日美韩| 亚洲国产成人午夜在线一区| 欧美日韩电影在线| 成人精品视频一区| 美女视频网站久久| 久久精品久久99精品久久| 国产精品灌醉下药二区| 日韩午夜中文字幕| 色综合久久88色综合天天免费| 极品少妇一区二区三区精品视频| 亚洲永久免费av| 欧美国产日本视频| 日韩欧美国产高清| 欧美私人免费视频| 不卡视频一二三| 国产精品 日产精品 欧美精品| 日韩高清不卡一区| 一区二区三区在线视频免费 | 日韩av在线播放中文字幕|