This is a great solution about using Softwareserial.h in ESP32 board. There is an error “fatal error: avr/interrupt.h: No such file or directory” in softwareserial.cpp when you compiler the code.
This is a great solution about using Softwareserial.h in ESP32 board. There is an error “fatal error: avr/interrupt.h: No such file or directory” in softwareserial.cpp when you compiler the code. if you have the same problem, fellow the instructions:
1.download espsoftwareserial library on github: https://github.com/jdollar/espsoftwareserial/
2.modify softwareserial.cpp code, see post https://www.reddit.com/…/softwareserial_working_for_esp32a…/
2.1)
extern "C" { #include "esp32-hal-gpio.h" }
2.2)add these codes below #define MAX_PIN 15
ifdef ICACHE_FLASH
define ICACHE_FLASH_ATTR attribute((section(".irom0.text")))
define ICACHE_RAM_ATTR attribute((section(".iram.text")))
define ICACHE_RODATA_ATTR attribute((section(".irom.text")))
else
define ICACHE_FLASH_ATTR
define ICACHE_RAM_ATTR
define ICACHE_RODATA_ATTR
endif /* ICACHE_FLASH */
define GPIO_STATUS_W1TC_ADDRESS 0x24
Ok that’s all, enjoy it.