Added the message wordmap and worked on the OTA. Basically functional, but only checks the difference in version, not the actual version number.
LED matrix got row and column write actions
This commit is contained in:
@@ -88,6 +88,9 @@ class ledmatrix : public prgm_ledstrip
|
||||
|
||||
FunctionStatus setPixel(uint32_t row, uint32_t column, uint8_t red, uint8_t green, uint8_t blue);
|
||||
|
||||
FunctionStatus setRow(uint32_t row, uint8_t red, uint8_t green, uint8_t blue);
|
||||
FunctionStatus setColumn(uint32_t row, uint8_t red, uint8_t green, uint8_t blue);
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Protected Section
|
||||
|
||||
@@ -73,9 +73,18 @@ FunctionStatus ledmatrix::setOrientation(Orientation_t orientation)
|
||||
FunctionStatus ledmatrix::setPixel(uint32_t row, uint32_t column, uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
FunctionStatus returnValue = FUNCTION_STATUS_OK;
|
||||
|
||||
uint32_t index = 0;
|
||||
returnValue = calculateIndexFromCoordinates(row, column, &index);
|
||||
|
||||
|
||||
if ((row > highth) || (column > width))
|
||||
{
|
||||
returnValue = FUNCTION_STATUS_ERROR;
|
||||
}
|
||||
|
||||
if (returnValue == FUNCTION_STATUS_OK)
|
||||
{
|
||||
returnValue = calculateIndexFromCoordinates(row, column, &index);
|
||||
}
|
||||
|
||||
if (returnValue == FUNCTION_STATUS_OK)
|
||||
{
|
||||
@@ -90,6 +99,41 @@ FunctionStatus ledmatrix::setPixel(uint32_t row, uint32_t column, uint8_t red, u
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
FunctionStatus ledmatrix::setRow(uint32_t row, uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
FunctionStatus returnValue = FUNCTION_STATUS_OK;
|
||||
|
||||
for (uint32_t column = 0; column < width; column++)
|
||||
{
|
||||
returnValue = setPixel(row, column, red, green, blue);
|
||||
if (returnValue != FUNCTION_STATUS_OK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
FunctionStatus ledmatrix::setColumn(uint32_t column, uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
FunctionStatus returnValue = FUNCTION_STATUS_OK;
|
||||
|
||||
for (uint32_t row = 0; row < highth; row++)
|
||||
{
|
||||
returnValue = setPixel(row, column, red, green, blue);
|
||||
if (returnValue != FUNCTION_STATUS_OK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
FunctionStatus ledmatrix::calculateIndexFromCoordinates(uint32_t row, uint32_t column, uint32_t* index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user