Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PreferenceWriter/PreferenceWriter.h@0:571a1835428e, 2021-01-25 (annotated)
- Committer:
- shaorui
- Date:
- Mon Jan 25 08:36:48 2021 +0000
- Revision:
- 0:571a1835428e
1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| shaorui | 0:571a1835428e | 1 | #ifndef __PREFERENCE_WRITER_H |
| shaorui | 0:571a1835428e | 2 | #define __PREFERENCE_WRITER_H |
| shaorui | 0:571a1835428e | 3 | |
| shaorui | 0:571a1835428e | 4 | #include "mbed.h" |
| shaorui | 0:571a1835428e | 5 | #include "FlashWriter.h" |
| shaorui | 0:571a1835428e | 6 | |
| shaorui | 0:571a1835428e | 7 | class PreferenceWriter { |
| shaorui | 0:571a1835428e | 8 | public: |
| shaorui | 0:571a1835428e | 9 | PreferenceWriter(uint32_t sector); |
| shaorui | 0:571a1835428e | 10 | void open(); |
| shaorui | 0:571a1835428e | 11 | bool ready(); |
| shaorui | 0:571a1835428e | 12 | void write(int x, int index); |
| shaorui | 0:571a1835428e | 13 | void write(float x, int index); |
| shaorui | 0:571a1835428e | 14 | void flush(); |
| shaorui | 0:571a1835428e | 15 | void load(); |
| shaorui | 0:571a1835428e | 16 | void close(); |
| shaorui | 0:571a1835428e | 17 | private: |
| shaorui | 0:571a1835428e | 18 | FlashWriter *writer; |
| shaorui | 0:571a1835428e | 19 | uint32_t __sector; |
| shaorui | 0:571a1835428e | 20 | bool __ready; |
| shaorui | 0:571a1835428e | 21 | }; |
| shaorui | 0:571a1835428e | 22 | |
| shaorui | 0:571a1835428e | 23 | #endif |