/***************************************************************************** * 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���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 ��֤ 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