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.
memory.h@5:b73ea174e997, 2014-10-14 (annotated)
- Committer:
- dwini
- Date:
- Tue Oct 14 14:54:32 2014 +0000
- Revision:
- 5:b73ea174e997
- Parent:
- 4:f537311ddc53
Refactored to simpler message protocol
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dwini | 4:f537311ddc53 | 1 | #ifndef MEMORY_HEADER |
dwini | 4:f537311ddc53 | 2 | #define MEMORY_HEADER |
dwini | 4:f537311ddc53 | 3 | |
dwini | 4:f537311ddc53 | 4 | class Memory { |
dwini | 4:f537311ddc53 | 5 | |
dwini | 4:f537311ddc53 | 6 | public: |
dwini | 5:b73ea174e997 | 7 | const static int MEMORY_SIZE = 32; |
dwini | 4:f537311ddc53 | 8 | |
dwini | 4:f537311ddc53 | 9 | private: |
dwini | 4:f537311ddc53 | 10 | int memory[MEMORY_SIZE]; |
dwini | 4:f537311ddc53 | 11 | |
dwini | 4:f537311ddc53 | 12 | public: |
dwini | 4:f537311ddc53 | 13 | Memory(); |
dwini | 4:f537311ddc53 | 14 | void reset(); |
dwini | 4:f537311ddc53 | 15 | void set(int address, int value); |
dwini | 4:f537311ddc53 | 16 | int get(int address); |
dwini | 4:f537311ddc53 | 17 | void print(); |
dwini | 4:f537311ddc53 | 18 | }; |
dwini | 4:f537311ddc53 | 19 | |
dwini | 4:f537311ddc53 | 20 | |
dwini | 4:f537311ddc53 | 21 | #endif |