Skip to content

Commit 1e2e14e

Browse files
committed
Implement SystemcoreClock
We implemented SystemcoreClock which is defined in CMSIS.
1 parent bddce7c commit 1e2e14e

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

hal/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/system_MBRZA1H.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void FPUEnable(void);
5151

5252
uint32_t IRQNestLevel;
5353
unsigned char seen_id0_active = 0; // single byte to hold a flag used in the workaround for GIC errata 733075
54+
uint32_t SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK; /*!< System Clock Frequency (Core Clock) */
5455

5556

5657
/**
@@ -198,6 +199,20 @@ uint32_t InterruptHandlerUnregister (IRQn_Type irq)
198199
}
199200
}
200201

202+
/**
203+
* Update SystemCoreClock variable
204+
*
205+
* @param none
206+
* @return none
207+
*
208+
* @brief Updates the SystemCoreClock with current core Clock.
209+
*/
210+
void SystemCoreClockUpdate (void)
211+
{
212+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK;
213+
}
214+
215+
201216
/**
202217
* Initialize the system
203218
*

hal/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/system_MBRZA1H.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
extern "C" {
4444
#endif
4545

46+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
47+
4648
typedef void(*IRQHandler)();
4749
uint32_t InterruptHandlerRegister(IRQn_Type, IRQHandler);
4850
uint32_t InterruptHandlerUnregister(IRQn_Type);

hal/targets/cmsis/TARGET_RENESAS/TARGET_VK_RZ_A1H/system_VKRZA1H.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void FPUEnable(void);
5151

5252
uint32_t IRQNestLevel;
5353
unsigned char seen_id0_active = 0; // single byte to hold a flag used in the workaround for GIC errata 733075
54+
uint32_t SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK; /*!< System Clock Frequency (Core Clock) */
5455

5556

5657
/**
@@ -198,6 +199,20 @@ uint32_t InterruptHandlerUnregister (IRQn_Type irq)
198199
}
199200
}
200201

202+
/**
203+
* Update SystemCoreClock variable
204+
*
205+
* @param none
206+
* @return none
207+
*
208+
* @brief Updates the SystemCoreClock with current core Clock.
209+
*/
210+
void SystemCoreClockUpdate (void)
211+
{
212+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK;
213+
}
214+
215+
201216
/**
202217
* Initialize the system
203218
*

hal/targets/cmsis/TARGET_RENESAS/TARGET_VK_RZ_A1H/system_VKRZA1H.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
extern "C" {
4444
#endif
4545

46+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
47+
4648
typedef void(*IRQHandler)();
4749
uint32_t InterruptHandlerRegister(IRQn_Type, IRQHandler);
4850
uint32_t InterruptHandlerUnregister(IRQn_Type);

0 commit comments

Comments
 (0)