虫虫首页|资源下载|资源专辑|精品软件
登录|注册

Return

函数是C语言的基本构件,一个C程序可以由一个主函数和若干个子程序函数构成,由主函数调用其它子程序函数,其他子程序函数也可以互相调用。通常希望通过函数调用使主函数能得到一个确定的值,这就是函数的返回值。[1]
  • I2C总线驱动程序

    1 /**————————————————————2 〖说明〗I2C总线驱动程序(用两个普通IO模拟I2C总线)3 包括100Khz(T=10us)的标准模式(慢速模式)选择,4 和400Khz(T=2.5us)的快速模式选择,5 默认11.0592Mhz的晶振。6 〖文件〗PCF8563T.C ﹫2001/11/2 77 〖作者〗龙啸九天 c51@yeah.net http://www.c51bbs.co /8 〖修改〗修改建议请到论坛公布 http://www.c51bbs.co m9 〖版本〗V1.00A Build 080310 —————————————————————*/1112 #ifndef SDA13 #define SDA P0_014 #define SCL P0_115 #endif1617 extern uchar SystemError;1819 #define uchar unsigned char20 #define uint unsigned int21 #define Byte unsigned char22 #define Word unsigned int23 #define bool bit24 #define true 125 #define false 02627 #define SomeNOP(); _nop_();_nop_();_nop_();_nop_();2829 /**--------------------------------------------------------------------------------30 调用方式:void I2CStart(void) ﹫2001/07/0 431 函数说明:私有函数,I2C专用32 ---------------------------------------------------------------------------------*/33 void I2CStart(void)34 {35 EA=0;36 SDA=1; SCL=1; SomeNOP();//INI37 SDA=0; SomeNOP(); //START38 SCL=0;39 }4041 /**--------------------------------------------------------------------------------42 调用方式:void I2CStop(void) ﹫2001/07/0 443 函数说明:私有函数,I2C专用44 ---------------------------------------------------------------------------------*/45 void I2CStop(void)46 {47 SCL=0; SDA=0; SomeNOP(); //INI48 SCL=1; SomeNOP(); SDA=1; //STOP49 EA=1;50 }5152 /**--------------------------------------------------------------------------------53 调用方式:bit I2CAck(void) ﹫2001/07/0 454 函数说明:私有函数,I2C专用,等待从器件接收方的应答55 ---------------------------------------------------------------------------------*/56 bool WaitAck(void)57 {58 uchar errtime=255;//因故障接收方无ACK,超时值为255。59 SDA=1;SomeNOP();60 SCL=1;SomeNOP();61 while(SDA) {errtime--; if (!errtime) {I2CStop();SystemError=0x11;Return false;}}62 SCL=0;63 Return true;

    标签: I2C 总线 驱动程序

    上传时间: 2014-04-11

    上传用户:xg262122

  • EDGE信道分配原则

      Contents   1 Introduction 1   2 Glosary 1   2.1 Concepts 1   2.2 Abbreviations and acronyms 4   3 Capabilities 6   4 Technical Description 6   4.1 General 6   4.2 Service oriented Allocation of Resources on the Abis   interface (SARA) 8   4.3 Configuration of dedicated PDCHs in Packet Switched   Domain (PSD) 10   4.4 Handling of Packet Data traffic 15   4.5 Channel selection in Cicuit Switched Domain (CSD) 19   4.6 Return of PDCHs to Cicuit Switched Domain (CSD) 22   4.7 Main changes in Ericsson GSM system R10/BSS R10 24   5 Engineering guidelines 24   6 Parameters 26   6.1 Main controlling parameters 26   6.2 Parameters for special adjustments 26   6.3 Value ranges and default values 28   7 References 29

    标签: EDGE 信道分配

    上传时间: 2013-11-12

    上传用户:ainimao

  • 10种软件滤波方法的示例程序 文档

    10种软件滤波方法的示例程序 假定从8位AD中读取数据(如果是更高位的AD可定义数据类型为int),子程序为get_ad(); 1、限副滤波 /*  A值可根据实际情况调整     value为有效值,new_value为当前采样值       滤波程序返回有效的实际值  */ #define A 10 char value; char filter() {    char  new_value;    new_value = get_ad();    if ( ( new_value - value > A ) || ( value - new_value > A )       Return value;    Return new_value;           }

    标签: 软件 滤波方法 文档 程序

    上传时间: 2013-11-10

    上传用户:gxf2016

  • C语言函数大全(语法着色版)

        C语言函数大全,已包含绝大部分的函数。每个函数包含函数名,功能,用法,举例,内容详尽。希望对大家有所帮助~~   函数名: abort   功 能: 异常终止一个进程   用 法: void abort(void);   程序例:   #include   #include   int main(void)   {   printf("Calling abort()\n");   abort();   Return 0; /* This is never reached */   }   函数名: abs   功 能: 求整数的绝对值   用 法: int abs(int i);   程序例:   #include   #include   int main(void)   {   int number = -1234;   printf("number: %d absolute value: %d\n", number, abs(number));   Return 0;   }

    标签: C语言 函数

    上传时间: 2013-12-06

    上传用户:feifei0302

  • 软件测试:一个编译器测试软件

    软件测试:一个编译器测试软件,支持下列C语言运算符:+ - * / % ^(乘方) 负 (int) (double) "字符串" [](数组) > < == >= <= != && ! ++ -- = += -= *= /= %= ^=,支持下列关键字:void int double string if else for while do goto break continue Return,支持下列数据类型:int double string int[] double[] string[],支持下列系统函数:int max(int,int),double max(double,double),int[] newint(int),double[] newdouble(int),string[] newstring(int),void delete(int[]),void delete(double[]),void delete(string[]),支持任意用户定义函数,支持函数重载。不支持全局变量。如果发现错误,请告诉我

    标签: 软件测试 编译器 测试软件

    上传时间: 2013-12-14

    上传用户:sy_jiadeyi

  • 啥也不说了

    啥也不说了,请看代码示例 File : fat_dir.c FS_DIR *FS__fat_opendir(const char *pDirName, FS_DIR *pDir) { FS_size_t len FS_u32 unit FS_u32 dstart ....... FS_u32 dsize FS_i32 i char realname[12] char *filename if (!pDir) { Return 0 /* No valid pointer to a FS_DIR structure */ }

    标签:

    上传时间: 2013-12-13

    上传用户:梧桐

  • 接收pop3 Public Function Retrieve(ByVal rhs As Pop3Message) As Pop3Message Dim message, response A

    接收pop3 Public Function Retrieve(ByVal rhs As Pop3Message) As Pop3Message Dim message, response As String Dim msg As New Pop3Message msg.bytes = rhs.bytes msg.number = rhs.number message = "RETR " + rhs.number.ToString + vbCrLf write(message) response = Respond() If response.Substring(0, 3) <> "+OK" Then Throw New Pop3Exception(response) End If MsgBox(msg) msg.retrieved = True While (1 = 1) response = Respond() If response = "." + vbCrLf Then Exit While Else msg.message += response End If End While Return msg End Function

    标签: Pop3Message Function Retrieve response

    上传时间: 2013-12-28

    上传用户:fnhhs

  • 大整数乘法例子代码 /* 递归边界

    大整数乘法例子代码 /* 递归边界,如果是1位二进制数与1位二进制数相乘,则可以直接计算 */ /*累计做1位二进制乘法运算的次数*/ /* Return (X*Y) */ /* 计算n的值 */ /* 把X和Y拆分开来,令X=A*2^(n/2)+B, 左移位运算,mod = 1<<(n/2) */ /* 计算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */ /* 计算A*C,再向左移n位 */ /* 递归计算A*D */ /* 递归计算C*B */ /* 计算a21+a22,再向左移n/2位 */ /* 递归计算B*D */ /* XY=a1+a2+a3 */

    标签: 整数 乘法 代码 递归

    上传时间: 2015-05-19

    上传用户:gyq

  • * Function: * 1. Replace the first oldstr with newstr in srcstr * Arguments: * IN : * srcst

    * Function: * 1. Replace the first oldstr with newstr in srcstr * Arguments: * IN : * srcstr * oldstr * newstr * OUT : * srcstr * Return: * 1. If find and replace one oldstr with newstr in srcstr , Return 1 * 2. If find no oldstr in srcstr , Return 0 * 3. If error (malloc Return NULL) Return -1 * Notes: * 1. srcstr should be large size enough.

    标签: Arguments Function Replace oldstr

    上传时间: 2014-12-19

    上传用户:Yukiseop

  • * * Input * bin_data : binary data * bin_size : binary data length * Mode : operation mode

    * * Input * bin_data : binary data * bin_size : binary data length * Mode : operation mode * BASE64_NeedCRLF ---- Need a CRLF every 64 base64-character * BASE64_NotCRLF ---- Need not CRLF between 64 base64-character * * Output * char data * char data length * * Return * 0: success -1: error

    标签: binary data operation bin_data

    上传时间: 2015-06-04

    上传用户:ZJX5201314