Skip to content

Commit

Permalink
Resize param data type
Browse files Browse the repository at this point in the history
- day max value is 31 (need to 8 bit) and month max value is 12 (need to 4 bit), and weekday is 7.. so need to 4 bit
  • Loading branch information
RuffaloLavoisier committed Sep 16, 2024
1 parent 0f51850 commit 96c70a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hal/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ time_t OswHal::getTime(time_t& offset) {
return this->getUTCTime() + offset;
}

void OswHal::getDate(time_t& offset, uint32_t* day, uint32_t* weekDay) {
void OswHal::getDate(time_t& offset, uint8_t* day, uint8_t* weekDay) {
RtcDateTime d = RtcDateTime();
d.InitWithUnix32Time(this->getTime(offset));
*weekDay = d.DayOfWeek();
*day = d.Day();
}

void OswHal::getDate(time_t& offset, uint32_t* day, uint32_t* month, uint32_t* year) {
void OswHal::getDate(time_t& offset, uint8_t* day, uint8_t* month, uint32_t* year) {
RtcDateTime d = RtcDateTime();
d.InitWithUnix32Time(this->getTime(offset));
*day = d.Day();
Expand Down

0 comments on commit 96c70a2

Please sign in to comment.