📄 main.h
字号:
/*
-02/22/2006: Petre M.
-this file contains declarations of variables used in main.c
*/
#include "ioADE7169F16.h"
#include "extern_declarations.h"
#include "power.h"
#include "i2c.h"
#include "EEPROM_locations.h"
#include "rtc.h"
#include "util.h"
#include "lcd.h"
//#include "ext_int.h"
#include "energy.h"
#include "setjmp.h"
#include "uart.h"
/*Low_Priority_Command[0]:
0
0
0=This bit is set to 1 when at the end of a
the month, at 0am, storage in the EEPROM of
the energies is ordered.
0=
0=
0=
0=
0=is set to 1 when the Alarm Interrupt is generated. It is cleared
when all the Low Priority Tasks have been executed
*/
__idata char Low_Priority_Command[1];
__idata char LCD_Command[1];
/*Command_Status[0]:
0
0
0
0=
0=
0=It manages visualization for 1 minute of a measurement different
from the default one. Is set to 1 when the decision to visualize
is taken and is cleared to 0 when 1 minute from the decision ends
0=a display operation defined in Command[2] and Command[3] is in
progress. When the transfer of LCD_buffer into LCD memory ends,
this flag is cleared together with the command.
0=this bit is set to 1 when the backup is executed the first time.
In this way, we avoid executing the backup operation more than
one time because IPSMF_bit.FVDC is set to 1 many times when the
voltage goes down
*/
__idata char Command_Status[1];
/*The state of the Energy Meter is composed of:
Active_Energy
Reactive Energy
Apparent Energy
*/
__idata struct Five_Bytes_struct Reactive_Energy, Apparent_Energy;
//this byte contains errors that may have verified during the execution of the program
/*xxxx
x
x
x=If an EEPROM Read operation went longer than a certain
timeout, then this bit is set to 1.
x=If an EEPROM Write operation went longer than a certain
timeout, then this bit is set to 1.
*/
__idata unsigned char Meter_Errors[1];
//Temporary is a buffer that can be used inside of any function.
__idata char Temporary[8], Temporary1[8];
__idata signed char LP_Task;
//this table contains Low Priority Tasks that are executed by a pointer in main.c
//Any new task should be added before Refresh_Watchdog function.
//This and End_Low_Priority_Tasks should always be the last tasks executed
#pragma constseg = "Data_in_Flash"
__code const int Table_LP_Func[]={(int)Battery_Alarm, (int)Midnight_Management,
(int) Monthly_Energy_Storage, (int)Decide_LCD_command, (int) Manage_Display,
(int) Display_to_LCD, (int) Refresh_Watchdog, (int) End_Low_Priority_Tasks};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -