sys_event.c

来自「单相多功能代码,计量芯片采用ADE7737做为计量,SPI通讯,仅供参考,不得用」· C语言 代码 · 共 74 行

C
74
字号
#include "sys_event.h"
#include "pub_func.h"
#include "sys_time.h"
#include "protocol.h"
#include "uart.h"
#include "measure.h"
#include "i2c.h"
#include "powersupply.h"

_sys_evt_word_t  _sys_event;

/* add a new event to word
*/
void _sys_evt_add(int evt)
{
    _disable_interrupt();
    _sys_event |= evt;
    _enable_interrupt();
}

/* del an event
*/
void _sys_evt_del(int evt)
{
    _disable_interrupt();
    _sys_event &= ~evt;
    _enable_interrupt();
}

/* communication
*/
void _on_comm(void)
{
    comm_proc();
}

/* routine job on days
*/
void _on_days(void)
{
    ZoneAttributeDetect();
}

void _on_hours(void)
{
    
}

/* routine job on minutes
*/
void _on_minutes(void)
{
    ExesAttributeDetect();
    VoltageDetect();
    if((_sys_time.minutes%5)==0)
    {
        GetTemperature();
    }
}

/* routine job on seconds
*/
void _on_seconds(void)
{
    second_up();
}

/* key down
*/
void _on_key_down(void)
{
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?