随笔分类 -  代码

摘要:#define max(x,y,z) ((x)>(y)?(x):(y))>(z)?((x)>(y)?(x):(y)):(z) #define min(x,y,z) ((x)<(y)?(x):(y))<(z)?((x)<(y)?(x):(y)):(z) 阅读全文
posted @ 2016-08-18 16:20 SuGuolin 阅读(520) 评论(0) 推荐(0)
摘要:#include /* date type defination */ typedef signed char rt_int8_t; typedef signed short rt_int16_t; typedef signed long rt_int32_t; typedef unsigned char rt_uint8_t; typedef unsigne... 阅读全文
posted @ 2016-05-03 22:09 SuGuolin 阅读(514) 评论(0) 推荐(0)
摘要:最近在做的项目需求cc2540在处理数据过程中要把时间戳转换成日期格式,一开始我在网上一直找对应的函数网上都是利用C标准库来处理,由于IAR里的C51库没有time.c,所以无法调用。后来在QQ群里有人说可以用BLE的OSAL_ClockBLE.c里的函数直接转换 阅读全文
posted @ 2016-04-07 14:10 SuGuolin 阅读(1133) 评论(0) 推荐(0)
摘要:int a;int *p;p = &a;*p = 0x100; //a=0x100p = (int *)0x56000050;*p =0x100;*( ( int * ) 0x56000050) = 0x100加上volatile是为了防止编译器优化这个寄存器#define G... 阅读全文
posted @ 2015-11-11 22:15 SuGuolin 阅读(1067) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2015-10-19 10:53 SuGuolin 阅读(985) 评论(0) 推荐(0)
摘要:hx711_buf[cnt++]=hx711_read_adc(); if(cnt==6) { //get max min cnt=0; sum=0; max=min=hx711_b... 阅读全文
posted @ 2015-10-10 17:41 SuGuolin 阅读(720) 评论(0) 推荐(0)