/* Calculates and updates the day of the week to weekDay field of the supplied rtcTime_t object based on the other values (year, day, etc.)  */
err_t rtcAssignWeekday(rtcTime_t *t)
/* Calculates and updates the day of the week to weekDay field of the supplied rtcTime_t object based on the other values (year, day, etc.)  */
err_t rtcAssignWeekday(rtcTime_t *t)
{
    uint32_t NrOfDay;
    NrOfDay = rtcGetEpochDate(t->years, t->months, t->days);
    t->weekdays = (NrOfDay + 3) % 7;
    return ERROR_NONE;
}