main.c
来自「Embedded C 这本书的范例光碟程式」· C语言 代码 · 共 57 行
C
57 行
/*------------------------------------------------------------------*-
Main.c (v1.00)
------------------------------------------------------------------
Simple intruder alarm system.
COPYRIGHT
---------
This code is associated with the book:
EMBEDDED C by Michael J. Pont
[Pearson Education, 2002: ISBN: 0-201-79523-X].
This code is copyright (c) 2001 by Michael J. Pont.
See book for copyright details and other information.
-*------------------------------------------------------------------*/
#include "Main.H"
#include "Port.H"
#include "Simple_EOS.H"
#include "PC_O_T1.h"
#include "Keypad.h"
#include "Intruder.h"
/* ............................................................... */
void main(void)
{
// Set baud rate to 9600
PC_LINK_O_Init_T1(9600);
// Prepare the keypad
KEYPAD_Init();
// Prepare the intruder alarm
INTRUDER_Init();
// Set up simple EOS (5ms tick)
sEOS_Init_Timer2(5);
while(1) // Super Loop
{
sEOS_Go_To_Sleep(); // Enter idle mode to save power
}
}
/*------------------------------------------------------------------*-
---- END OF FILE -------------------------------------------------
-*------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?