/* Used to program the machine timer compare register. */\r
uint64_t ullNextTime = 0ULL;\r
const uint64_t *pullNextTime = &ullNextTime;\r
-const size_t uxTimerIncrementsForOneTick = ( size_t ) ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ); /* Assumes increment won't go over 32-bits. */\r
-volatile uint64_t * const pullMachineTimerCompareRegisterBase = ( volatile uint64_t * const ) ( configCLINT_BASE_ADDRESS + 0x4000 );\r
-volatile uint64_t * pullMachineTimerCompareRegister = 0;\r
+const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) / ( configTICK_RATE_HZ ) ); /* Assumes increment won't go over 32-bits. */\r
+uint32_t const ullMachineTimerCompareRegisterBase = ( uint64_t const ) ( ( configCLINT_BASE_ADDRESS ) + 0x4000 );\r
+volatile uint64_t * pullMachineTimerCompareRegister = NULL;\r
\r
/* Set configCHECK_FOR_STACK_OVERFLOW to 3 to add ISR stack checking to task\r
stack checking. A problem in the ISR stack will trigger an assert, not call the\r
uint32_t ulCurrentTimeHigh, ulCurrentTimeLow;\r
volatile uint32_t * const pulTimeHigh = ( volatile uint32_t * const ) ( configCLINT_BASE_ADDRESS + 0xBFFC );\r
volatile uint32_t * const pulTimeLow = ( volatile uint32_t * const ) ( configCLINT_BASE_ADDRESS + 0xBFF8 );\r
- volatile uint32_t ulHartId = 0;\r
+ volatile uint32_t ulHartId;\r
\r
__asm volatile( "csrr %0, mhartid" : "=r"( ulHartId ) );\r
- pullMachineTimerCompareRegister = &( pullMachineTimerCompareRegisterBase[ ulHartId ] );\r
+ pullMachineTimerCompareRegister = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase + ( ulHartId * sizeof( uint64_t ) ) );\r
\r
do\r
{\r