ESP8266 Developer Zone The Official ESP8266 Forum 2016-11-25T17:10:15+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=3029 2016-11-25T17:10:15+08:00 2016-11-25T17:10:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3029&p=10665#p10665 <![CDATA[Re: GPIO ISF not active with RTOS_SDK-1.4.2[RTOS_SDK-1.4.2版本下GPIO中断服务程序不工作]]]> RTOS V1.4.2版本的GPIO中断是是可以正常工作的,刚刚将github上的GPIOtest sample code测试了一下完全可以。有关GPIO中断的代码可以参考一下官网github上面的GPIOtest。https://github.com/espressif/esp8266-rtos-sample-code.git
谢谢对ESP8266的关注。

Statistics: Posted by ESP_Xutao — Fri Nov 25, 2016 5:10 pm


]]>
2016-11-08T15:39:03+08:00 2016-11-08T15:39:03+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3029&p=10451#p10451 <![CDATA[GPIO ISF not active with RTOS_SDK-1.4.2[RTOS_SDK-1.4.2版本下GPIO中断服务程序不工作]]]> :? :? :?

Code:

LOCAL void gpio_int_handler(void)
{
    uint32 gpio_status = GPIO_REG_READ(GPIO_STATUS_ADDRESS);
    //ETS_GPIO_INTR_DISABLE();
    ETS_INTR_LOCK();
    GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, gpio_status);
    //GPIO_OUTPUT(GPIO_Pin_4,1);
    if (gpio_status & BIT(GPIO_ID_PIN(12)))
    {
        if( GPIO_ID_PIN(12) )
        {
            printf("yes----------------\n");
            GPIO_OUTPUT_SET(GPIO_ID_PIN(4), 1);
        }
        else
        {
            printf("no-----------------\n");
        }
    }
    //ETS_GPIO_INTR_ENABLE();
    ETS_INTR_UNLOCK();
}

void user_init(void)
{
    printf("SDK version:%s\n", system_get_sdk_version());
    GPIO_ConfigTypeDef gpio_conf4;
    gpio_conf4.GPIO_Pin = GPIO_Pin_4;
    gpio_conf4.GPIO_Mode = GPIO_Mode_Output;
    gpio_conf4.GPIO_Pullup = GPIO_PullUp_EN;
    gpio_conf4.GPIO_IntrType = GPIO_PIN_INTR_DISABLE;
    gpio_config(&gpio_conf4);
    GPIO_OUTPUT_SET(GPIO_ID_PIN(4), 1);

    GPIO_ConfigTypeDef gpio_conf12;
    ETS_INTR_LOCK();
    gpio_conf12.GPIO_Pin = GPIO_Pin_12;
    gpio_conf12.GPIO_Mode = GPIO_Mode_Input;
    gpio_conf12.GPIO_Pullup = GPIO_PullUp_DIS;
    gpio_conf12.GPIO_IntrType = GPIO_PIN_INTR_POSEDGE;
    gpio_intr_handler_register(gpio_int_handler,NULL);
    gpio_config(&gpio_conf12);
    ETS_INTR_UNLOCK();
    GPIO_OUTPUT_SET(GPIO_ID_PIN(4), 0);
    while(1);
}

Statistics: Posted by mike.wu — Tue Nov 08, 2016 3:39 pm


]]>