Skip to content

Commit

Permalink
IntelFrameworkModulePkg IsaSerialDxe: Update algorithm to calculate D…
Browse files Browse the repository at this point in the history
…ivisor

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>
  • Loading branch information
lgao4 committed Apr 18, 2018
1 parent 9e508f3 commit 104bbee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
@@ -1,7 +1,7 @@
/** @file
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
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
Expand Down Expand Up @@ -1397,7 +1397,7 @@ IsaSerialSetAttributes (
((UINT32) BaudRate * 16),
&Remained
);
if (Remained != 0) {
if (Remained >= ((UINT32) BaudRate * 8)) {
Divisor += 1;
}

Expand Down

0 comments on commit 104bbee

Please sign in to comment.