functions from rtc_func transferred to class RTC8563

Dependencies:   RTC8563 mbed

Fork of rtc_func by HIMBED_3AHELI

Goto Inhalt

DateString.cpp

Committer:
wolpra98
Date:
2015-04-30
Revision:
10:83960ae8a0ee

File content as of revision 10:83960ae8a0ee:

#include "DateString.h"
#include "RTC8563.h"

uint8_t DateString::GetDay()
{
    /*uint8_t day = rtc_read(DAYS);
    return bcdToUint(day&0x3F);*/
    uint8_t day = Date::GetDay();
    day=day-5;
    return day;
}
uint8_t DateString::GetMonth()
{
    uint8_t months = rtc_read(MONTHS);
    return bcdToUint(months);
}
uint8_t DateString::GetYear()
{
    uint8_t year = rtc_read(YEARS);
    return bcdToUint(year);
}
uint8_t DateString::GetNextDay()
{
    uint8_t day = GetDay();
    return ++day;
}
string DateString::GetDay(string str)
{
    string day= str + " In Date Day: " + toString(GetDay());
    return day;
}