main.c
来自「时间触发嵌入式系统设计模式:使用8051系列微控制器开发可靠应用」· C语言 代码 · 共 58 行
C
58 行
/*------------------------------------------------------------------*-
Main.C (v1.00)
------------------------------------------------------------------
Framework for a central heating system using 'Super Loop'.
*** Assumes external '1232' watchdog timer on P1^0 ***
COPYRIGHT
---------
This code is from the book:
PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont
[Pearson Education, 2001; ISBN: 0-201-33138-1].
This code is copyright (c) 2001 by Michael J. Pont.
See book for copyright details and other information.
-*------------------------------------------------------------------*/
#include "Cen_Heat.h"
#include "Dog_1232.h"
/*------------------------------------------------------------------*/
void main(void)
{
// Init the system
C_HEAT_Init();
// Watchdog automatically starts
while(1)
{
// Find out what temperature the user requires
// (via the user interface)
C_HEAT_Get_Required_Temperature();
// Find out what the current room temperature is
// (via temperature sensor)
C_HEAT_Get_Actual_Temperature();
// Adjust the gas burner, as required
C_HEAT_Control_Boiler();
// Feed the watchdog
WATCHDOG_Feed();
}
}
/*------------------------------------------------------------------*-
---- END OF FILE -------------------------------------------------
-*------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?