红外接收(nec)稳定程序 c文件
/* =========================================================================== */
/* Project: s3c44b0_lib */
/* File: irda.c */
/* Organization: cug-1200525 */
/* Author: yuyongbao */
/* Date: 5/11/2007 */
/* Describe: lib */
/* =========================================================================== */
#include "..\mcu_lib\lib_config.h"
#include "irda.h"
unsigned char bitcnt;
unsigned char Irdata[4];
unsigned char IrBegin,IrOK;
void Irda_Init(void)
{
bitcnt=0;
IrOK=FALSE;
IrBegin=FALSE;
rTCON &= 0xf0ffffff; // clear manu
相关文档:
http://c.chinaitlab.com/c/basic/200907/789321.html
词法陷阱:
1 = 不同于==不要在程序中将两者写错,小心。将表达式与常量比较时,可将常量放在左边。
2 &和| 不同于& ......
曾经碰到过让你迷惑不解、类似于int * (* (*fp1) (int) ) [10];这样的变量声明吗?
本文将由易到难,一步一步教会你如何理解这种复杂的C/C++声明。
我们将从每天都能碰到的较简单的声明入手,然后逐步加入const修饰符和typedef,还有函数指针,最后介绍一个能够让你准确地理解任何C/C++声明的“右左法则&rdquo ......
经常需要在程序中将远程传来的字节流进行结构化,或者将结构化的数据变成字节流传给远程主机。在C/C++程序中,结构化数据通常用结构体来组织,结构体也能够方便的转换为字节流,因此结构化的数据传输本不该成为问题,但在VC或GCC的默认设置下编译出的程序,却有一个值得注意的问题——结构体的对齐。 ......
assert
函数名: assert
功 能: 测试一个条件并可能使程序终止
用 法: void assert(int test);
程序例:
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
struct ITEM {
int&n ......
/* =========================================================================== */
/* Project: s3c44b0_lib & ......