[b] I am a beginner in openAT,when I try to read value from GPIO, i always got ADL_RET_ERR_UNKNOWN_HDL , and could anyone tell me how to know what value the adl_ioRead( ) return ,and how to know whether the gpio is set or not .
any suggestion will be appreciate.
void tmrHandle( u8 ID )
{
adl_ioWrite( gpio4Handler, ADL_IO_Q24X6_GPIO_0 , 1 );
blGPIO4State = adl_ioRead( gpio4Handler );
blGPIO0State = adl_ioRead( gpio0Handler );
if( blGPIO4State || blGPIO0State )
{
smsHandler = adl_smsSubscribe(SmsHandle, SmsCtrlHandle, ADL_SMS_MODE_TEXT);
}
if( blGPIO4State )
{
smsSendHandle( 1 );
}
if( blGPIO0State )
{
smsSendHandle( 0 );
}
}
void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, "Embedded Application : Main" ));
gpio4Handler = adl_ioSubscribe( ADL_IO_Q24X6_GPIO_4, ADL_IO_Q24X6_GPIO_4, 0, 0, ( adl_ioHdlr_f) NULL );
gpio0Handler = adl_ioSubscribe( ADL_IO_Q24X6_GPIO_0, ADL_IO_Q24X6_GPIO_0, 0, 0, ( adl_ioHdlr_f) NULL );
adl_tmrSubscribe( TRUE, 30, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t)tmrHandle );
}
[/b]