hi
I am trying to write a code to make a flasher using GPIOs. But I couldn’t achieved. According to code it must work but when I measure related I/O pin I can’t see any difference.
Q2406B
OpenAT 3.02
GCC
void adl_main ( adl_InitType_e InitType )
{
TRACE((1,"Embedded application main"));
GpioHandle = adl_ioSubscribe(ADL_IO_Q24X6_GPIO_5,0,0,0,(adl_ioHdlr_f)NULL);
adl_atUnSoSubscribe("+WIND: 4",(adl_atUnSoHandler_t)Wind4_Handler);
}
s16 Wind4_Handler(adl_atUnSoHandler_t *paras)
{
timerHandleFlashIO = adl_tmrSubscribe(TRUE,5, ADL_TMR_TYPE_100MS,(adl_tmrHandler_t)timerFuncFlashIO);
return TRUE;
}
void timerFuncFlashIO(u8 timerid)
{
s8 ReturnCode;
ascii buffer[30];
if(toggle == 0)
toggle=1;
else if(toggle != 0)
toggle = 0;
ReturnCode = adl_ioWrite(GpioHandle,ADL_IO_Q24X6_GPIO_5,toggle);
if(ReturnCode == ADL_RET_ERR_UNKNOWN_HDL)
adl_atSendResponse(ADL_AT_UNS,"\r\nADL_RET_ERR_UNKNOWN_HDL");
else if(ReturnCode == ADL_RET_ERR_PARAM)
adl_atSendResponse(ADL_AT_UNS,"\r\nADL_RET_ERR_PARAM");
else if(ReturnCode == ADL_RET_ERR_FATAL)
adl_atSendResponse(ADL_AT_UNS,"\r\nADL_RET_ERR_FATAL");
if(ReturnCode == ADL_ERR_IO_WRITE)
adl_atSendResponse(ADL_AT_UNS,"\r\nADL_ERR_IO_WRITE");
else if(ReturnCode == OK)
adl_atSendResponse(ADL_AT_UNS,"\r\nReturnCode of ioWrite is OK");
wm_sprintf(buffer,"\r\nReturnCode == %d\r\n",ReturnCode);
adl_atSendResponse(ADL_AT_RSP,buffer);
}
what do You think?