平车主控板(运维板)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

93 lines
2.3 KiB

/*****************************************************************************
* uart.h: Header file for NXP LPC17xx Family Microprocessors
*
* Copyright(C) 2017,SensorControl
* All rights reserved.
*
* History
* 2009.05.27 ver 1.00 Prelimnary version, first Release
*2017.01.10 ver 1.10 rename tick.h tick.c
****************************************************************************************/
#include "tick.h"
//#include "../bsp/weather.h"
//#include "../bsp/bsp_led.h"
struct _s_nos_tick_ s_nos_tick;
/*********************************************************************************************************
* Function Name: timer0Isr
* Description: TIMER0 中断处�函数
* Input: æ—?
* Output: æ—?
* Return: æ—?
*********************************************************************************************************/
void L1_tick_init(void)
{
s_nos_tick.n_stamp = 0;
s_nos_tick.t1s_heatbeart= 0;
s_nos_tick.flag_50ms = 0;
s_nos_tick.t_5ms = 0;
//s_nos_tick.t_50ms = 0;
s_nos_tick.t_100ms = 0;
s_nos_tick.t_1s = 0;
s_nos_tick.flag_1s = 0;
s_nos_tick.t_n = 0;
}
#if 0
// 11.0592 15us --- 140us
void L1_tick_tick (void)
{
if(s_nos_tick.flag_50ms == 1)
{
s_nos_tick.flag_50ms = 0;
}
else
return ;
//s_nos_tick.t_n++;
if (s_nos_tick.t_n >= D_TIMER0_50MS_COUNT)// 5500--- 100 10s--556
{
s_nos_tick.t_50ms ++;//D_led_D1_REV(); 20160522 验�
if(s_nos_tick.t_50ms % 2 == 0)
{
s_nos_tick.t_100ms ++;
}
if(s_nos_tick.t_50ms%D_TIMER0_1S_COUNT == 0)
{
s_nos_tick.t_1s ++;//
s_nos_tick.flag_1s = 1;
s_nos_tick.t1s_heatbeart = 1;
}
s_nos_tick.t_n = 0;
}
}
#else
void L1_tick_tick (void)
{
/// 65535*65535 /3600/24/365=139nian/s=1.39nian/10ms
///相当于1.39年�t_10ms 溢出,对于电池供电的系统而言 完全�以满足
// 4,294,836,225 = 65535*65535 ;3600*24*60*60 = 31,536,000ç§’/å¹´
s_nos_tick.tp_count++;
//s_nos_tick.t_50ms ++;//D_led_D1_REV(); 20160522验�
s_nos_tick.t_5ms ++;
if(s_nos_tick.t_5ms % D_TIMER0_1S_COUNT == 0)
{
// 65535*65535/24/60/60/356/10 =12.7å¹´
s_nos_tick.t_1s ++;
s_nos_tick.flag_1s2 = 1;
s_nos_tick.t1s_heatbeart = 1;
}
//<<<<<<<<<<<<<<<<<<<<<<
}
#endif