Patch from Gunter Magin <magin@skil.camelot.de> where the type was

not large enough to support high baud rates.

  brg_spd[] is an array which stores the baud rates, for which one of the 4
  available BRG dividers has been set. The array is used for deciding if a
  BRG devider may be reused.

  > 1.  What baud_rate and divisor is causing this to fail?

  divisor is dependent on the system clock (Cpu_table.clock_speed), and gets
  calculated in m860_get_brg_cd.

  m860_get_brg_clk fails for any baudrates > (2^16-1), as those baudrates are
  truncated to 16 bit which is the size of a short. In fact, as it has been a
  short and not an unsigned short, it will fail at any baudrate >(2^15-1). In
  any case, it failed for my application, which required 250000 Baud.
This commit is contained in:
Joel Sherrill
2000-03-21 18:35:00 +00:00
parent abbf55b924
commit 05a346681d
2 changed files with 3 additions and 3 deletions

View File

@@ -99,7 +99,7 @@ m821_get_brg_cd (int baud)
/* at any time since the OS started. It needs to be fixed. FIXME */
unsigned char m821_get_brg_clk(int baud)
{
static short brg_spd[4];
static int brg_spd[4];
static char brg_used[4];
int i;

View File

@@ -102,8 +102,8 @@ m860_get_brg_cd (int baud)
/* at any time since the OS started. It needs to be fixed. FIXME */
unsigned char m860_get_brg_clk(int baud)
{
static short brg_spd[4];
static char brg_used[4];
static int brg_spd[4];
static char brg_used[4];
int i;
/* first try to find a BRG that is already at the right speed */