📄 main.c
字号:
/******************************************************************************
Copyright (c) 2003 MStar Semiconductor, Inc.
All rights reserved.
[Module Name]: Main.c
[Date]: 03-Nov-2003
[Comment]:
Main subroutines.
[Reversion History]:
*******************************************************************************/
//#pragma OPTIMIZE (9,SPEED) BROWSE ORDER DEBUG OBJECTEXTEND CODE SYMBOLS AREGS
#define _MAIN_C_
// Common
#include "define.h"
#include "mcu.h"
#include "userdef.h"
#include "userpref.h"
// External
#include "uart.h"
#include "debug.h"
#include "global.h"
#include "isr.h"
#include "keypad.h"
#include "ram.h"
#include "common.h"
#include "ir.h"
// Internal
#include "main.h"
////////////////////////////////
// Main program
////////////////////////////////
void main(void)
{
PowerOnInitial();
McuInit();
putstr( "\r\n main loop!" );
while (1)
{
uartDecodeCommand(); // uart debug command
if(!pinRead_Plug)
{
putstr( "\r\n READ!" );
ClrLed_OK();
ClrLed_WRITING();
SetLed_READING();
usrLoadVariableFromEEPROM();
g_bEEpromSaveDone=1;
SetLed_OK();
}
else if(!pinWrite_Plug)
{
putstr( "\r\n WRITE!" );
ClrLed_OK();
ClrLed_READING();
SetLed_WRITING();
usrInitVariableFromEEPROM();
g_bEEpromSaveDone=1;
SetLed_OK();
}
else if(!pinReset_Plug)
{
putstr( "\r\n RESET!" );
SetLed_OK();
SetLed_READING();
SetLed_WRITING();
}
/*
// stop main loop for debug (Uart Command Test Command 0x51)
if (g_bDebugProgStopFlag)
continue;
SecondTick();
if (g_b16msTickFlag)
{
irPolling();
irDecodeNumKey(); // ir decode number key
keyDetectHandler(); // detect key handler
g_b16msTickFlag = 0;
}
irDecodeCommand(); // ir decode command
#if IR_CODE_DEBUG_EN
irDebugHandler();
#endif*/
} // while loop
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -