From f74476803dd5d644a32653b160c4c41060b6ede2 Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Sun, 2 Jul 2023 11:14:14 +0200 Subject: [PATCH] The gcc in IDF 5.1 appears to have fixed the attribute bug affecting IRAM_ATTR. --- src/SoftwareSerial.cpp | 2 ++ src/SoftwareSerial.h | 2 ++ 2 files changed, 4 insertions(+) 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