Ai-Thinker-Open / GPRS_C_SDK

Ai-Thinker A9/A9G GPRS (with GPS(A9G)) module C development SDK
https://ai-thinker-open.github.io/GPRS_C_SDK_DOC
MIT License
449 stars 235 forks source link

Problem with interrupt callback #504

Open simeondmr opened 2 years ago

simeondmr commented 2 years ago

1. SDK version(MASTER)

I have a strange problem with interrupt callback.

Here is the code:

void int_acc_callback(GPIO_INT_callback_param_t* param)
{
    uint8_t accId = 0;
    Trace(1, "INT ADXL345, pin : %d", param->pin);
    I2C_ReadMem(I2C_ACC, 0x53, 0x30, 1, &accId, 1, I2C_DEFAULT_TIME_OUT);
}

GPIO_config_t gpio_config = {
        .mode         = GPIO_MODE_INPUT_INT,
        .pin          = GPIO_PIN25,
        .defaultLevel = GPIO_LEVEL_LOW,
        .intConfig.debounce = 100,
        .intConfig.type     = GPIO_INT_TYPE_HIGH_LEVEL,
        .intConfig.callback = int_acc_callback
};

GPIO_Init(gpio_config);

On pin 25 there is the accelerometer's INT, which is raised correctly, as I have seen with an oscilloscope. The problem is that when the INT signal is HIGH, the callback is not called...

What could be the problem?

Thanks

Simeon

simeondmr commented 2 years ago

Solved...Only pins 0 and 7 are for INT

rohirto commented 1 year ago

I think its from Pins 0 to 7