Skip to content

Commit

Permalink
Remove implicit include. Available/pop for ISRs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed Sep 15, 2019
1 parent b06fe81 commit 3477640
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EspSoftwareSerial",
"version": "5.2.3",
"version": "5.2.5",
"keywords": [
"serial", "io", "softwareserial"
],
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EspSoftwareSerial
version=5.2.3
version=5.2.5
author=Peter Lerup, Dirk Kaar
maintainer=Peter Lerup <[email protected]>
sentence=Implementation of the Arduino software serial for ESP8266/ESP32.
Expand Down
10 changes: 4 additions & 6 deletions src/circular_queue/circular_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <algorithm>
#include <functional>

#ifdef ESP32
#include <esp_attr.h>
#elif !defined(ESP8266)
#if !defined(ESP32) && !defined(ESP8266)
#define ICACHE_RAM_ATTR
#define IRAM_ATTR
#endif
Expand Down Expand Up @@ -105,7 +103,7 @@ class circular_queue
/*!
@brief Get a snapshot number of elements that can be retrieved by pop.
*/
size_t available() const
size_t IRAM_ATTR available() const
{
int avail = static_cast<int>(m_inPos.load() - m_outPos.load());
if (avail < 0) avail += m_bufSize;
Expand Down Expand Up @@ -166,7 +164,7 @@ class circular_queue
@return An rvalue copy of the popped element, or a default
value of type T if the queue is empty.
*/
T pop();
T IRAM_ATTR pop();

/*!
@brief Pop multiple elements in ordered sequence from the queue to a buffer.
Expand Down Expand Up @@ -250,7 +248,7 @@ size_t circular_queue<T>::push_n(const T* buffer, size_t size)
}

template< typename T >
T circular_queue<T>::pop()
T IRAM_ATTR circular_queue<T>::pop()
{
const auto outPos = m_outPos.load(std::memory_order_acquire);
if (m_inPos.load(std::memory_order_relaxed) == outPos) return defaultValue;
Expand Down

0 comments on commit 3477640

Please sign in to comment.