/** Type of time expressed in ticks of the hardware high-precision timer */
typedef uint32_t hptime_t;
+ #define SIZEOF_HPTIME_T 4
INLINE void timer_hw_irq(void)
{
/// Type of time expressed in ticks of the hardware high-precision timer
typedef uint8_t hptime_t;
+ #define SIZEOF_HPTIME_T 1
INLINE hptime_t timer_hw_hpread(void)
{
/// Type of time expressed in ticks of the hardware high precision timer
typedef uint16_t hptime_t;
+ #define SIZEOF_HPTIME_T 2
INLINE hptime_t timer_hw_hpread(void)
{
/// Type of time expressed in ticks of the hardware high precision timer
typedef uint8_t hptime_t;
+ #define SIZEOF_HPTIME_T 1
INLINE hptime_t timer_hw_hpread(void)
{
/// Type of time expressed in ticks of the hardware high precision timer
typedef uint16_t hptime_t;
+ #define SIZEOF_HPTIME_T 2
INLINE hptime_t timer_hw_hpread(void)
{
#include CPU_HEADER(timer)
#endif
+STATIC_ASSERT(sizeof(hptime_t) == SIZEOF_HPTIME_T);
+
#include "cfg/cfg_timer.h"
#include <cfg/debug.h>
#include <cfg/compiler.h>
kprintf("ticks_to_us(10000) = %lu\n", (unsigned long)ticks_to_us(10000));
kprintf("\n");
kprintf("hptime_to_us(100) = %lu\n", (unsigned long)hptime_to_us(100));
- kprintf("hptime_to_us(10000)= %lu\n", (unsigned long)hptime_to_us(10000));
+ #if (SIZEOF_HPTIME_T > 1)
+ kprintf("hptime_to_us(10000)= %lu\n", (unsigned long)hptime_to_us(10000));
+ #endif
kprintf("us_to_hptime(100) = %lu\n", (unsigned long)us_to_hptime(100));
kprintf("us_to_hptime(10000)= %lu\n", (unsigned long)us_to_hptime(10000));
}
/// Type of time expressed in ticks of the hardware high-precision timer.
typedef unsigned int hptime_t;
+#define SIZEOF_HPTIME_T 4
/// Frequency of the hardware high-precision timer.
#define TIMER_HW_HPTICKS_PER_SEC 1000
/** our type for "high precision absolute time" */
typedef __int64 hptime_t;
+ #define SIZEOF_HPTIME_T 8
#define HPTIME_TICKS_PER_SECOND (10000000I64)
#define HPTIME_TICKS_PER_MILLISEC (10000I64)
/** Type for "high precision absolute time". */
typedef int64_t hptime_t;
+ #define SIZEOF_HPTIME_T 8
#define HPTIME_TICKS_PER_SECOND (1000000LL)
#define HPTIME_TICKS_PER_MILLISEC (1000LL)