?? task.c
字號:
/* ---------------------------------- File Description --------------------------------------------
【文件功能】:
【創建時間】:2008年10月15日9:24:34
【文件版本】:V1.0
【作者聲明】:本文件作者為溫業中,可通過email與作者聯系: eric540@163.com
------------------------------------------------------------------------------------------ */
#include"type.h"
#include"can.h"
#include "task.h"
#define Master_ID 0x02
#define Self_ID 0x00
CAN_MSG MsgBuf_TX1, MsgBuf_TX2;
BYTE DispBuf[65];
int DispFramOver=FALSE;
CAN_MSG MsgBuf_RX1, MsgBuf_RX2;
/*---- S E N D _ K E Y ----
【功能】:發送鍵盤碼給主機
【參數】:鍵盤碼
****
【返回】:****
【說明】:****
--------------作者:溫業中 2008年10月15日9:22:40--------------------------------*/
void send_key(DWORD key_value)
{
DWORD ID_dat;
ID_dat='K';
ID_dat<<=16;
ID_dat|=(Master_ID<<8)|(Self_ID);
MsgBuf_TX1.Frame = 0x80080000; // 29-bit, no RTR, DLC is 8 bytes
MsgBuf_TX1.MsgID = ID_dat; // CAN ID
MsgBuf_TX1.DataA = (0x01<<24)|(key_value<<16)|0x0000;
MsgBuf_TX1.DataB = 0x00000000;
while(CAN1_SendMessage(&MsgBuf_TX1)==FALSE);
}
void send_CardDat(void)
{
}
/*---- R E C E I V E _ D I S P D A T ----
【功能】:接收主機顯示數據到緩存中
【參數】:
****
【返回】:****
【說明】:****
--------------作者:溫業中 2008年10月15日9:24:02--------------------------------*/
void Receive_DispDat(void)
{
int addr;
if((MsgBuf_RX1.MsgID>>16)=='D')
{
addr=(MsgBuf_RX1.DataA>>8)&0xff;
*((WORD*)(DispBuf+addr))=(MsgBuf_RX1.DataA>>16);
*((DWORD*)(DispBuf+addr+2))=MsgBuf_RX1.DataB;
if(addr==60)
DispFramOver=TRUE;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -