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:
@@ -53,11 +53,11 @@ struct CachedStorage
|
||||
{
|
||||
bool initialized;
|
||||
unsigned int pageNumber;
|
||||
unsigned int cacheSize;
|
||||
size_t cacheSize;
|
||||
bool dirty;
|
||||
struct MemoryDevice* memoryDevice;
|
||||
uint8_t storage[CACHED_STORAGE_PAGESIZE * 4]; // Times 4 to get 32bit width
|
||||
uint8_t tempBuffer[CACHED_STORAGE_PAGESIZE * 4]; // Times 4 to get 32bit width
|
||||
uint32_t* storage;
|
||||
uint32_t* tempBuffer;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -68,23 +68,13 @@ struct CachedStorage
|
||||
/**
|
||||
* Initializes the EEPROM hardware and reads the flash page
|
||||
*/
|
||||
ErrorStatus CachedStorage_construct(struct CachedStorage* self, struct MemoryDevice* memoryDevice, unsigned int pageNumber);
|
||||
ErrorStatus CachedStorage_construct(struct CachedStorage* self, struct MemoryDevice* memoryDevice, unsigned int pageNumber, size_t cacheSize);
|
||||
|
||||
/**
|
||||
* Terminates the EEPROM hardware. SPI port is available again
|
||||
*/
|
||||
void CachedStorage_destruct(struct CachedStorage* self);
|
||||
|
||||
/**
|
||||
* Writes one byte to the storage buffer
|
||||
*/
|
||||
void CachedStorage_writeByte(struct CachedStorage* self, int offset, uint8_t value);
|
||||
|
||||
/**
|
||||
* Writes two bytes to the storage buffer
|
||||
*/
|
||||
void CachedStorage_writeHalfWord(struct CachedStorage* self, int offset, uint16_t value);
|
||||
|
||||
/**
|
||||
* Writes four bytes to the storage buffer
|
||||
*/
|
||||
@@ -95,15 +85,6 @@ void CachedStorage_writeWord(struct CachedStorage* self, int offset, uint32_t va
|
||||
*/
|
||||
void CachedStorage_writeBlob(struct CachedStorage* self, int offset, const void* blob, size_t blobSize);
|
||||
|
||||
/**
|
||||
* Reads one byte from the storage buffer
|
||||
*/
|
||||
uint8_t CachedStorage_readByte(struct CachedStorage* self, int offset);
|
||||
|
||||
/**
|
||||
* Reads two bytes from the storage buffer
|
||||
*/
|
||||
uint16_t CachedStorage_readHalfWord(struct CachedStorage* self, int offset);
|
||||
|
||||
/**
|
||||
* Reads four bytes from the storage buffer
|
||||
|
||||
@@ -56,12 +56,15 @@ struct DisplayDevice;
|
||||
|
||||
typedef ErrorStatus (*DisplayResetFunction)(const struct DisplayDevice* self);
|
||||
typedef ErrorStatus (*DisplaySetStateFunction)(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||
typedef ErrorStatus (*DisplayBackspaceFunction)(const struct DisplayDevice* self);
|
||||
typedef ErrorStatus (*DisplayCursorPositionFunction)(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
||||
typedef ErrorStatus (*DisplayWriteFunction)(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
|
||||
typedef ErrorStatus (*DisplayClearFunction)(const struct DisplayDevice* self);
|
||||
typedef ErrorStatus (*DisplayClearLineFunction)(const struct DisplayDevice* self, size_t row);
|
||||
typedef ErrorStatus (*DisplaySetBrightnessFunction)(const struct DisplayDevice* self, size_t brightness);
|
||||
typedef ErrorStatus (*DisplaySetContrastFunction)(const struct DisplayDevice* self, size_t contrast);
|
||||
typedef ErrorStatus (*DisplayInvertFunction)(const struct DisplayDevice* self);
|
||||
typedef ErrorStatus (*DisplaySetBlinkingCursor)(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||
|
||||
struct DisplayDeviceParameters
|
||||
{
|
||||
@@ -77,12 +80,15 @@ struct DisplayDevice
|
||||
{
|
||||
DisplayResetFunction _reset;
|
||||
DisplaySetStateFunction _setState;
|
||||
DisplayBackspaceFunction _backspace;
|
||||
DisplayCursorPositionFunction _setCursorToPosition;
|
||||
DisplayWriteFunction _write;
|
||||
DisplayClearFunction _clear;
|
||||
DisplayClearLineFunction _clearLine;
|
||||
DisplaySetBrightnessFunction _setBrightness;
|
||||
DisplaySetContrastFunction _setContrast;
|
||||
DisplayInvertFunction _invert;
|
||||
DisplaySetBlinkingCursor _setBlinkingCursor;
|
||||
struct DisplayDeviceParameters parameters;
|
||||
bool initialized;
|
||||
};
|
||||
@@ -94,20 +100,26 @@ struct DisplayDevice
|
||||
extern ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct DisplayDeviceParameters* parameters,
|
||||
DisplayResetFunction reset,
|
||||
DisplaySetStateFunction setState,
|
||||
DisplayBackspaceFunction backspace,
|
||||
DisplayCursorPositionFunction setCursorToPosition,
|
||||
DisplayWriteFunction write,
|
||||
DisplayClearFunction clear,
|
||||
DisplayClearLineFunction clearLine,
|
||||
DisplaySetBrightnessFunction setBrightness,
|
||||
DisplaySetContrastFunction setContrast,
|
||||
DisplayInvertFunction invert);
|
||||
DisplayInvertFunction invert,
|
||||
DisplaySetBlinkingCursor setBlinkingCursor);
|
||||
|
||||
extern ErrorStatus DisplayDevice_reset(const struct DisplayDevice* self);
|
||||
extern ErrorStatus DisplayDevice_setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||
extern ErrorStatus DisplayDevice_backspace(const struct DisplayDevice* self);
|
||||
extern ErrorStatus DisplayDevice_setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
||||
extern ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
|
||||
extern ErrorStatus DisplayDevice_clear(const struct DisplayDevice* self);
|
||||
extern ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, size_t row);
|
||||
extern ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, size_t brightness);
|
||||
extern ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, size_t contrast);
|
||||
extern ErrorStatus DisplayDevice_invert(const struct DisplayDevice* self);
|
||||
extern ErrorStatus DisplayDevice_setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||
|
||||
#endif /* INC_DISPLAYDEVICE_H_ */
|
||||
|
||||
Reference in New Issue
Block a user