[En-Nut-Discussion] Error in 7segtst.c

Sinisa Dumanic sdumanic at tehno.ath.cx
Wed Mar 31 10:57:28 CEST 2010


After all I successfully init the SPI. But I still can't run my LED display.
I have Olimex SAM7-EX256 board and I make connections on following way: 

uC          AS1108 
MOSI1     DIN 
SCK1       CLK 
SPI1 CS0  LOAD/CSN 
GND         GND 

Then I make changes in Nut/OS Configurator: 
Uner AT91 SPI Bus Controller I change CS0 Port ID (Second Controller) to
PIOA_ID and CS0 Port Bit (Second Controller) 21. 

I define: 

#define NUT_CONFIG_7SEG_CS 0 
#define NUT_CONFIG_7SEG_SPIBUS spiBus1At91 

Did I need to change anything more ? 

Also can you explain other functions: 

extern int Spi7segCommand(NUTDEVICE * dev, uint8_t addr, CONST void *txbuf,
void *rxbuf, int xlen); 
extern void print_7seg(NUTDEVICE *dev, char* chars); 
extern void dot_7seg(NUTDEVICE *dev, uint8_t dotNumber, uint8_t dotCommand);

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Ulrich Prinz
Sent: Saturday, March 27, 2010 11:41 PM
To: Ethernut User Chat (English)
Subject: Re: [En-Nut-Discussion] Error in 7segtst.c

Hi!

Am 27.03.2010 14:24, schrieb sdumanic:
>
> When i try to compile 7segtst.c under ethernut-4.9.8 I got following
error:
>
>> "make" all
> arm-elf-gcc -c -I../../nutbld/include  -I../../nut/include  -DAT91SAM7X_EK
> -mcpu=arm7tdmi -mthumb-interwork -Os -Wall -Wstrict-prototypes
> -Wa,-a=7segtst.lst  -o 7segtst.o 7segtst.c
> 7segtst.c: In function 'main':
> 7segtst.c:98: error: 'NUT_CONFIG_7SEG_SPIBUS' undeclared (first use in
this
> function)
> 7segtst.c:98: error: (Each undeclared identifier is reported only once
> 7segtst.c:98: error: for each function it appears in.)
> 7segtst.c:98: error: 'NUT_CONFIG_7SEG_CS' undeclared (first use in this
> function)
> make: *** [7segtst.o] Error 1
>
> How to declare this ?
>
Sorry, my fault. Was a leftover from an older version of Nut/OS.

Add and modify the following defines to the 7segtst.c:

#define NUT_CONFIG_7SEG_CS 0
#define NUT_CONFIG_7SEG_SPIBUS spiBus0At91

Modify means that you have to select the right chip-select and the 
correct SPI-bus where you connected the display.

Best regards,
Ulrich
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list