Hi
I use AT command to configurate the INT0 as Rising Edge and bypass mode, send at+wind=2048 command. when the status of INT0 pin is from 0 to 1, it can send the unsolicited response from HyperTerminal like +WIND: 12,“INT0”,1. So I think the Interrupt is occured.
but when I configurate it in OpenAT, it seems not work well. I can’t get any unsolicited response. The test code is as below:
#include “adl_global.h”
const u16 wm_apmCustomStackSize = 1024*3;
const u32 wm_apmIRQLowLevelStackSize = 2048;
const u32 wm_apmIRQHighLevelStackSize = 1024;
/**************************************************************************/
/ Local variables /
/**************************************************************************/
#define EXTINT_PIN0 0
// ExtInt service handle
s32 ExtIntHandle;
// IRQ service handle
s32 IrqHandle;
// ExtInt configuration: both edge detection without filter
adl_extintConfig_t extintConfig ={ ADL_EXTINT_SENSITIVITY_BOTH_EDGE , ADL_EXTINT_FILTER_BYPASS_MODE ,0,0, NULL };
/**************************************************************************/
/ Local functions /
/**************************************************************************/
//
/ Function : MyExtIntIrqHandler /
/--------------------------------------------------------------------------/
/ Scope : ADL Interrupt service low level handler /
/ /
/ Return : TRUE to enable High level handler notification /
/ FALSE to disable High level handler notification /
/ /
/--------------------±–±--±--------------------------------------------/
/ Variable Name |IN |OUT| Use /
/--------------------±–±--±--------------------------------------------/
/ Source | X | | Interrupt source identifier /
/--------------------±–±--±--------------------------------------------/
/ NotificationLevel | X | | Handler notification level /
/--------------------±–±--±--------------------------------------------/
/ Data | X | X | Interrupt event data structure /
/--------------------±–±--±--------------------------------------------/
/************/
bool MyExtIntHandler ( adl_irqID_e Source, adl_irqNotificationLevel_e NotificationLevel, adl_irqEventData_t * Data )
{
adl_atSendResponse(ADL_AT_UNS, “INT Occur\r\n”);
// Read the input status
adl_extintInfo_t Status, * AutoReadStatus;
adl_extintRead ( ExtIntHandle, &Status );
// Input status can also be obtained from the auto read option.
AutoReadStatus = ( adl_extintInfo_t * ) Data->SourceData;
return TRUE;
}
/*
void MyFunction2 ( void )
{
// Un-subscribes from the ExtInt service
adl_extintUnsubscribe ( ExtIntHandle );
}
*/
/*******************************************************************/
/ Function : adl_main /
/-------------------------------------------------------------------------/
/ Object : Customer application initialisation /
/ /
/-------------------------------------------------------------------------/
/ Variable Name |IN |OUT|GLB| Utilisation /
/--------------------±–±--±–±---------------------------------------/
/ InitType | | | | Application start mode reason /
/--------------------±–±--±–±---------------------------------------/
/***************************************************************************/
void adl_main ( adl_InitType_e InitType )
{
adl_extintCapabilities_t My_ExtInt_Capa;
adl_extintGetCapabilities ( &My_ExtInt_Capa );
// Test if the Wireless CPU?have Ext Int pin
if ( My_ExtInt_Capa.NbExternalInterrupt >= 1 )
{
// Subscribes to the IRQ service
IrqHandle = adl_irqSubscribe ( MyExtIntHandler, ADL_IRQ_NOTIFY_LOW_LEVEL, ADL_IRQ_PRIORITY_HIGH_LEVEL,ADL_IRQ_OPTION_AUTO_READ );
ExtIntHandle = adl_extintSubscribe ( EXTINT_PIN0 , IrqHandle, 0, &extintConfig );
}
adl_extintUnsubscribe ( ExtIntHandle );
}