Problems with SIM

Hi everyone!! ,im doing the libreries to my project and something really strange happened. Im trynig to suscribe my SIM using a library function called “exe_SIMInit (ascii Pin_number)”, strangely when i use this function the following events appear

09/10/28,12:18:33:437 ADL 1 ADL_SIM_STATE_INSERTED
09/10/28,12:18:42:937 ADL 1 Inside Sim_Handler
09/10/28,12:18:42:937 ADL 1 ADL_SIM_STATE_REMOVED
09/10/28,12:18:43:484 ADL 1 Inside Sim_Handler
09/10/28,12:18:43:484 ADL 1 ADL_SIM_STATE_PIN_ERROR

Now, the PinNumber is “0” and that number is OK.
The strangest thing is that if i just use the adl_simSuscbibe funtion in the main.c with the same pin number…it works fine!!, the ADL_SIM_STATE_FULL_INIT appears!!..i really dont know what im doing wrong. I really would need some helo with this.

This is the code…of the main.c and wav_GSM.c

//main.c

void hardware_init(void)
{
ascii *PIN;
PIN=adl_memGet(1);
wm_sprintf(PIN,"0");
if(exe_SIMInit(PIN)==TRUE)
TRACE((1,"[main.c][hardware_init]:Hardware Inicializacion correcta"));
//adl_simSubscribe(Sim_HandlerT,PIN);
}
//

//wav_gsm.C.c
bool exe_SIMInit(ascii *pin)
{
u32 SIM_handler;
SIM_handler=adl_simSubscribe(Sim_Handler,pin); 
if(SIM_handler==OK)
	{
	TRACE((1,"[wav_GSM.c][exe_SIMInit]:adl_simSubscribe OK"));
	return TRUE;
	}
else
	{
	TRACE((1,"[wav_GSM.c][exe_SIMInit]:adl_simSubscribe ERROR"));
	return FALSE;
	}
return FALSE;

}
//

I solved!, the problems were some defines whose values were just wrong.