Skip to content

Commit 1cb298a

Browse files
author
Cruz Monrreal
authored
Merge pull request #7151 from mrcoulter45/issue6543
Fixes for RZ_A1H issue 6543
2 parents ed9a1f1 + 3d3e890 commit 1cb298a

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

rtos/TARGET_CORTEX/SysTimer.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@
2525

2626
#include "hal/lp_ticker_api.h"
2727
#include "mbed_critical.h"
28+
#if defined(TARGET_CORTEX_A)
29+
#include "rtx_core_ca.h"
30+
#else//Cortex-M
2831
#include "rtx_core_cm.h"
32+
#endif
2933
extern "C" {
3034
#include "rtx_lib.h"
35+
#if defined(TARGET_CORTEX_A)
36+
#include "irq_ctrl.h"
37+
#endif
3138
}
3239

3340
#if (defined(NO_SYSTICK))
@@ -58,7 +65,7 @@ SysTimer::SysTimer(const ticker_data_t *data) :
5865

5966
void SysTimer::setup_irq()
6067
{
61-
#if (defined(NO_SYSTICK))
68+
#if (defined(NO_SYSTICK) && !defined (TARGET_CORTEX_A))
6269
NVIC_SetVector(mbed_get_m0_tick_irqn(), (uint32_t)SysTick_Handler);
6370
NVIC_SetPriority(mbed_get_m0_tick_irqn(), 0xFF); /* RTOS requires lowest priority */
6471
NVIC_EnableIRQ(mbed_get_m0_tick_irqn());
@@ -148,6 +155,8 @@ void SysTimer::_set_irq_pending()
148155

149156
#if (defined(NO_SYSTICK))
150157
NVIC_SetPendingIRQ(mbed_get_m0_tick_irqn());
158+
#elif (TARGET_CORTEX_A)
159+
IRQ_SetPending(mbed_get_a9_tick_irqn());
151160
#else
152161
SCB->ICSR = SCB_ICSR_PENDSTSET_Msk;
153162
#endif

rtos/TARGET_CORTEX/rtx5/Include/os_tick.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#define OS_TICK_H
2727

2828
#include <stdint.h>
29+
#if defined(TARGET_CORTEX_A)
30+
#include "irq_ctrl.h"
31+
#endif
2932

3033
/// IRQ Handler.
3134
#ifndef IRQHANDLER_T
@@ -68,4 +71,9 @@ uint32_t OS_Tick_GetCount (void);
6871
/// \return OS Tick overflow status (1 - overflow, 0 - no overflow).
6972
uint32_t OS_Tick_GetOverflow (void);
7073

74+
/// Get Cortex-A9 OS Timer interrupt number
75+
/// \returns Cortex-A9 OS Timer interrupt number (134)
76+
#if defined(TARGET_CORTEX_A)
77+
IRQn_ID_t mbed_get_a9_tick_irqn(void);
78+
#endif
7179
#endif /* OS_TICK_H */

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/os_tick_ostm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,9 @@ uint32_t OS_Tick_GetOverflow (void)
193193
return (IRQ_GetPending(OSTM_IRQn));
194194
}
195195

196+
// Get Cortex-A9 OS Timer interrupt number
197+
IRQn_ID_t mbed_get_a9_tick_irqn(){
198+
return OSTMI0TINT_IRQn;
199+
}
196200
#endif
197201

0 commit comments

Comments
 (0)