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.
51 lines
1.5 KiB
51 lines
1.5 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"
|
|
|
|
struct _s_nos_tick_ s_nos_tick;
|
|
|
|
/*********************************************************************************************************
|
|
* Function Name: timer0Isr
|
|
* Description: TIMER0 䏿–处ç�†å‡½æ•°
|
|
* Input: æ—?
|
|
* Output: æ—?
|
|
* Return: æ—?
|
|
*********************************************************************************************************/
|
|
void L1_tick_init(void)
|
|
{
|
|
s_nos_tick.jiffies = 0;
|
|
s_nos_tick.t_1s = 0;
|
|
s_nos_tick.t1s_heartbeat= 0;
|
|
s_nos_tick.t_50ms = 0;
|
|
}
|
|
|
|
|
|
//JIFFIES回绕问题没有解决 �� linux time_after�定义
|
|
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.t_50ms ++;//D_led_D1_REV(); 20160522验�
|
|
s_nos_tick.jiffies++;
|
|
//s_nos_tick.t_10ms = 1;
|
|
if(s_nos_tick.jiffies % HZ == 0) ///HZ = 10ms
|
|
{
|
|
// 65535*65535/24/60/60/356/10 =12.7å¹´
|
|
s_nos_tick.t_1s ++;
|
|
s_nos_tick.t1s_heartbeat = 1;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|