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

📄 main.c

📁 M37546产品群智能水表的解决方案,请需要的朋友下载
💻 C
字号:
/************************************************************************/
/* Renesas System Solutions (Beijing) Co., LTD.							*/
/* All rights reserved.													*/
/*																		*/
/* File Name		: main.c											*/
/* Description		: 													*/
/*																		*/
/* Current Version	: 1.0												*/
/* Designer			: Feng Jun											*/
/* Start Date		: 2006-11-3											*/
/* Complete Date	: 2006-11-22										*/
/*																		*/
/* Lastest Version	:													*/
/* Designer			:													*/
/* Start Date		: 													*/
/* Complete Date	: 													*/
/************************************************************************/
#include "main.h"
#include "Initial.h"
#include "EEPROM.h"
#include "Detect.h"
#include "Card.h"
#include "Flux.h"
#include "LCD.h"

extern void DisableLCD(void);
union byte_def detectflagaddr;
union byte_def fluxstatusaddr;
union byte_def iofluxstatusaddr;
union byte_def byteflagaddr;

char g_statusA = 0;
char g_timerA3s;
char g_timerA10s;

void main(void)
{
	SystemInit();				/* Initial system */

	SFRInit(); 					/* Initial setting of SFR registers */

	ReadInfoEEPROM();			/* Read infomation of water in EEPROM */
	
	CheckTypePower();			/* Check the type of power on */
	
	while ( 1 )
	{
		switch ( g_statusA )
		{
			case 1:				/* Card has been inserted, check the type of card and process the corresponding task */
				ProcessCard();	
				break;

			case 2:				/* Process flux */
				ProcessFlux();
				break;

			case 3:				/* Display some infomation on LCD such as surplus and the status of water meter */
				LCDDisplay();
				break;

			case 4:				/* Wait for 3s, detect flux and control the valve */
				DetectFlux();
				break;

			case 5:				/* Power down */
				io_powercontrol = 0;
//				DisableLCD();
				//io_LCDCS = 1;	/* Disable LCD */
/* test */
//				g_statusA = 4;
/* test end */
				break;
				
			default: 			/* Accident */
				g_statusA = 5;	/* If there is an accident, go to power down */
				break;

		}
	}

}

⌨️ 快捷键说明

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