Skip to content

Commit 98ab21e

Browse files
committed
fix bug and optimize timer irq callback
enable high optimization
1 parent 32e93ad commit 98ab21e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

bsp/renesas/libraries/HAL_Drivers/config/rzt/timer_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extern "C"
1919
{
2020
#endif
2121

22-
#define PLCKD_PRESCALER_MAX_SELECT 8
22+
#define PLCKD_PRESCALER_MAX_SELECT 9
2323

2424
/* RSK-RZN2L: Frequency ratio: PCLKA:PCLKD = 1:N (N = 1/2/4/8/16/32/64) */
2525
#define PLCKD_PRESCALER_400M (BSP_PRV_PCLKGPTL_FREQ_400_MHZ)

bsp/renesas/libraries/HAL_Drivers/drv_hwtimer.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const rt_uint32_t PLCKD_FREQ_PRESCALER[PLCKD_PRESCALER_MAX_SELECT] =
3838
PLCKD_PRESCALER_3_75M,
3939
PLCKD_PRESCALER_1_875M,
4040
#elif defined(SOC_SERIES_R9A07G0)
41+
PLCKD_PRESCALER_400M,
42+
PLCKD_PRESCALER_200M,
4143
PLCKD_PRESCALER_100M,
4244
PLCKD_PRESCALER_50M,
4345
PLCKD_PRESCALER_25M,
@@ -184,8 +186,10 @@ static void timer_one_shot_check(void)
184186
#ifdef BSP_USING_TIM0
185187
void timer0_callback(timer_callback_args_t *p_args)
186188
{
189+
#if !defined(SOC_SERIES_R9A07G0)
187190
/* enter interrupt */
188191
rt_interrupt_enter();
192+
#endif
189193

190194
if (TIMER_EVENT_CYCLE_END == p_args->event)
191195
{
@@ -194,16 +198,20 @@ void timer0_callback(timer_callback_args_t *p_args)
194198
timer_one_shot_check();
195199
}
196200

201+
#if !defined(SOC_SERIES_R9A07G0)
197202
/* leave interrupt */
198203
rt_interrupt_leave();
204+
#endif
199205
}
200206
#endif
201207

202208
#ifdef BSP_USING_TIM1
203209
void timer1_callback(timer_callback_args_t *p_args)
204210
{
211+
#if !defined(SOC_SERIES_R9A07G0)
205212
/* enter interrupt */
206213
rt_interrupt_enter();
214+
#endif
207215

208216
if (TIMER_EVENT_CYCLE_END == p_args->event)
209217
{
@@ -212,8 +220,10 @@ void timer1_callback(timer_callback_args_t *p_args)
212220
timer_one_shot_check();
213221
}
214222

223+
#if !defined(SOC_SERIES_R9A07G0)
215224
/* leave interrupt */
216225
rt_interrupt_leave();
226+
#endif
217227
}
218228
#endif
219229

bsp/renesas/rzn2l_etherkit/rzn/fsp/src/bsp/cmsis/Device/RENESAS/Source/system.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ void bsp_loader_bss_init (void)
577577
void bsp_copy_multibyte (uintptr_t * src, uintptr_t * dst, uintptr_t bytesize)
578578
{
579579
uintptr_t i;
580-
uintptr_t cnt;
580+
volatile uintptr_t cnt;
581581

582582
uintptr_t src_mod;
583583
uint8_t * src_single_byte;
@@ -630,7 +630,7 @@ void bsp_copy_multibyte (uintptr_t * src, uintptr_t * dst, uintptr_t bytesize)
630630
void bsp_bss_init_multibyte (uintptr_t * src, uintptr_t bytesize)
631631
{
632632
uintptr_t i;
633-
uintptr_t cnt;
633+
volatile uintptr_t cnt;
634634
uintptr_t zero = 0;
635635

636636
uintptr_t src_mod;

0 commit comments

Comments
 (0)