⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot.c

📁 C51学习书
💻 C
字号:



/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/**********************51系列单片机系统*********************/
/**************************作者:王绍伟*************************/
/***********************时间:2002年12月12***********************/
/************目的:完成51 单片机的底层基本功能********/
/*********************应用:各种工控设备*********************/
/********************* 编译平台:Keil51-V7.01**********************/
/***********************硬件平台:未定*************************/
/********************************************************************/
/********************************************************************/
/********************************************************************/
/********************************************************************/




/*************************************************/

/******************boot.c***************************/

/*************2002年12月13日*******************/

/************AUTHOR BY WANGSW********************/

#include <stdio.h>
#include "reg52x2.h"   
  
#include "define.h"


#include "led_key.h"
#include "iic.h"

#include "init.h"
#include "lcd.h"
#include "bitmap.h"
#include "uart.h"
#include "timer.h"
#include "rtc.h"
#include "smart_timer.h"

#include "boot.h"

static byte i = 0;

/******************************************************************************************
*函数名:		main
*参数:			无
*返回值:		无	
*描述:			
*编写:			王绍伟
*版本信息:		V1.0			2003年8月15日
******************************************************************************************/

main(void)
{
	init_process();					/*r初始化进程*/

	//lcd_display_graphic(0,0,32,16,FALSE,SEND);
	//lcd_display_graphic(0,16,32,16,FALSE,RECEIVE);
#if 0
	msg_queue_in(MSG_T0, 1);
	msg_queue_in(MSG_T1, 1);
	msg_queue_in(MSG_T2, 1);
	msg_queue_in(MSG_T3, 1);
#endif
	/****************************************************/
	while(TRUE)
	{
		switch(msg_queue_out())						/*r根据消息队列的取值进行处理*/
		{
			case MSG_KEY:						/*r若是按键消息*/
				g_KeyStore = g_MsgReturnValue;
				lcd_display_byte(40, 0, TRUE, FALSE, g_MsgReturnValue);
				if(g_KeyStore == 8)
				{
					smart_timer_start(MSG_DATA, 2, 1000, 1);
				}
				break;
			case MSG_UART:						/*r若是串口通信消息,则进行串口通信处理*/
				uart_process();
				break;
			case MSG_DATA:					
				lcd_display_byte(40, 48, TRUE, FALSE, g_MsgReturnValue);
				break;
			case MSG_RTC:
				#ifdef SOFT_RTC
				rtc_soft_process(g_MsgReturnValue);
				#else
				rtc_pcf8563_process(g_MsgReturnValue);
				#endif
				//lcd_display_byte(0, 32, TRUE, FALSE, g_RTCPool[0]);
				lcd_display_byte(0, 32, TRUE, FALSE, i++);
				break;
#if 0
			case MSG_T0:
				printf("wangsw0\n");
				break;
			case MSG_T1:
				printf("wangsw1\n");
				break;
			case MSG_T2:
				printf("wangsw2\n");
				break;
			case MSG_T3:
				printf("wangsw3\n");
				break;
#endif
			default:
				break;
		}
	}
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -