diff --git a/src/SoftwareSerial.cpp b/src/SoftwareSerial.cpp index 163e3a3..61461d2 100644 --- a/src/SoftwareSerial.cpp +++ b/src/SoftwareSerial.cpp @@ -606,6 +606,7 @@ void UARTBase::onReceive(Delegate&& handler) { restoreInterrupts(); } +#if __GNUC__ < 12 // The template member functions below must be in IRAM, but due to a bug GCC doesn't currently // honor the attribute. Instead, it is possible to do explicit specialization and adorn // these with the IRAM attribute: @@ -616,4 +617,5 @@ template void IRAM_ATTR delegate::detail::DelegateImpl::operator()( template size_t IRAM_ATTR circular_queue::available() const; template bool IRAM_ATTR circular_queue::push(uint32_t&&); template bool IRAM_ATTR circular_queue::push(const uint32_t&); +#endif // __GNUC__ < 12 diff --git a/src/SoftwareSerial.h b/src/SoftwareSerial.h index 9139e2b..13a11b1 100644 --- a/src/SoftwareSerial.h +++ b/src/SoftwareSerial.h @@ -432,6 +432,7 @@ using UART = BasicUART< GpioCapabilities >; using SoftwareSerial = EspSoftwareSerial::UART; using namespace EspSoftwareSerial; +#if __GNUC__ < 12 // The template member functions below must be in IRAM, but due to a bug GCC doesn't currently // honor the attribute. Instead, it is possible to do explicit specialization and adorn // these with the IRAM attribute: @@ -442,6 +443,7 @@ extern template void delegate::detail::DelegateImpl::operator()() c extern template size_t circular_queue::available() const; extern template bool circular_queue::push(uint32_t&&); extern template bool circular_queue::push(const uint32_t&); +#endif // __GNUC__ < 12 #endif // __SoftwareSerial_h