Skip to content

Commit 5495e24

Browse files
authored
Merge pull request #3917 from TomoYamanaka/master
Fix mistake register setting in serial_format()
2 parents ae10ca8 + 34d033a commit 5495e24

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

targets/TARGET_RENESAS/TARGET_RZ_A1H/serial_api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,11 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
398398
break;
399399
}
400400

401-
obj->serial.uart->SCSMR = data_bits << 6
402-
| parity_enable << 5
403-
| parity_select << 4
404-
| stop_bits << 3;
401+
obj->serial.uart->SCSMR = (obj->serial.uart->SCSMR & ~0x0078)
402+
| (data_bits << 6)
403+
| (parity_enable << 5)
404+
| (parity_select << 4)
405+
| (stop_bits << 3);
405406
}
406407

407408
/******************************************************************************

0 commit comments

Comments
 (0)