(FSLBOT+CW) Undefined "board_led_display" in TWR_MECH_FSLBOT_CW_Sample_Code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(FSLBOT+CW) Undefined "board_led_display" in TWR_MECH_FSLBOT_CW_Sample_Code

893 Views
MangoBot
Contributor III

hello ,

 

we intend to control on/off of FSLBOT's face LEDs.

 

we download TWR_MECH_FSLBOT_CW_Sample_Code from Freescale web and try to compile in CW,

but fail in compiling TWR_MCF5225X_example.mcp.

CW said   Link Error : Undefined : "board_led_display" Referenced from "main"

 

we search through entire TWR_MECH_FSLBOT_CW_Sample_Code and fail to find codes of board_led_display().

 

any kind advices, or suggestion codes to control LEDs of FSLBOT in C language are appreciated.

 

--

mg

 

 

Labels (1)
0 Kudos
2 Replies

449 Views
MangoBot
Contributor III

hello ,

thanks to hints of Pascal, we've tried following codes to work :

#define I2C_ID_FACELED 0x38

#define I2C_ADDRESS_LEDINIT 0x03

#define I2C_ADDRESS_LEDLIT 0x01

#define LED_LIT(r,d) {I2CsendByte(d, r, I2C_ID_FACELED ); PITDelay(10,0);}

void leds_init(void)

{

  I2Cinit();

  LED_LIT( I2C_ADDRESS_LEDINIT, 0 ); //led init

}

void board_led_display(uint8 n)

{

  uint8 d;

  d = (0x01 << n);

  LED_LIT( I2C_ADDRESS_LEDLIT, d );

}

this may help FSLBOT pals.

--

mg

449 Views
MangoBot
Contributor III

hello ,

FSLBOT (Freescale Mechatronics Robot) is built by MCF52259 and Tower Mechatronics board.

Guess the codes to control LEDs should be something simple like :

void leds_init(void)

{

// Enable signals as GPIO   

MCF_GPIO_PTCPAR = 0      

| MCF_GPIO_PTCPAR_DTIN3_GPIO      

| MCF_GPIO_PTCPAR_DTIN2_GPIO      

| MCF_GPIO_PTCPAR_DTIN1_GPIO      

| MCF_GPIO_PTCPAR_DTIN0_GPIO;

// Enable signals as digital outputs   

MCF_GPIO_DDRTC = 0      

| MCF_GPIO_DDRTC_DDRTC3      

| MCF_GPIO_DDRTC_DDRTC2      

| MCF_GPIO_DDRTC_DDRTC1      

| MCF_GPIO_DDRTC_DDRTC0;      

MCF_GPIO_PORTTC = 0; // TURN LEDS OFF

}

void board_led_display( int numLed )

{

MCF_GPIO_PORTTC = numLed;

}

however, these codes don't work and LEDs are not turned on.

probably due to the GPIO/registers are not correctly specified, or anything we're still missing?

hope for kind advices.

--

mg

0 Kudos