File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
targets/TARGET_RENESAS/TARGET_RZ_A1XX Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -592,7 +592,6 @@ void serial_putc(serial_t *obj, int c) {
592
592
while (!serial_writable (obj ));
593
593
obj -> serial .uart -> SCFTDR = c ;
594
594
serial_put_done (obj );
595
- while ((obj -> serial .uart -> SCFSR & 0x40 ) == 0 ); // Wait TEND = 1
596
595
}
597
596
598
597
static void serial_put_done (serial_t * obj )
Original file line number Diff line number Diff line change @@ -128,6 +128,17 @@ void hal_deepsleep(void) {
128
128
wk_CPGSTBCR13 = CPGSTBCR13 ;
129
129
#endif
130
130
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
+
131
142
/* MTU2 (for low power ticker) */
132
143
CPGSTBCR3 |= ~(CPG_STBCR3_BIT_MSTP33 );
133
144
dummy_8 = CPGSTBCR3 ;
You can’t perform that action at this time.
0 commit comments