I've been working with the esp8266 module for a few days now, and I am honestly amazed.
Since the esp module I'm using only has two GPIOs, I have a microcontroller that will send analog data to the esp, which will again send that data to a tcp server. Almost all of the above are working quite fine, except I cant get any of the GPIO's to read anything, not even digital data.
Browsing this forum, I tried implementing the following suggestion, but without any success. I need your help.
Thanks for everyone reading this

Code: Select all
void ICACHE_FLASH_ATTR
gpio_init(void)
{
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U,FUNC_GPIO0); //GPIO Alternate Function
GPIO_DIS_OUTPUT(GPIO_ID_PIN(0)); //Configure it in input mode.
ETS_GPIO_INTR_DISABLE(); //Close the GPIO interrupt
ETS_GPIO_INTR_ATTACH(GPIO_INTERRUPT,NULL); //Register the interrupt function
gpio_pin_intr_state_set(GPIO_ID_PIN(0),GPIO_PIN_INTR_NEGEDGE); //Falling edge trigger
ETS_GPIO_INTR_ENABLE() ; //Enable the GPIO interrupt
}
I then created the GPIO_INTERRUPT function that basically only printed a message. It does print when I set GPIO0 to 0, but then the device restarts. Sigh. It's the non-os version.
Any hints?