Hello, I try this to build this code :
#include "adl_global.h"
const u16 wm_apmCustomStackSize = 1024;
const adl_ioConfig_t MyGpioConfig1[1]={{ADL_IO_Q2686_GPIO_19,0,ADL_IO_OUTPUT,ADL_IO_LOW}};
const adl_ioConfig_t MyGpioConfig2[1]={{ADL_IO_Q2686_GPIO_21,0,ADL_IO_INPUT}};
const adl_ioConfig_t MyGpioConfig3[1]={{ADL_IO_Q2686_GPIO_24,0,ADL_IO_INPUT}};
s32 MyGpioHandle1;
s32 MyGpioHandle2;
s32 MyGpioHandle3;
void HelloWorld_TimerHandler ( u8 ID )
{
s32 ReadValue;
s32 ReadValue2;
/* Hello World */
TRACE (( 1, "Embedded : Hello World " ));
ReadValue=adl_ioReadSingle (MyGpioHandle2,ADL_IO_Q2686_GPIO_21);
ReadValue2=adl_ioReadSingle (MyGpioHandle3,ADL_IO_Q2686_GPIO_24);
if(ReadValue==1)
{
adl_ioWriteSingle (MyGpioHandle1,ADL_IO_Q2686_GPIO_19,ADL_IO_HIGH);
adl_atSendResponse ( ADL_AT_UNS, "\r\nGPIO19 H\r\n" );
adl_atSendResponse ( ADL_AT_UNS, "\r\nGPIO19 H\r\n" );
}
else if (ReadValue==0)
{
adl_ioWriteSingle (MyGpioHandle1,ADL_IO_Q2686_GPIO_19,ADL_IO_LOW);
adl_atSendResponse ( ADL_AT_UNS, "\r\nGPIO19 L\r\n" );
}
if(ReadValue2==1){
adl_ioUnsubscribe (MyGpioHandle1);
adl_ioUnsubscribe (MyGpioHandle2);
adl_ioUnsubscribe (MyGpioHandle3);
adl_atSendResponse ( ADL_AT_UNS, "\r\nGPIO relachement\r\n" );
}
}
void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, "Embedded : Appli Init" ));
adl_atSendResponse ( ADL_AT_UNS, "\r\nInit GPIO\r\n" );
MyGpioHandle1=adl_ioSubscribe (1, MyGpioConfig1,0,0,0);
MyGpioHandle2=adl_ioSubscribe (1, MyGpioConfig2,0,0,0);
MyGpioHandle3=adl_ioSubscribe (1, MyGpioConfig3,0,0,0);
/* Set 1s cyclic timer */
adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
}
On an Q2686 with Frimware Package 7.3.0.00 and OpenAT OS Package 6.20.0.04
and got this errors:
'ADL_IO_HIGH' undeclared (first use in this function) main_gpio.c test_gpio/src 25 C/C++ Problem
'ADL_IO_INPUT' undeclared here (not in a function) main_gpio.c test_gpio/src 5 C/C++ Problem
'ADL_IO_LOW' undeclared here (not in a function) main_gpio.c test_gpio/src 4 C/C++ Problem
'ADL_IO_OUTPUT' undeclared here (not in a function) main_gpio.c test_gpio/src 4 C/C++ Problem
'ADL_IO_Q2686_GPIO_19' undeclared here (not in a function) main_gpio.c test_gpio/src 4 C/C++ Problem
'ADL_IO_Q2686_GPIO_21' undeclared here (not in a function) main_gpio.c test_gpio/src 5 C/C++ Problem
'ADL_IO_Q2686_GPIO_24' undeclared here (not in a function) main_gpio.c test_gpio/src 6 C/C++ Problem
syntax error before 'MyGpioConfig1' main_gpio.c test_gpio/src 4 C/C++ Problem
syntax error before 'MyGpioConfig2' main_gpio.c test_gpio/src 5 C/C++ Problem
syntax error before 'MyGpioConfig3' main_gpio.c test_gpio/src 6 C/C++ Problem
Before I update the firmware and the SDK that works fine!
Where is the probeleme as I found the good references in the includes folder of the project!
thks seb.