📄 main.c
字号:
/*------------------------------------------------------------------*-
Main.C (v1.00)
------------------------------------------------------------------
A 'goat counting' program for the 8051 (re-structured version).
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 "Switch_wait.H"
#include "Display_count.H"
/* ---------------------------------------------------------------- */
void main(void)
{
tByte Switch_presses = 0;
// Init functions
SWITCH_Init();
DISPLAY_COUNT_Init();
while(1)
{
if (SWITCH_Get_Input(30) == SWITCH_PRESSED)
{
Switch_presses++;
}
DISPLAY_COUNT_Update(Switch_presses);
}
}
/*------------------------------------------------------------------*-
---- END OF FILE -------------------------------------------------
-*------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -