IntelFrameworkModulePkg IsaSerialDxe: Update algorithm to calculate Divisor

To align the way in MdeModulePkg SerialPortLib and PciSioSerialDxe driver,
Divisor is added by one when the reminder is more than half (16 * BaudRate).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Liming Gao 2018-04-12 21:38:37 +08:00
parent 9e508f3acc
commit 104bbee55e
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Serial driver for standard UARTS on an ISA bus. Serial driver for standard UARTS on an ISA bus.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1397,7 +1397,7 @@ IsaSerialSetAttributes (
((UINT32) BaudRate * 16), ((UINT32) BaudRate * 16),
&Remained &Remained
); );
if (Remained != 0) { if (Remained >= ((UINT32) BaudRate * 8)) {
Divisor += 1; Divisor += 1;
} }