平车主控板(运维板)
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.
 
 
 
 
 

92 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_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锟斤拷锟絫_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 锟斤拷证
if(s_nos_tick.t_50ms % D_TIMER0_1S_COUNT == 0)
{
// 65535*65535/24/60/60/356/10 =12.7锟斤拷
s_nos_tick.t_1s ++;//// 65535*65535/24/60/60/356/10 =12.7锟斤拷
s_nos_tick.flag_1s2 = 1;
s_nos_tick.t1s_heatbeart = 1;
}
//<<<<<<<<<<<<<<<<<<<<<<
}
#endif