Skip to content

Commit

Permalink
Revert to non-MP circular queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed Jul 2, 2023
1 parent 1d915c6 commit 7a14d3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/SoftwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void UARTBase::beginRx(bool hasPullUp, int bufCapacity, int isrBufCapacity) {
m_parityBuffer.reset(new circular_queue<uint8_t>((m_buffer->capacity() + 7) / 8));
m_parityInPos = m_parityOutPos = 1;
}
m_isrBuffer.reset(new circular_queue_mp<uint32_t, UARTBase*>((isrBufCapacity > 0) ?
m_isrBuffer.reset(new circular_queue<uint32_t, UARTBase*>((isrBufCapacity > 0) ?
isrBufCapacity : m_buffer->capacity() * (2 + m_dataBits + static_cast<bool>(m_parityMode))));
if (m_buffer && (!m_parityMode || m_parityBuffer) && m_isrBuffer) {
m_rxValid = true;
Expand Down Expand Up @@ -616,8 +616,4 @@ template void IRAM_ATTR delegate::detail::DelegateImpl<void*, void>::operator()(
template size_t IRAM_ATTR circular_queue<uint32_t, UARTBase*>::available() const;
template bool IRAM_ATTR circular_queue<uint32_t, UARTBase*>::push(uint32_t&&);
template bool IRAM_ATTR circular_queue<uint32_t, UARTBase*>::push(const uint32_t&);
template size_t IRAM_ATTR circular_queue_mp<uint32_t, UARTBase*>::available() const;
template bool IRAM_ATTR circular_queue_mp<uint32_t, UARTBase*>::push(uint32_t&&);
template bool IRAM_ATTR circular_queue_mp<uint32_t, UARTBase*>::push(const uint32_t&);


7 changes: 2 additions & 5 deletions src/SoftwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef __SoftwareSerial_h
#define __SoftwareSerial_h

#include "circular_queue/circular_queue_mp.h"
#include "circular_queue/circular_queue.h"
#include <Stream.h>

namespace EspSoftwareSerial {
Expand Down Expand Up @@ -365,7 +365,7 @@ class UARTBase : public Stream {
#endif
// the ISR stores the relative bit times in the buffer. The inversion corrected level is used as sign bit (2's complement):
// 1 = positive including 0, 0 = negative.
std::unique_ptr<circular_queue_mp<uint32_t, UARTBase*> > m_isrBuffer;
std::unique_ptr<circular_queue<uint32_t, UARTBase*> > m_isrBuffer;
const Delegate<void(uint32_t&&), UARTBase*> m_isrBufferForEachDel { [](UARTBase* self, uint32_t&& isrTick) { self->rxBits(isrTick); }, this };
std::atomic<bool> m_isrOverflow { false };
uint32_t m_isrLastTick;
Expand Down Expand Up @@ -442,9 +442,6 @@ extern template void delegate::detail::DelegateImpl<void*, void>::operator()() c
extern template size_t circular_queue<uint32_t, EspSoftwareSerial::UARTBase*>::available() const;
extern template bool circular_queue<uint32_t, EspSoftwareSerial::UARTBase*>::push(uint32_t&&);
extern template bool circular_queue<uint32_t, EspSoftwareSerial::UARTBase*>::push(const uint32_t&);
extern template size_t circular_queue_mp<uint32_t, EspSoftwareSerial::UARTBase*>::available() const;
extern template bool circular_queue_mp<uint32_t, EspSoftwareSerial::UARTBase*>::push(uint32_t&&);
extern template bool circular_queue_mp<uint32_t, EspSoftwareSerial::UARTBase*>::push(const uint32_t&);

#endif // __SoftwareSerial_h

0 comments on commit 7a14d3e

Please sign in to comment.