Fixed HW validation menu

Fixed some minor issues/bugs

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@284 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-11-21 12:36:16 +00:00
parent 5ccc28e32d
commit ff01d92ea8
23 changed files with 395 additions and 182 deletions

View File

@@ -69,10 +69,11 @@ static int nhd0420_cursorRowOffset[NHD0420_NUMBER_OF_ROWS] =
static ErrorStatus setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
static ErrorStatus backspace(const struct DisplayDevice* self);
static ErrorStatus setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
static ErrorStatus writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column);
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column);
static ErrorStatus clear(const struct DisplayDevice* self);
static ErrorStatus setBrightness(const struct DisplayDevice* self, size_t brightness);
static ErrorStatus setContrast(const struct DisplayDevice* self, size_t contrast);
static ErrorStatus setBrightness(const struct DisplayDevice* self, unsigned int brightness);
static ErrorStatus setContrast(const struct DisplayDevice* self, unsigned int contrast);
static ErrorStatus setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
// -----------------------------------------------------------------------------
@@ -98,7 +99,7 @@ ErrorStatus NHD0420_construct(struct NHD0420* self, const struct IODevice* devic
ddParameters.contrastMin = NHD0420_CONTRAST_MIN;
ddParameters.contrastMax = NHD0420_CONTRAST_MAX;
returnValue = DisplayDevice_construct(&self->displayDevice, &ddParameters, NULL, setState, backspace, setCursorToPosition, write, clear, NULL, setBrightness, setContrast, NULL, setBlinkingCursorState);
returnValue = DisplayDevice_construct(&self->displayDevice, &ddParameters, NULL, setState, backspace, setCursorToPosition, writeCharacter, write, clear, NULL, setBrightness, setContrast, NULL, setBlinkingCursorState);
if (returnValue == SUCCESS)
{
@@ -170,7 +171,7 @@ ErrorStatus NHD0420_getSpiParameters(struct SpiParameters* parameters)
}
ErrorStatus NHD0420_setCursorToPosition(const struct NHD0420* self, size_t row, size_t column)
ErrorStatus NHD0420_setCursorToPosition(const struct NHD0420* self, unsigned int row, unsigned int column)
{
ErrorStatus returnValue = SUCCESS;
if (self->initialized)
@@ -357,7 +358,7 @@ ErrorStatus NHD0420_sendCommand(const struct NHD0420* self, char command)
}
ErrorStatus NHD0420_sendData(const struct NHD0420* self, const char* buffer, size_t length)
ErrorStatus NHD0420_sendData(const struct NHD0420* self, const char* buffer, unsigned int length)
{
ErrorStatus returnValue = SUCCESS;
if (self->initialized)
@@ -405,10 +406,34 @@ ErrorStatus setCursorToPosition(const struct DisplayDevice* self, unsigned int r
}
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column)
ErrorStatus writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column)
{
ErrorStatus returnValue = SUCCESS;
if (self->initialized)
{
if ((column) > NHD0420_NUMBER_OF_COLUMNS)
{
returnValue = ERROR;
}
// Set cursor on display
returnValue = NHD0420_setCursorToPosition((const struct NHD0420*)self, row, column);
if (returnValue == SUCCESS)
{
returnValue = NHD0420_sendData((const struct NHD0420*)self, buffer, 1);
}
}
else
{
returnValue = ERROR;
}
return returnValue;
}
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column)
{
///TODO REMOVE
// volatile int i;
ErrorStatus returnValue = SUCCESS;
if (self->initialized)
{
@@ -420,8 +445,6 @@ static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, s
// Set cursor on display
returnValue = NHD0420_setCursorToPosition((const struct NHD0420*)self, row, column);
// for (i = 0; i < 3000; i++);
if (returnValue == SUCCESS)
{
// Send one byte at a time (display requirement)
@@ -431,7 +454,6 @@ static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, s
returnValue = NHD0420_sendData((const struct NHD0420*)self, &buffer[loopcounter], 1);
}
}
// for (i = 0; i < 1000; i++);
}
else
{
@@ -455,7 +477,7 @@ static ErrorStatus clear(const struct DisplayDevice* self)
}
static ErrorStatus setBrightness(const struct DisplayDevice* self, size_t brightness)
static ErrorStatus setBrightness(const struct DisplayDevice* self, unsigned int brightness)
{
if (self->initialized)
{
@@ -468,7 +490,7 @@ static ErrorStatus setBrightness(const struct DisplayDevice* self, size_t bright
}
static ErrorStatus setContrast(const struct DisplayDevice* self, size_t contrast)
static ErrorStatus setContrast(const struct DisplayDevice* self, unsigned int contrast)
{
if (self->initialized)
{