15 #if defined (FSL_RTOS_MQX)
16 extern hwtimer_t systimer;
20 doubleword = (((doubleword & 0xaaaaaaaa) >> 1) | ((doubleword & 0x55555555) << 1));
21 doubleword = (((doubleword & 0xcccccccc) >> 2) | ((doubleword & 0x33333333) << 2));
22 doubleword = (((doubleword & 0xf0f0f0f0) >> 4) | ((doubleword & 0x0f0f0f0f) << 4));
23 doubleword = (((doubleword & 0xff00ff00) >> 8) | ((doubleword & 0x00ff00ff) << 8));
24 return (( doubleword >> 16) | (doubleword << 16));
32 if (0 == doubleword)
return 32;
34 if (0 == (doubleword & 0xFFFF0000) ){ index += 16; doubleword <<= 16;}
35 if (0 == (doubleword & 0xFF000000) ){ index += 8; doubleword <<= 8;}
36 if (0 == (doubleword & 0xF0000000) ){ index += 4; doubleword <<= 4;}
37 if (0 == (doubleword & 0xC0000000) ){ index += 2, doubleword <<= 2;}
38 if (0 == (doubleword & 0x80000000) ){ index += 1, doubleword <<= 1;}
44 if( 0 == doubleword)
return 0;
45 if (0 == (doubleword & 0x0000FFFF) ){ index += 16; doubleword >>= 16;}
46 if (0 == (doubleword & 0x000000FF) ){ index += 8; doubleword >>= 8;}
47 if (0 == (doubleword & 0x0000000F) ){ index += 4; doubleword >>= 4;}
48 if (0 == (doubleword & 0x00000003) ){ index += 2, doubleword >>= 2;}
49 if (0 == (doubleword & 0x00000001) ){ index += 1, doubleword >>= 1;}
58 #if defined (FSL_RTOS_MQX)
59 uint64 time_in_increments_of_overflow_ticks_usec64;
60 uint32 time_since_last_overflow_usec;
66 static float nsec_per_hw_tick = 0;
68 if (nsec_per_hw_tick == 0)
69 nsec_per_hw_tick = (float)((
float)1 / (float)systimer.clockFreq);
73 HWTIMER_SYS_GetTime(&systimer, &time);
76 usec_per_tick = (
uint64)1000000 * systimer.divider / (
uint64)systimer.clockFreq;
78 time_in_increments_of_overflow_ticks_usec64 = (
uint64)time.ticks * (
uint64)usec_per_tick;
81 time_since_last_overflow_usec = (
uint32)( ( time.subTicks * nsec_per_hw_tick) * 1000000);
84 time_usec = (
uint32)((
uint64)time_in_increments_of_overflow_ticks_usec64 + (
uint64)time_since_last_overflow_usec);
86 #if defined (FSL_RTOS_FREE_RTOS)
87 uint64 time_in_increments_of_overflow_ticks_usec64;
88 uint32 time_since_last_overflow_usec;
94 static float nsec_per_hw_tick = 0;
95 if (nsec_per_hw_tick == 0)
97 nsec_per_hw_tick = (float)((
float)1 / (float)configSYSTICK_CLOCK_HZ);
103 Ticks = xTaskGetTickCountFromISR();
106 usec_per_tick = (
uint64)1000000 / configTICK_RATE_HZ;
108 time_in_increments_of_overflow_ticks_usec64 = (
uint64)Ticks * (
uint64)usec_per_tick;
111 time_since_last_overflow_usec = (
uint32)( ( subTicks * nsec_per_hw_tick) * 1000000);
114 time_usec = (
uint32)((
uint64)time_in_increments_of_overflow_ticks_usec64 + (
uint64)time_since_last_overflow_usec);
133 *pDestination++ = *pSource++;
147 __asm
volatile (
"rev %0, %1" :
"=r" (ret):
"r" (n));
160 __asm
volatile (
"rev16 %0, %1" :
"=r" (ret):
"r" (n));
uint32 isf_time_util_get_usec(void)
This API returns the time in microseconds.
unsigned long long uint64
This defines uint64 as unsigned long long.
uint16 isf_swap2byte(uint16 n)
2 byte swapping method
uint32 ff1(uint32 doubleword)
find first-in.
uint32 bitrev(uint32 doubleword)
This function reverse the bits of a double word.
uint32 ff1_lsb(uint32 doubleword)
find first-in form LSB.
The isf_util.h file contains the utility method declarations and macros.
uint32 isf_swap4byte(uint32 n)
4 byte swapping method
Main ISF header file. Contains code common to all ISF components.
unsigned short int uint16
void isf_mem_copy(void *src, void *dest, uint32 size)
memory copy