LPC2xxx CAN bugfixes

Hans Rosenfeld rosenfeld@grumpf.hope-2000.org
Thu Aug 16 16:32:00 GMT 2007


There are two bugs in the CAN driver for the LPC2xxx.

One is in include/can_lpc2xxx_baudrates.h: numbers shouldn't be prefixed
with 0 if they aren't intended to be interpreted as octal. I fixed this
only where it actually breaks, but the rest should be changed, too.

The other is in src/can_lpc2xxx.c, the definition of "info" is missing
when only one CAN channel is configured.


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown
-------------- next part --------------
Index: can_lpc2xxx.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/can/arm/lpc2xxx/current/src/can_lpc2xxx.c,v
retrieving revision 1.3
diff -u -r1.3 can_lpc2xxx.c
--- can_lpc2xxx.c	2 Aug 2007 08:48:00 -0000	1.3
+++ can_lpc2xxx.c	16 Aug 2007 16:20:29 -0000
@@ -928,7 +928,7 @@
 static Cyg_ErrNo lpc2xxx_can_lookup(struct cyg_devtab_entry** tab, struct cyg_devtab_entry* sub_tab, const char* name)
 {
     can_channel* chan    = (can_channel*) (*tab)->priv;
-    CAN_DECLARE_INFO(chan);
+    lpc2xxx_can_info_t *info = (lpc2xxx_can_info_t *)chan->dev_priv;
     cyg_uint32   regval;
 
     chan->callbacks->can_init(chan); 
-------------- next part --------------
Index: can_lpc2xxx_baudrates.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/can/arm/lpc2xxx/current/include/can_lpc2xxx_baudrates.h,v
retrieving revision 1.2
diff -u -r1.2 can_lpc2xxx_baudrates.h
--- can_lpc2xxx_baudrates.h	31 Jul 2007 07:53:36 -0000	1.2
+++ can_lpc2xxx_baudrates.h	16 Aug 2007 16:30:55 -0000
@@ -118,7 +118,7 @@
     CAN_BR_TBL_ENTRY(59, 15, 07, 0, 1), // 10  kbaud
     CAN_BR_TBL_ENTRY(49, 11, 01, 0, 1), // 20  kbaud
     CAN_BR_TBL_ENTRY(19, 11, 01, 0, 1), // 50  kbaud
-    CAN_BR_TBL_ENTRY(09, 11, 01, 0, 1), // 100 kbaud
+    CAN_BR_TBL_ENTRY( 9, 11, 01, 0, 1), // 100 kbaud
     CAN_BR_TBL_ENTRY(07, 11, 01, 0, 1), // 125 kbaud
     CAN_BR_TBL_ENTRY(03, 11, 01, 0, 1), // 250 kbaud
     CAN_BR_TBL_ENTRY(01, 11, 01, 0, 0), // 500 kbaud


More information about the Ecos-patches mailing list