Original programm

Dependencies:   RTC8563 mbed

Fork of rtc_class by HIMBED_3AHELI

Committer:
bulmecisco
Date:
Thu Apr 23 10:44:24 2015 +0000
Revision:
9:83be0e4edb52
Parent:
8:54a6f83a2339
5. Ueberladene Methoden in Klasse Date und using::GetDay in Klasse Datestring

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bulmecisco 6:ebe2350041f1 1 #include "DateString.h"
bulmecisco 6:ebe2350041f1 2 #include "RTC8563.h"
bulmecisco 7:1e1e0af5d32e 3 // https://developer.mbed.org/teams/HIMBED_3AHELI/code/rtc_func/wiki/Klasse-DateString-von-Date-ableiten
bulmecisco 6:ebe2350041f1 4
bulmecisco 6:ebe2350041f1 5 // 2. Methode ueberschreiben
bulmecisco 6:ebe2350041f1 6 uint8_t DateString::GetDay()
bulmecisco 6:ebe2350041f1 7 {
bulmecisco 6:ebe2350041f1 8 //uint8_t day = rtc_read(DAYS);
bulmecisco 6:ebe2350041f1 9 //return bcdToUint(day & 0x3F);
bulmecisco 6:ebe2350041f1 10
bulmecisco 6:ebe2350041f1 11 uint8_t day = Date::GetDay(); // Aufruf der GetDay-Methode aus Basisklasse Date mit Scope-Operator
bulmecisco 6:ebe2350041f1 12 // 3. Erweitern von Methoden der Basisklasse
bulmecisco 6:ebe2350041f1 13 day = day-5;
bulmecisco 6:ebe2350041f1 14 return day;
bulmecisco 8:54a6f83a2339 15 }
bulmecisco 8:54a6f83a2339 16
bulmecisco 8:54a6f83a2339 17 // 4. Definieren neuer Methoden
bulmecisco 8:54a6f83a2339 18 uint8_t DateString::GetNextDay()
bulmecisco 8:54a6f83a2339 19 {
bulmecisco 8:54a6f83a2339 20 uint8_t day = GetDay();
bulmecisco 8:54a6f83a2339 21 return ++day;
bulmecisco 8:54a6f83a2339 22 }
bulmecisco 8:54a6f83a2339 23
bulmecisco 8:54a6f83a2339 24
bulmecisco 8:54a6f83a2339 25
bulmecisco 8:54a6f83a2339 26
bulmecisco 8:54a6f83a2339 27
bulmecisco 8:54a6f83a2339 28
bulmecisco 8:54a6f83a2339 29