Skip to content

Commit dacce18

Browse files
authored
Use UBaseType_t for ullMachineTimerCompareRegisterBase (FreeRTOS#1258)
Use architecture-dependent UBaseType_t instead of fixed type for ullMachineTimerCompareRegisterBase. This type is defined to uint32_t or uint64_t based on XLEN, resolving warnings on 32-bit platforms. Reported by landretk@ on the PR FreeRTOS#1176. Signed-off-by: Gaurav Aggarwal <[email protected]>
1 parent 64fd929 commit dacce18

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

portable/GCC/RISC-V/port.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void vPortSetupTimerInterrupt( void ) __attribute__( ( weak ) );
9090
uint64_t ullNextTime = 0ULL;
9191
const uint64_t * pullNextTime = &ullNextTime;
9292
const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) / ( configTICK_RATE_HZ ) ); /* Assumes increment won't go over 32-bits. */
93-
uint64_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
93+
UBaseType_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
9494
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
9595

9696
/* Holds the critical nesting value - deliberately non-zero at start up to

portable/IAR/RISC-V/port.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void vPortSetupTimerInterrupt( void ) __attribute__( ( weak ) );
9898
uint64_t ullNextTime = 0ULL;
9999
const uint64_t * pullNextTime = &ullNextTime;
100100
const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) / ( configTICK_RATE_HZ ) ); /* Assumes increment won't go over 32-bits. */
101-
uint64_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
101+
UBaseType_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
102102
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
103103

104104
/* Holds the critical nesting value - deliberately non-zero at start up to

0 commit comments

Comments
 (0)