📄 boardii_main.c
字号:
#include <reg51.h>
#include "LCD1602\LCD1602.h"
#include "MATRIX_KEY\Matrix_Key.h"
#include "print\print.h"
#include "SRT8300\SRT8300.h"
unsigned char code display1[] = {" HDU _#fal "};
unsigned char code display2[] = {" Copyright@2006"};
void timer_int0() interrupt 1 //定时器0
{
static unsigned char channel = 0;
TH0=0xd8; //定时器0 : 10ms
TL0=0xef; // 10ms
if (Matrix_Key_Detect())
{
if (col==1)
{
WriteReg[3] |= 0x40;
SendData3Wire();
time_delay_short(0xff);
WriteReg[3] &= ~0x40;
SendData3Wire();
}
if (col==4 ) //col : 竖行(BoardII)
{
if (channel == 0)
{
channel = RADIO_FRE_COUNT-1;
}
else
{
channel --;
}
WriteReg[0] = WriteReg_RadioFRE[channel*3];
WriteReg[1] = WriteReg_RadioFRE[channel*3+1];
WriteReg[18] = WriteReg_RadioFRE[channel*3+2];
print_Char('0'+channel);
print_Hex(WriteReg[0], 0);
print_Hex(WriteReg[1], 1);
SendData3Wire();
}
if (col==3)
{
if (channel == RADIO_FRE_COUNT)
{
channel = 0;
}
else
{
channel ++;
}
WriteReg[0] = WriteReg_RadioFRE[channel*3];
WriteReg[1] = WriteReg_RadioFRE[channel*3+1];
WriteReg[18] = WriteReg_RadioFRE[channel*3+2];
print_Char('0'+channel);
print_Hex(WriteReg[0], 0);
print_Hex(WriteReg[1], 1);
SendData3Wire();
}
DisplayOneChar(5,0,'0'+row);
DisplayOneChar(13,0,'0'+col);
//------
}
TR0 = 1;
}
void main()
{
EA = 1;
ET0 = 1; //开中断 : INIT0
// PT0=1; //T0中断高优先级
TMOD = 0x21; //定时/计数控制器 T1:自动重装 T0:16位定时器
TH0=0xd8; //定时器0 : 10ms
TL0=0xef; // 10ms
TR0 = 1;
LCMInit(); //LCM初始化
DisplayListChar_code(0, 0, display1);
DisplayListChar_code(0, 1, display2);
print_init();
print_Str("$Radio51_v0.1\n\r");
SendData3Wire();
for (;;);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -