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

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

?? lib_math.c

?? stm32+ucos-ii
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/LIB
*                                        CUSTOM LIBRARY MODULES
*
*                          (c) Copyright 2004-2011; Micrium, Inc.; Weston, FL
*
*               All rights reserved.  Protected by international copyright laws.
*
*               uC/LIB is provided in source form to registered licensees ONLY.  It is 
*               illegal to distribute this source code to any third party unless you receive 
*               written permission by an authorized Micrium representative.  Knowledge of 
*               the source code may NOT be used to develop a similar product.
*
*               Please help us continue to provide the Embedded community with the finest 
*               software available.  Your honesty is greatly appreciated.
*
*               You can contact us at www.micrium.com.
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*
*                                        MATHEMATIC OPERATIONS
*
* Filename      : lib_math.c
* Version       : V1.35.00
* Programmer(s) : SR
*                 ITJ
*********************************************************************************************************
* Note(s)       : (1) NO compiler-supplied standard library functions are used in library or product software.
*
*                     (a) ALL standard library functions are implemented in the custom library modules :
*
*                         (1) \<Custom Library Directory>\lib_*.*
*
*                         (2) \<Custom Library Directory>\Ports\<cpu>\<compiler>\lib*_a.*
*
*                               where
*                                       <Custom Library Directory>      directory path for custom library software
*                                       <cpu>                           directory name for specific processor (CPU)
*                                       <compiler>                      directory name for specific compiler
*
*                     (b) Product-specific library functions are implemented in individual products.
*
*********************************************************************************************************
* Notice(s)     : (1) The Institute of Electrical and Electronics Engineers and The Open Group, have given
*                     us permission to reprint portions of their documentation.  Portions of this text are
*                     reprinted and reproduced in electronic form from the IEEE Std 1003.1, 2004 Edition,
*                     Standard for Information Technology -- Portable Operating System Interface (POSIX),
*                     The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute
*                     of Electrical and Electronics Engineers, Inc and The Open Group.  In the event of any
*                     discrepancy between these versions and the original IEEE and The Open Group Standard,
*                     the original IEEE and The Open Group Standard is the referee document.  The original
*                     Standard can be obtained online at http://www.opengroup.org/unix/online.html.
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                            INCLUDE FILES
*********************************************************************************************************
*/

#define    LIB_MATH_MODULE
#include  <lib_math.h>


/*$PAGE*/
/*
*********************************************************************************************************
*                                            LOCAL DEFINES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                           LOCAL CONSTANTS
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                          LOCAL DATA TYPES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                            LOCAL TABLES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                       LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/

RAND_NBR  Math_RandSeedCur;                                     /* Cur rand nbr seed.                                   */


/*
*********************************************************************************************************
*                                      LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                     LOCAL CONFIGURATION ERRORS
*********************************************************************************************************
*/


/*$PAGE*/
/*
*********************************************************************************************************
*                                             Math_Init()
*
* Description : (1) Initialize Mathematic Module :
*
*                   (a) Initialize random number seed value
*
*
* Argument(s) : none.
*
* Return(s)   : none.
*
* Caller(s)   : Application.
*
* Note(s)     : (2) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "if rand()
*                   is called before any calls to srand() are made, the same sequence shall be generated
*                   as when srand() is first called with a seed value of 1".
*********************************************************************************************************
*/

void  Math_Init (void)
{
    Math_RandSetSeed((RAND_NBR)RAND_SEED_INIT_VAL);             /* See Note #2.                                         */
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                         Math_RandSetSeed()
*
* Description : Set the current pseudo-random number generator seed.
*
* Argument(s) : seed        Initial (or current) value to set for the pseudo-random number sequence.
*
* Return(s)   : none.
*
* Caller(s)   : Application.
*
* Note(s)     : (1) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "srand() 
*                   ... uses the argument as a seed for a new sequence of pseudo-random numbers to be 
*                   returned by subsequent calls to rand()".
*
*               (2) 'Math_RandSeedCur' MUST always be accessed exclusively in critical sections.
*
*                   See also 'Math_Rand()  Note #1b'.
*********************************************************************************************************
*/

void  Math_RandSetSeed (RAND_NBR  seed)
{
    CPU_SR_ALLOC();


    CPU_CRITICAL_ENTER();
    Math_RandSeedCur = seed;
    CPU_CRITICAL_EXIT();
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                             Math_Rand()
*
* Description : Calculate the next pseudo-random number.
*
* Argument(s) : none.
*
* Return(s)   : Next pseudo-random number in the sequence after 'Math_RandSeedCur'.
*
* Caller(s)   : Application.
*
* Note(s)     : (1) (a) The pseudo-random number generator is implemented as a Linear Congruential 
*                       Generator (LCG).
*
*                   (b) The pseudo-random number generated is in the range [0, RAND_LCG_PARAM_M].
*
*                   See also 'Math_RandSeed()  Note #1'.
*
*               (2) (a) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "rand() 
*                       ... need not be reentrant ... [and] is not required to be thread-safe".
*
*                   (b) However, in order to implement Math_Rand() as re-entrant; 'Math_RandSeedCur' MUST 
*                       always be accessed & updated exclusively in critical sections.
*
*                   See also 'Math_RandSeed()  Note #2'.
*********************************************************************************************************
*/

RAND_NBR  Math_Rand (void)
{
    RAND_NBR  seed;
    RAND_NBR  rand_nbr;
    CPU_SR_ALLOC();


    CPU_CRITICAL_ENTER();
    seed             = Math_RandSeedCur;
    rand_nbr         = Math_RandSeed(seed);
    Math_RandSeedCur = rand_nbr;
    CPU_CRITICAL_EXIT();

    return (rand_nbr);
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                           Math_RandSeed()
*
* Description : Calculate the next pseudo-random number.
*
* Argument(s) : seed        Initial (or current) value for the pseudo-random number sequence.
*
* Return(s)   : Next pseudo-random number in the sequence after 'seed'.
*
* Caller(s)   : Math_Rand(),
*               Application.
*
* Note(s)     : (1) (a) BSD/ANSI-C implements rand() as a Linear Congruential Generator (LCG) :
*
*                       (A) random_number       =  [(a * random_number ) + b]  modulo m
*                                        n + 1                        n
*
*                               where
*                                       (1) (a) random_number           Next     random number to generate
*                                                            n+1
*                                           (b) random_number           Previous random number    generated
*                                                            n
*
*                                       (2) a = RAND_LCG_PARAM_A        LCG multiplier
*                                       (3) b = RAND_LCG_PARAM_B        LCG incrementor
*                                       (4) m = RAND_LCG_PARAM_M + 1    LCG modulus
*
*                   (b) The pseudo-random number generated is in the range [0, RAND_LCG_PARAM_M].
*
                    See also 'lib_math.h  RANDOM NUMBER DEFINES  Note #1b'.
*
*               (2) (a) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "rand() 
*                       ... need not be reentrant ... [and] is not required to be thread-safe".
*
*                   (b) However, Math_RandSeed() is re-entrant since it calculates the next random number 
*                       using ONLY local variables.
*********************************************************************************************************
*/

RAND_NBR  Math_RandSeed (RAND_NBR  seed)
{
    RAND_NBR  rand_nbr;


    rand_nbr = (((RAND_NBR)RAND_LCG_PARAM_A * seed) + (RAND_NBR)RAND_LCG_PARAM_B)  %  ((RAND_NBR)RAND_LCG_PARAM_M + 1u);

    return (rand_nbr);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲美女在线国产| 综合久久给合久久狠狠狠97色 | 欧美日韩aaaaaa| 成人激情综合网站| 国产高清亚洲一区| 国产河南妇女毛片精品久久久| 奇米精品一区二区三区在线观看一| 亚洲国产成人av好男人在线观看| 亚洲黄色尤物视频| 亚洲一区免费观看| 婷婷综合另类小说色区| 视频一区二区中文字幕| 日韩成人午夜电影| 久久精品国产网站| 国产一区二区视频在线| 国产成人av电影免费在线观看| 国产乱妇无码大片在线观看| 波多野结衣亚洲| 91麻豆文化传媒在线观看| 色爱区综合激月婷婷| 欧洲一区二区三区免费视频| 欧美电影一区二区三区| 日韩一区二区三区在线观看| 欧美大胆一级视频| 国产精品久久影院| 一区二区三区欧美| 蜜臀a∨国产成人精品| 国产原创一区二区| 色综合久久综合网欧美综合网| 欧美视频在线一区二区三区| 日韩女优电影在线观看| 国产精品色呦呦| 亚洲动漫第一页| 国产精品一区二区久激情瑜伽| 色综合久久久久久久| 正在播放一区二区| 国产欧美精品一区| 亚洲国产视频一区| 国产精品自产自拍| 欧美日韩激情在线| 日本一区二区三区国色天香 | 亚洲人成小说网站色在线| 亚洲精品视频在线| 久久精品99久久久| 色8久久精品久久久久久蜜| 日韩一区二区三区四区| 亚洲免费资源在线播放| 麻豆视频观看网址久久| 日本乱人伦一区| 久久―日本道色综合久久| 亚洲另类中文字| 国产成人亚洲综合色影视| 欧美精品 国产精品| 国产精品免费视频网站| 久久精品国产77777蜜臀| 欧美亚洲高清一区| 中文字幕亚洲综合久久菠萝蜜| 青椒成人免费视频| 在线观看日韩毛片| 国产精品久久久久久亚洲毛片 | 欧美一区中文字幕| 一区二区三区中文在线| 国v精品久久久网| 欧美草草影院在线视频| 亚洲一级电影视频| 波多野结衣在线一区| 久久综合色播五月| 美国十次综合导航| 精品视频在线免费观看| 亚洲精品综合在线| 北条麻妃一区二区三区| 国产欧美日本一区二区三区| 国产精品资源在线| 精品久久人人做人人爱| 久久精品二区亚洲w码| 日韩你懂的电影在线观看| 日韩国产高清在线| 欧美一区二区三区日韩视频| 热久久久久久久| 欧美不卡视频一区| 精品一区二区三区在线观看| 精品国产凹凸成av人网站| 精一区二区三区| 久久婷婷国产综合精品青草| 国产伦精一区二区三区| 欧美激情一区在线| 一本久久综合亚洲鲁鲁五月天 | 国产成人av电影在线播放| 国产欧美精品在线观看| 成人av网站在线观看免费| 国产精品你懂的在线欣赏| 成人午夜伦理影院| 欧美日韩一级黄| 美腿丝袜在线亚洲一区| 日韩精品影音先锋| 久久国产精品72免费观看| 欧美成人官网二区| 国产成人h网站| 亚洲综合一区二区三区| 欧亚洲嫩模精品一区三区| 日本不卡123| 精品午夜久久福利影院| 欧美一区二区视频网站| 亚洲一区免费在线观看| 欧美猛男gaygay网站| 五月天欧美精品| 色噜噜狠狠成人网p站| 亚洲欧美国产三级| 精品国产一区二区三区久久久蜜月 | 成人综合婷婷国产精品久久免费| 国产欧美精品一区二区三区四区 | 亚洲午夜视频在线| 91精品福利在线| 日韩福利电影在线| 久久综合狠狠综合久久综合88| 成人午夜私人影院| 亚洲美女免费视频| 欧美一区午夜视频在线观看| 国产精品一区二区果冻传媒| 国产精品福利一区二区三区| 91精品国产综合久久久蜜臀粉嫩| 精油按摩中文字幕久久| 亚洲色图在线看| 91精品国产欧美一区二区18| 国产精品一区二区在线观看不卡| 亚洲日本一区二区| 国产午夜精品久久久久久久| 91日韩一区二区三区| 蜜桃久久久久久| 亚洲区小说区图片区qvod| 91精品国产免费| 色婷婷激情一区二区三区| 美洲天堂一区二卡三卡四卡视频| 日本一区二区不卡视频| 在线成人高清不卡| bt欧美亚洲午夜电影天堂| 日本不卡一区二区三区高清视频| 久久久久9999亚洲精品| 欧美狂野另类xxxxoooo| 成人禁用看黄a在线| 日本不卡不码高清免费观看| 亚洲欧美日韩在线播放| 亚洲国产精品成人久久综合一区| 制服丝袜中文字幕一区| 成人午夜看片网址| 精品一区二区久久久| 亚洲国产另类精品专区| 一区二区欧美在线观看| 国产精品久久网站| 欧美不卡一区二区三区| 3d动漫精品啪啪1区2区免费| 91丝袜美腿高跟国产极品老师| 日本欧美一区二区在线观看| 天天综合色天天综合| 洋洋成人永久网站入口| 国产精品全国免费观看高清 | 欧美性高清videossexo| 成人黄色片在线观看| 精东粉嫩av免费一区二区三区| 午夜视黄欧洲亚洲| 亚洲欧美日韩综合aⅴ视频| 国产精品欧美久久久久一区二区| 久久这里只有精品视频网| 久久久国产一区二区三区四区小说 | 91色视频在线| 99久久久久久99| 国产综合色在线| 成人午夜电影久久影院| 国产91色综合久久免费分享| 国产一区二区免费看| 国产一区二区三区日韩| 国产福利精品一区| 国产夫妻精品视频| 成人美女视频在线看| 黄色日韩网站视频| 国产激情91久久精品导航| 成人免费毛片嘿嘿连载视频| 成人综合激情网| 国内精品嫩模私拍在线| av网站免费线看精品| 99久久国产综合色|国产精品| 国产成人啪免费观看软件| 国产成人欧美日韩在线电影| 91国偷自产一区二区三区观看 | 日韩精品中文字幕一区| www欧美成人18+| 中文乱码免费一区二区| 自拍偷拍亚洲综合| 亚洲国产精品尤物yw在线观看| 午夜欧美大尺度福利影院在线看| 国产精品一二二区| 99re在线精品| 欧美老女人在线| 久久夜色精品一区| 精品久久久久久久久久久久久久久久久| 欧美国产成人在线| 亚洲mv在线观看| 国产一区二区三区av电影| 99精品国产视频| 日韩一区二区三区免费观看|