?? main.c
字號:
//======================================================================
// The information contained herein is the exclusive property of
// Sunnnorth Technology Co. And shall not be distributed, reproduced,
// or disclosed in whole in part without prior written permission.
// (C) COPYRIGHT 2003 SUNNORTH TECHNOLOGY CO.
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorized copies.
//======================================================================
//====================================================================================
//工 程 名: SensorsMd_IRTDemo.spj
//功能描述: 簡易遙控器,用61板的三個鍵作為遙控器上的按鍵,可以配合SensorsMd_IRDemo程序進行進行遙控器遙控模擬
//包含文件: main.c\Tx.c\Key.c\Tx_Rx.c
// isr.asm
// SPCE061A.h
// SPCE061A.inc
//硬件連接: 用10pin排線連接IOB的高8位與傳感器模組的J1
//維護記錄: 2006年7月28 v1.0 by hongyan.Feng
//====================================================================================
//====================================================================================
//文 件 名: main.c
//功能描述: 簡易遙控器
//維護記錄: 2006年7月28 by hongyan.Feng
//====================================================================================
#include "SPCE061A.h"
#define KEY1 0x0001
#define KEY2 0x0002
#define KEY3 0x0004
extern void Key_Init(void);
extern unsigned int KeyScan(void);
extern void KEY1_Tx(void);
extern void KEY2_Tx(void);
extern void KEY3_Tx(void);
//====================================================================================
//語法格式:int main(void)
//功能描述: 主函數,遙控發射
//入口參數: 無
//出口參數: 無
//維護記錄: 2006年7月28 by hongyan.Feng
//====================================================================================
int main(void)
{
unsigned int Key=0;
Key_Init(); //鍵盤初始化
while(1)
{
Key = KeyScan(); //鍵盤掃描
switch(Key)
{
case KEY1: //當KEY1按下時,調用KEY1_Tx()發送序列,該函數在Tx.C文件中定義
KEY1_Tx();
break;
case KEY2: //當KEY2按下時,調用KEY2_Tx()發送序列,該函數在Tx.C文件中定義
KEY2_Tx();
break;
case KEY3: //當KEY3按下時,調用KEY3_Tx()發送序列,該函數在Tx.C文件中定義
KEY3_Tx();
break;
default:
break;
}
*P_Watchdog_Clear = 0x0001;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -