-->
Page 1 of 1

Upgarde to 2.2.0 unable to compile error in ets_isr_t

PostPosted: Thu Apr 26, 2018 7:46 am
by kapooo
From SDK 2.1.0 the function ets_isr_t is defined in ets_sys.h line 67
Code: Select allvoid ets_isr_attach(int i, ets_isr_t func, void *arg);

Before 2.1.0 SDK I was able to attach GPIO interrupt with the macro
Code: Select allETS_GPIO_INTR_ATTACH(func, arg)

defined in ets_sys.h in line 86
Code: Select all#define ETS_GPIO_INTR_ATTACH(func, arg) \
    ets_isr_attach(ETS_GPIO_INUM, (func), (void *)(arg))

From SDK 2.1.0 and later the compile get an error when I use the macro ETS_GPIO_INTR_ATTACH:
Code: Select alluser/command.c:563:2: error: passing argument 2 of 'ets_isr_attach' from incompatible pointer type [-Werror]
  ETS_GPIO_INTR_ATTACH(gpio_intr_handler, &asp[out]);
.
.
.
/esp-open-sdk/sdk_2.2/include/ets_sys.h:67:6: note: expected 'ets_isr_t' but argument is of type 'void (*)(uint8 *)'
 void ets_isr_attach(int i, ets_isr_t func, void *arg);


How can I fix this error?

Re: Upgarde to 2.2.0 unable to compile error in ets_isr_t

PostPosted: Thu Apr 26, 2018 8:47 am
by McChubby007
The function gpio_intr_handler needs to have a signature which matches ets_isr_t.

Re: Upgarde to 2.2.0 unable to compile error in ets_isr_t

PostPosted: Thu Apr 26, 2018 9:05 am
by kapooo
What do you mean for signature? Can you make an example?

Thank you ;)

Re: Upgarde to 2.2.0 unable to compile error in ets_isr_t

PostPosted: Tue May 01, 2018 9:32 am
by Cicero
EDIT: Ouch, I went down a rabbit hole I needn't have.

Simply redefine your interrupt handler:
Code: Select allvoid gpio_intr_handler (void)


Code: Select allvoid gpio_intr_handler (void *arg)