Hello.
Firstly i was making flasher for gpio pin 5, but i give up. Now im just testing the gpio handle with this code:
#include "adl_global.h"
u32 wm_apmCustomStack [ 1024 ];
s8 GpioHandle;
const u32 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );
adl_ioConfig_t Gpio5Config [1] = {{ ADL_IO_Q2686_GPIO_5, 0, ADL_IO_OUTPUT, ADL_IO_HIGH }};
//-----------------------------------------------------------
u8 Gpio5=0;
void Gpio5_TimerHandler ( u8 ID )
{
if(Gpio5 == 0)
{
TRACE (( 3, "PIN 5 HIGH" ));
adl_ioWriteSingle(GpioHandle, ADL_IO_Q2686_GPIO_5, ADL_IO_HIGH);
Gpio5=1;
}else{
TRACE (( 3, "PIN 5 LOW" ));
Gpio5 = 0;
adl_ioWriteSingle(GpioHandle, ADL_IO_Q2686_GPIO_5, ADL_IO_LOW);
}
}
void setGpio (void)
{
GpioHandle = adl_ioSubscribe ( 1, Gpio5Config, 0, 0, 0 );
adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, Gpio5_TimerHandler );
}
//------------------------------------------------------------
void adl_main ( adl_InitType_e InitType ){
s8 Returncode;
TRACE (( 1, "Start" ));
GpioHandle = adl_ioSubscribe(ADL_IO_Q2686_GPIO_5,0,0,0,(adl_ioHdlr_f)NULL);
}
but in the trace i get [ADL] Gpio subs 7 0 : -2 and thats it.
What’s is the meanning of -2. Wrong declaration ? Anyway, the code is not working.