This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: redboot set_comm_baud_rate question
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Jani Monoses <jani at iv dot ro>
- Cc: ecos-devel at sources dot redhat dot com,eCos Patches List <ecos-patches at ecos dot sourceware dot org>
- Date: Wed, 11 Feb 2004 01:25:28 +0000
- Subject: Re: redboot set_comm_baud_rate question
- References: <20040123170127.0a0ff5ca.jani@iv.ro>
Jani Monoses wrote:
Hi
I just want to make sure is the code below intended to be a retry
of setting of the baudrate if the first attempt fails or a conditional
setting of it if it's already at the requested value in which case it
should have been a GETBAUD operation instead of the first SETBAUD.
Definitely looks like a buglet to me. Fixed as per below.
Jifl
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.177
diff -u -5 -p -r1.177 ChangeLog
--- ChangeLog 4 Feb 2004 15:44:15 -0000 1.177
+++ ChangeLog 11 Feb 2004 01:25:07 -0000
@@ -1,5 +1,10 @@
+2004-02-11 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * src/main.c (set_comm_baud_rate): Get current rate with GETBAUD
+ not SETBAUD!
+
2004-02-04 Gary Thomas <gary@mlbassoc.com>
* cdl/redboot.cdl: Do not build with "common" interrupt stack
support. This can cause problems when running programs (via
the "go" command) as interrupts will corrupt RedBoot's stack.
Index: src/main.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.52
diff -u -5 -p -r1.52 main.c
--- src/main.c 18 Jan 2004 17:42:47 -0000 1.52
+++ src/main.c 11 Feb 2004 01:25:07 -0000
@@ -624,11 +624,11 @@ do_reset(int argc, char *argv[])
static int
set_comm_baud_rate(hal_virtual_comm_table_t *chan, int rate)
{
int current_rate;
- current_rate = CYGACC_COMM_IF_CONTROL(*chan, __COMMCTL_SETBAUD, rate);
+ current_rate = CYGACC_COMM_IF_CONTROL(*chan, __COMMCTL_GETBAUD);
if (rate != current_rate)
return CYGACC_COMM_IF_CONTROL(*chan, __COMMCTL_SETBAUD, rate);
return 0;
}
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
Visit us at Embedded World 2004, Nürnberg, Germany, 17-19 Feb, Stand 12-449
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine