forked from Makuna/NeoPixelBus
Fixed (#845)
This commit is contained in:
@@ -330,6 +330,15 @@ public:
|
||||
void SetPixelSettings(const typename T_COLOR_FEATURE::SettingsObject& settings)
|
||||
{
|
||||
T_COLOR_FEATURE::applySettings(_method.getData(), _method.getDataSize(), settings);
|
||||
if (_method.SwapBuffers())
|
||||
{
|
||||
// some methods have two internal buffers
|
||||
// so need to swap so settings are stored in both copies
|
||||
//
|
||||
T_COLOR_FEATURE::applySettings(_method.getData(), _method.getDataSize(), settings);
|
||||
// swap back to minimize inconsistencies
|
||||
_method.SwapBuffers();
|
||||
}
|
||||
Dirty();
|
||||
};
|
||||
|
||||
|
@@ -188,6 +188,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data + _sizeStartFrame;
|
||||
|
@@ -110,6 +110,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -101,6 +101,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -106,6 +106,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -106,6 +106,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -129,6 +129,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -97,6 +97,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -244,6 +244,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -282,6 +282,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -841,6 +841,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -654,6 +654,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -651,6 +651,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
std::swap(_dataSending, _dataEditing);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _dataEditing;
|
||||
|
@@ -271,6 +271,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -213,6 +213,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data + T_SPEED::HeaderSize;
|
||||
|
@@ -205,6 +205,11 @@ protected:
|
||||
ptr = const_cast<uint8_t*>(T_UARTCONTEXT::FillUartFifo(T_UARTFEATURE::Index, ptr, end));
|
||||
}
|
||||
}
|
||||
|
||||
bool SwapUartBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// this template method class is used to glue uart feature and context for
|
||||
@@ -274,6 +279,12 @@ protected:
|
||||
std::swap(_dataSending, _data);
|
||||
}
|
||||
|
||||
bool SwapUartBuffers()
|
||||
{
|
||||
std::swap(_dataSending, _data);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
T_UARTCONTEXT _context;
|
||||
|
||||
@@ -420,6 +431,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return this->SwapUartBuffers();
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return this->_data;
|
||||
|
@@ -262,6 +262,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -429,6 +429,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -102,6 +102,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -86,6 +86,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -271,6 +271,12 @@ Serial.println();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
std::swap(_dataSending, _dataEditing);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _dataEditing;
|
||||
|
@@ -109,6 +109,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -170,6 +170,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -157,6 +157,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
@@ -108,6 +108,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* getData() const
|
||||
{
|
||||
return _data;
|
||||
|
Reference in New Issue
Block a user