Contains necessary classes and functions for ELEC351
loggingMaster/dateAndTime.hpp@5:becb1545229d, 2018-01-09 (annotated)
- Committer:
- Luka_Danilovic
- Date:
- Tue Jan 09 11:25:52 2018 +0000
- Revision:
- 5:becb1545229d
- Parent:
- 2:e2b885367ba8
ELEC351 Library by Student 10497267; LCD driver is not working due to a bizarre bug I can not solve.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Luka_Danilovic | 0:f44c89c33601 | 1 | #ifndef __dateAndTime__ //Inclusion safeguards |
Luka_Danilovic | 0:f44c89c33601 | 2 | #define __dateAndTime__ |
Luka_Danilovic | 0:f44c89c33601 | 3 | |
Luka_Danilovic | 0:f44c89c33601 | 4 | |
Luka_Danilovic | 0:f44c89c33601 | 5 | typedef struct __attribute__ ((packed)) { // Store one after another |
Luka_Danilovic | 0:f44c89c33601 | 6 | |
Luka_Danilovic | 2:e2b885367ba8 | 7 | int day, mnt, yr; // Current Date |
Luka_Danilovic | 2:e2b885367ba8 | 8 | int sec, min, hr; // Current Time |
Luka_Danilovic | 2:e2b885367ba8 | 9 | |
Luka_Danilovic | 5:becb1545229d | 10 | } TDS_DT; // Type Def Struct _ Date Time |
Luka_Danilovic | 0:f44c89c33601 | 11 | |
Luka_Danilovic | 0:f44c89c33601 | 12 | |
Luka_Danilovic | 5:becb1545229d | 13 | class C_DT // Class _ Date Time |
Luka_Danilovic | 0:f44c89c33601 | 14 | { |
Luka_Danilovic | 0:f44c89c33601 | 15 | |
Luka_Danilovic | 5:becb1545229d | 16 | // Constructorless class - constructor not needed |
Luka_Danilovic | 0:f44c89c33601 | 17 | |
Luka_Danilovic | 0:f44c89c33601 | 18 | private: |
Luka_Danilovic | 2:e2b885367ba8 | 19 | TDS_DT date_time; // TDS_DT format of storing Date & Time |
Luka_Danilovic | 0:f44c89c33601 | 20 | |
Luka_Danilovic | 0:f44c89c33601 | 21 | public: |
Luka_Danilovic | 0:f44c89c33601 | 22 | TDS_DT getDT(); // Get Date & Time |
Luka_Danilovic | 2:e2b885367ba8 | 23 | void setD(int, int, int); // set Date |
Luka_Danilovic | 2:e2b885367ba8 | 24 | void setT(int, int, int); // Set Time |
Luka_Danilovic | 0:f44c89c33601 | 25 | |
Luka_Danilovic | 0:f44c89c33601 | 26 | }; |
Luka_Danilovic | 0:f44c89c33601 | 27 | |
Luka_Danilovic | 0:f44c89c33601 | 28 | #endif |