Fixed some major issues with RAM shortage. Also moved the cached storage to a MALLOC design instead of fixed memory usage. Using freertos porteds malloc and free required to move to HEAP4 to make sure memory does not get fragmented.

Resized nearly all task stacks

Also: 
- Menu fixes for insertion. Almost done, just need to fix the negative voltage insertion for mcp and cathode
- Added Device parameters, must be filled in

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@271 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-11-07 15:50:25 +00:00
parent 27755498e6
commit 17207a3a4b
32 changed files with 1833 additions and 280 deletions

View File

@@ -67,10 +67,13 @@ 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 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 setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
// -----------------------------------------------------------------------------
// Function definitions
@@ -95,7 +98,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, write, clear, NULL, setBrightness, setContrast, NULL);
returnValue = DisplayDevice_construct(&self->displayDevice, &ddParameters, NULL, setState, backspace, setCursorToPosition, write, clear, NULL, setBrightness, setContrast, NULL, setBlinkingCursorState);
if (returnValue == SUCCESS)
{
@@ -390,6 +393,17 @@ static ErrorStatus setState(const struct DisplayDevice* self, DisplayDevice_func
return returnValue;
}
static ErrorStatus backspace(const struct DisplayDevice* self)
{
return NHD0420_useBackspace((const struct NHD0420*)self);
}
ErrorStatus setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column)
{
return NHD0420_setCursorToPosition((const struct NHD0420*)self, row, column);
}
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column)
{
@@ -462,3 +476,24 @@ static ErrorStatus setContrast(const struct DisplayDevice* self, size_t contrast
}
static ErrorStatus setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state)
{
ErrorStatus returnValue = SUCCESS;
if (self->initialized)
{
if (state == ON)
{
returnValue = NHD0420_turnOnBlinkingCursor((const struct NHD0420*)self);
}
else
{
returnValue = NHD0420_turnOffBlinkingCursor((const struct NHD0420*)self);
}
}
else
{
returnValue = ERROR;
}
return returnValue;
}