Problem with Q24PLUS GPIO_4


#1

Hi everybody,

I work with Q24plus module and i need to read every t time the state of GPIO_4.
BoutonPoussoir_Handler returns 5 and LectureEtat_BP was called evry 1s (with cyclic timer).
the fisrt call of this function produced this result : io_value = FFFFFFF8 and then there is no state changment when i set the GPIO_4 to 0.
can someone help me.

void IO_Subscribe ( void )   
{
	static u32 Mask;
	
	TRACE_JRI ( TRACE_LEVEL_FCT, ">>> IO_Subscribe" );
	adl_ioUnsubscribe(BoutonPoussoir_Handler);
	
	BoutonPoussoir_Handler = adl_ioSubscribe(ADL_IO_Q24PLUS_GPIO_4, 0, 1, 0, NULL);
	
	TRACE_JRI_3 (TRACE_LEVEL_TCPC, "Souscription I/O : %d !!!", BoutonPoussoir_Handler ) ;
	if (BoutonPoussoir_Handler)
	{
		pG_timerPollingBP = adl_tmrSubscribe( TRUE, TIME_POLLING_BP, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t) LectureEtat_BP  ) ;
	}
	
	TRACE_JRI ( TRACE_LEVEL_FCT, "<<< IO_Subscribe" );
	
}


void LectureEtat_BP( void )  // AM V307
{
	s32 io_value;

	TRACE_JRI ( TRACE_LEVEL_FCT, ">>> LectureEtat_BP" );

	io_value = adl_ioRead(BoutonPoussoir_Handler);

	//TRACE_JRI_3 (TRACE_LEVEL_TCPC, " Gpio Read Value : %.8X", io_value ) ;
	//TRACE_JRI_3 (TRACE_LEVEL_TCPC, " Gpio Read >>> 4 : %.3X", ((u16)(gpio_result) >> 10) ) ;
	
	if ((((u16)(io_value) >> 10) & (0x001)) == 0)
	{
		CompteurReset += 1;
		TRACE_JRI_3 (TRACE_LEVEL_TCPC, " CompteurReset : %d", CompteurReset ) ;
		if (CompteurReset < AttenteBuzOff)  // si inferieur à 1 seconde
		{
			// arret buzzer
		  Beep_OFF;
			CompteurReset = 0;
		}
		else 
		{
			// Reset du module
		  //enableWatchdogCC ( 0, 1, 0 ) ;
			CompteurReset = 0;
		}
			
	}
	TRACE_JRI ( TRACE_LEVEL_FCT, "<<< LectureEtat_BP" );

}

thanks in advance.

Abdel