RTC on M0 and class design without rtc and target
Quote:
Example for training purposes only!!!
RTC/I2C data for target LPC11U24 Humer M0-Board and no data for others!!!
See RTC WIKI
Datestr.h@0:397b5462e6d7, 2018-11-15 (annotated)
- Committer:
- fpucher
- Date:
- Thu Nov 15 06:55:25 2018 +0000
- Revision:
- 0:397b5462e6d7
ifdef target
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fpucher | 0:397b5462e6d7 | 1 | #include "mbed.h" |
fpucher | 0:397b5462e6d7 | 2 | #include "const.h" |
fpucher | 0:397b5462e6d7 | 3 | #include "rtc.h" |
fpucher | 0:397b5462e6d7 | 4 | #include "string" |
fpucher | 0:397b5462e6d7 | 5 | #include "Date.h" |
fpucher | 0:397b5462e6d7 | 6 | |
fpucher | 0:397b5462e6d7 | 7 | #ifndef DATESTR_H |
fpucher | 0:397b5462e6d7 | 8 | #define DATESTR_H |
fpucher | 0:397b5462e6d7 | 9 | |
fpucher | 0:397b5462e6d7 | 10 | class A |
fpucher | 0:397b5462e6d7 | 11 | { |
fpucher | 0:397b5462e6d7 | 12 | protected: |
fpucher | 0:397b5462e6d7 | 13 | string test; |
fpucher | 0:397b5462e6d7 | 14 | public: |
fpucher | 0:397b5462e6d7 | 15 | void Print(int anzahl, string r); |
fpucher | 0:397b5462e6d7 | 16 | void Print(string r); |
fpucher | 0:397b5462e6d7 | 17 | }; |
fpucher | 0:397b5462e6d7 | 18 | class B : public A |
fpucher | 0:397b5462e6d7 | 19 | { |
fpucher | 0:397b5462e6d7 | 20 | private: |
fpucher | 0:397b5462e6d7 | 21 | int anzahl; |
fpucher | 0:397b5462e6d7 | 22 | public: |
fpucher | 0:397b5462e6d7 | 23 | void Print(string nr); |
fpucher | 0:397b5462e6d7 | 24 | using A::Print; |
fpucher | 0:397b5462e6d7 | 25 | }; |
fpucher | 0:397b5462e6d7 | 26 | |
fpucher | 0:397b5462e6d7 | 27 | |
fpucher | 0:397b5462e6d7 | 28 | |
fpucher | 0:397b5462e6d7 | 29 | |
fpucher | 0:397b5462e6d7 | 30 | class Datestr : public Date |
fpucher | 0:397b5462e6d7 | 31 | { |
fpucher | 0:397b5462e6d7 | 32 | private: |
fpucher | 0:397b5462e6d7 | 33 | string day, month, year; |
fpucher | 0:397b5462e6d7 | 34 | string toString(uint8_t value); |
fpucher | 0:397b5462e6d7 | 35 | |
fpucher | 0:397b5462e6d7 | 36 | public: |
fpucher | 0:397b5462e6d7 | 37 | // string day, month, year; |
fpucher | 0:397b5462e6d7 | 38 | Datestr() |
fpucher | 0:397b5462e6d7 | 39 | {} |
fpucher | 0:397b5462e6d7 | 40 | virtual string GetDay(uint8_t value); |
fpucher | 0:397b5462e6d7 | 41 | using Date::GetDay; // ermöglicht den Aufruf der Methode in Basisklasse Date, sonst Error 165 |
fpucher | 0:397b5462e6d7 | 42 | }; |
fpucher | 0:397b5462e6d7 | 43 | #endif |