Repository for import to local machine
Dependencies: DMBasicGUI DMSupport
SettingsHandler.h@8:26e49e6955bd, 2017-07-31 (annotated)
- Committer:
- jmitc91516
- Date:
- Mon Jul 31 15:37:57 2017 +0000
- Revision:
- 8:26e49e6955bd
- Parent:
- 1:a5258871b33d
Method ramp scrolling improved, and more bitmaps moved to QSPI memory
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmitc91516 | 1:a5258871b33d | 1 | #ifndef SETTINGSHANDLER_H |
jmitc91516 | 1:a5258871b33d | 2 | #define SETTINGSHANDLER_H |
jmitc91516 | 1:a5258871b33d | 3 | |
jmitc91516 | 1:a5258871b33d | 4 | #include "GuiLib.h" |
jmitc91516 | 1:a5258871b33d | 5 | |
jmitc91516 | 1:a5258871b33d | 6 | /* |
jmitc91516 | 1:a5258871b33d | 7 | This class contains static functions only. |
jmitc91516 | 1:a5258871b33d | 8 | These functions read and write settings values to QSPI memory. |
jmitc91516 | 1:a5258871b33d | 9 | |
jmitc91516 | 1:a5258871b33d | 10 | This is an alternative, more C++ like, way of implementing these functions |
jmitc91516 | 1:a5258871b33d | 11 | and making them available to the whole application, as opposed to simply having them |
jmitc91516 | 1:a5258871b33d | 12 | defined as ordinary C-style functions in main.cpp, with corresponding extern declarations |
jmitc91516 | 1:a5258871b33d | 13 | everywhere else. |
jmitc91516 | 1:a5258871b33d | 14 | |
jmitc91516 | 1:a5258871b33d | 15 | Earlier attempts to implement the same functionality using more conventional |
jmitc91516 | 1:a5258871b33d | 16 | object oriented class code led to lockups in totally unrelated areas - |
jmitc91516 | 1:a5258871b33d | 17 | until we find out why, stick with this... |
jmitc91516 | 1:a5258871b33d | 18 | |
jmitc91516 | 1:a5258871b33d | 19 | Note: a possible explanation for the earlier problems is that, |
jmitc91516 | 1:a5258871b33d | 20 | while I had un-commented '#define DM_BOARD_USE_QSPI' in dm_board_config.h, |
jmitc91516 | 1:a5258871b33d | 21 | I had *not* un-commented '#define DM_BOARD_USE_QSPI_FS'. This could have led |
jmitc91516 | 1:a5258871b33d | 22 | to invalid pointer values being used, etc. Since un-commenting both '#define's, |
jmitc91516 | 1:a5258871b33d | 23 | we have had no problems accessing QSPI memory (so far, at least...) |
jmitc91516 | 1:a5258871b33d | 24 | */ |
jmitc91516 | 1:a5258871b33d | 25 | class SettingsHandler { |
jmitc91516 | 1:a5258871b33d | 26 | public: |
jmitc91516 | 1:a5258871b33d | 27 | static int GetSettingValueFromQSPI(char *settingName, char *settingValueBuff, int valueBuffLen); |
jmitc91516 | 1:a5258871b33d | 28 | static int PutSettingValueToQSPI(char *settingName, char *settingValueBuff, int valueBuffLen); |
jmitc91516 | 1:a5258871b33d | 29 | static int GetIntegerValueFromQSPISettings(char *settingName, int defaultValue); |
jmitc91516 | 1:a5258871b33d | 30 | static void PutIntegerValueToQSPISettings(char *settingName, int value); |
jmitc91516 | 1:a5258871b33d | 31 | |
jmitc91516 | 1:a5258871b33d | 32 | static void DisplayQSPIDirectory(GuiConst_INT16S X, GuiConst_INT16S Y); |
jmitc91516 | 1:a5258871b33d | 33 | |
jmitc91516 | 1:a5258871b33d | 34 | private: |
jmitc91516 | 1:a5258871b33d | 35 | // Private constructor - so this class cannot be instantiated |
jmitc91516 | 1:a5258871b33d | 36 | SettingsHandler(); |
jmitc91516 | 1:a5258871b33d | 37 | |
jmitc91516 | 1:a5258871b33d | 38 | static void FormatQSPIIfRequired(void); |
jmitc91516 | 1:a5258871b33d | 39 | }; |
jmitc91516 | 1:a5258871b33d | 40 | |
jmitc91516 | 1:a5258871b33d | 41 | #endif // SETTINGSHANDLER_H |