Convert sequoia led's to getmicrotime() instead
of a hard coded reference to time. This is necessary to support timecountering. Tested by pooka@
This commit is contained in:
parent
01beb29b30
commit
39d7c2b083
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sequoia.c,v 1.6 2006/03/07 19:15:50 christos Exp $ */
|
||||
/* $NetBSD: sequoia.c,v 1.7 2006/09/12 17:50:53 gdamore Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997
|
||||
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sequoia.c,v 1.6 2006/03/07 19:15:50 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sequoia.c,v 1.7 2006/09/12 17:50:53 gdamore Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -469,7 +469,7 @@ int scrGetData (void)
|
|||
|
||||
void ledNetActive (void)
|
||||
{
|
||||
ledLastActive = time;
|
||||
getmicrotime(&ledLastActive);
|
||||
}
|
||||
|
||||
void ledNetBlock (void)
|
||||
|
@ -491,15 +491,17 @@ void ledPanic (void)
|
|||
static void ledTimeout(void * arg)
|
||||
{
|
||||
int timeSpan; /* in usec */
|
||||
|
||||
if(time.tv_sec == ledLastActive.tv_sec)
|
||||
struct timeval now;
|
||||
|
||||
getmicrotime(&now);
|
||||
if(now.tv_sec == ledLastActive.tv_sec)
|
||||
{
|
||||
timeSpan = time.tv_usec - ledLastActive.tv_usec;
|
||||
timeSpan = now.tv_usec - ledLastActive.tv_usec;
|
||||
}
|
||||
|
||||
else if (time.tv_sec - 10 < ledLastActive.tv_sec) /* stop rollover problems */
|
||||
else if (now.tv_sec - 10 < ledLastActive.tv_sec) /* stop rollover problems */
|
||||
{
|
||||
timeSpan = (1000000 + time.tv_usec) - ledLastActive.tv_usec;
|
||||
timeSpan = (1000000 + now.tv_usec) - ledLastActive.tv_usec;
|
||||
}
|
||||
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue