[En-Nut-Discussion] Define CAN_BUF_SIZE in some configuartion file

Henrik Maier hmnews at proconx.com
Thu Feb 5 01:07:51 CET 2009


Hi Uwe,

I suppose people added only as much configuration options as they needed
when developing the CAN driver. 

One option for you is to pass -DCAN_BUF_SIZE=4 to the compiler when building
Nut/OS, by adding this to either NutConf.mk or UserConf.mk.

However a more permanent support through Nutconf of such an option makes
perfectly sense. I added a new option ATCAN_RX_BUF_SIZE to conf/arch/avr.nut
and support for it in arch/avr/dev/atcan.c. Please get these two files from
the CVS head. Add ATCAN_RX_BUF_SIZE = 4 to your .conf file and it all should
work.

Henrik
http://www.proconx.com


> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of Uwe Bonnes
> Sent: Thursday, 5 February 2009 4:19 AM
> To: en-nut-discussion at egnite.de
> Subject: [En-Nut-Discussion] Define CAN_BUF_SIZE in some configuartion
> file
> 
> Hello,
> 
> nut/arch/avr/dev/atcan.c defines
> 
> #ifndef CAN_BUF_SIZE
> #  define CAN_BUF_SIZE 64
> #endif
> 
> and later allocs CAN_BUF_SIZE * sizeof(CANFRAME)
> 
> On a board without external RAM, the alloc will/may fail and the CAN
> device
> will fail too. Is there any way to define CAN_BUF_SIZE in some custom
> .conf file and not changing it in the source
> 
> It seems that it is not enough to add a line like
> CAN_BUF_SIZE = "4"
> in my custom xxx.conf file.
> 
> --
> Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de
> 
> Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
> --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list