123456789101112131415161718192021222324252627282930313233343536373839 |
- #include "drv_types.h"
- #include "hdmi_time.h"
- #include <linux/timer.h> // timer
- #include <linux/interrupt.h> /* in_interrupt() */
- #include <linux/delay.h>
- void HDMI_DelayMs(UINT32 x)
- {
- if(in_atomic())
- {
- mdelay(x);
- }
- else
- {
- msleep(x);
- }
- }
- void HDMI_DelayUs(UINT32 x)
- {
- udelay(x);
- }
- //------------------------------------------------------------------------------
- // Function: HDMI_GetSysTime
- // Description: Returns the current number of system ticks since we started (unit:1ms)
- // Parameters: None
- // Returns: the current number of system ticks since we started (unit:1ms)
- //------------------------------------------------------------------------------
- UINT32 HDMI_GetSysTime(void)
- {
- struct timespec now;
- getnstimeofday(&now);
- return(now.tv_sec*1000) +(now.tv_nsec/1000000); //transfer to minisecond
- }
|