Skip to content

Commit e89ce4f

Browse files
authored
Merge pull request #11816 from d-kato/rza1_fix_non_os
Fix failure of building non-RTOS for GR-PEACH, GR-LYCHEE and VK-RZ/A1H
2 parents 9b3731a + 4fbb87d commit e89ce4f

File tree

4 files changed

+32
-31
lines changed

4 files changed

+32
-31
lines changed

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,25 @@
2222
* limitations under the License.
2323
*/
2424

25-
#ifdef MBED_CONF_RTOS_PRESENT
26-
27-
#include "os_tick.h"
2825
#include "irq_ctrl.h"
2926
#include "cmsis.h"
3027
#include "mbed_drv_cfg.h"
3128

29+
// Define OS Timer channel and interrupt number
30+
#define OSTM (OSTM0)
31+
#define OSTM_IRQn ((IRQn_ID_t)OSTMI0TINT_IRQn)
32+
33+
#ifdef MBED_CONF_RTOS_PRESENT
34+
#include "os_tick.h"
3235

3336
// Define OS TImer interrupt priority
3437
#ifndef OSTM_IRQ_PRIORITY
3538
#define OSTM_IRQ_PRIORITY 0xFFU
3639
#endif
3740

38-
// Define OS Timer channel and interrupt number
39-
#define OSTM (OSTM0)
40-
#define OSTM_IRQn ((IRQn_ID_t)OSTMI0TINT_IRQn)
41-
42-
4341
static uint32_t OSTM_Clock; // Timer tick frequency
4442
static uint8_t OSTM_PendIRQ; // Timer interrupt pending flag
4543

46-
4744
// Setup OS Tick.
4845
int32_t OS_Tick_Setup (uint32_t freq, IRQHandler_t handler)
4946
{
@@ -190,10 +187,10 @@ uint32_t OS_Tick_GetOverflow (void)
190187
{
191188
return (IRQ_GetPending(OSTM_IRQn));
192189
}
190+
#endif
193191

194192
// Get Cortex-A9 OS Timer interrupt number
195193
IRQn_ID_t mbed_get_a9_tick_irqn(){
196194
return OSTM_IRQn;
197195
}
198-
#endif
199196

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,25 @@
2222
* limitations under the License.
2323
*/
2424

25-
#ifdef MBED_CONF_RTOS_PRESENT
26-
27-
#include "os_tick.h"
2825
#include "irq_ctrl.h"
2926
#include "cmsis.h"
3027
#include "mbed_drv_cfg.h"
3128

29+
// Define OS Timer channel and interrupt number
30+
#define OSTM (OSTM0)
31+
#define OSTM_IRQn ((IRQn_ID_t)OSTMI0TINT_IRQn)
32+
33+
#ifdef MBED_CONF_RTOS_PRESENT
34+
#include "os_tick.h"
3235

3336
// Define OS TImer interrupt priority
3437
#ifndef OSTM_IRQ_PRIORITY
3538
#define OSTM_IRQ_PRIORITY 0xFFU
3639
#endif
3740

38-
// Define OS Timer channel and interrupt number
39-
#define OSTM (OSTM0)
40-
#define OSTM_IRQn ((IRQn_ID_t)OSTMI0TINT_IRQn)
41-
42-
4341
static uint32_t OSTM_Clock; // Timer tick frequency
4442
static uint8_t OSTM_PendIRQ; // Timer interrupt pending flag
4543

46-
4744
// Setup OS Tick.
4845
int32_t OS_Tick_Setup (uint32_t freq, IRQHandler_t handler)
4946
{
@@ -190,10 +187,10 @@ uint32_t OS_Tick_GetOverflow (void)
190187
{
191188
return (IRQ_GetPending(OSTM_IRQn));
192189
}
190+
#endif
193191

194192
// Get Cortex-A9 OS Timer interrupt number
195193
IRQn_ID_t mbed_get_a9_tick_irqn(){
196194
return OSTM_IRQn;
197195
}
198-
#endif
199196

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,25 @@
2222
* limitations under the License.
2323
*/
2424

25-
#ifdef MBED_CONF_RTOS_PRESENT
26-
27-
#include "os_tick.h"
2825
#include "irq_ctrl.h"
2926
#include "cmsis.h"
3027
#include "mbed_drv_cfg.h"
3128

29+
// Define OS Timer channel and interrupt number
30+
#define OSTM (OSTM0)
31+
#define OSTM_IRQn ((IRQn_ID_t)OSTMI0TINT_IRQn)
32+
33+
#ifdef MBED_CONF_RTOS_PRESENT
34+
#include "os_tick.h"
3235

3336
// Define OS TImer interrupt priority
3437
#ifndef OSTM_IRQ_PRIORITY
3538
#define OSTM_IRQ_PRIORITY 0xFFU
3639
#endif
3740

38-
// Define OS Timer channel and interrupt number
39-
#define OSTM (OSTM0)
40-
#define OSTM_IRQn ((IRQn_ID_t)OSTMI0TINT_IRQn)
41-
42-
4341
static uint32_t OSTM_Clock; // Timer tick frequency
4442
static uint8_t OSTM_PendIRQ; // Timer interrupt pending flag
4543

46-
4744
// Setup OS Tick.
4845
int32_t OS_Tick_Setup (uint32_t freq, IRQHandler_t handler)
4946
{
@@ -190,11 +187,10 @@ uint32_t OS_Tick_GetOverflow (void)
190187
{
191188
return (IRQ_GetPending(OSTM_IRQn));
192189
}
190+
#endif
193191

194192
// Get Cortex-A9 OS Timer interrupt number
195193
IRQn_ID_t mbed_get_a9_tick_irqn(){
196194
return OSTM_IRQn;
197195
}
198196

199-
#endif
200-

targets/TARGET_RENESAS/TARGET_RZ_A1XX/sleep.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ void hal_deepsleep(void) {
128128
wk_CPGSTBCR13 = CPGSTBCR13;
129129
#endif
130130

131+
/* Waits for the serial transmission to complete */
132+
const struct st_scif *SCIF[SCIF_COUNT] = SCIF_ADDRESS_LIST;
133+
134+
for (int uart = 0; uart < SCIF_COUNT; uart++) {
135+
if ((wk_CPGSTBCR4 & (1 << (7 - uart))) == 0) { // Is the power turned on?
136+
if ((SCIF[uart]->SCSCR & 0x00A0) == 0x00A0) { // Is transmission enabled? (TE = 1, TIE = 1)
137+
while ((SCIF[uart]->SCFSR & 0x0040) == 0); // Waits for the transmission to complete (TEND = 1)
138+
}
139+
}
140+
}
141+
131142
/* MTU2 (for low power ticker) */
132143
CPGSTBCR3 |= ~(CPG_STBCR3_BIT_MSTP33);
133144
dummy_8 = CPGSTBCR3;

0 commit comments

Comments
 (0)