Skip to content

Commit f116b1e

Browse files
committed
psoc6/modtime: Try fix overflow error.
Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
1 parent d337f15 commit f116b1e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ports/psoc6/modtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ static mp_obj_t mp_time_time_get(void) {
101101
mp_raise_ValueError(MP_ERROR_TEXT("cyhal_rtc_read failed !"));
102102
}
103103

104-
return mp_obj_new_int_from_ull(timeutils_seconds_since_epoch(current_date_time.tm_year, current_date_time.tm_mon, current_date_time.tm_mday,
104+
return timeutils_obj_from_timestamp(timeutils_seconds_since_epoch(current_date_time.tm_year, current_date_time.tm_mon, current_date_time.tm_mday,
105105
current_date_time.tm_hour, current_date_time.tm_min, current_date_time.tm_sec));
106106
}

tests/ports/psoc6/board_only_hw/single/modtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def spot_test(seconds, expected_time):
5757
spot_test(3599, (1970, 1, 1, 0, 59, 59, 3, 1))
5858
spot_test(3600, (1970, 1, 1, 1, 0, 0, 3, 1))
5959
spot_test(-1, (1969, 12, 31, 23, 59, 59, 2, 365))
60-
# spot_test(447549467, (1984, 3, 7, 23, 17, 47, 2, 67))
60+
spot_test(447549467, (1984, 3, 7, 23, 17, 47, 2, 67))
6161
spot_test(-940984933, (1940, 3, 7, 23, 17, 47, 3, 67))
6262
spot_test(-1072915199, (1936, 1, 2, 0, 0, 1, 3, 2))
6363
spot_test(-1072915200, (1936, 1, 2, 0, 0, 0, 3, 2))

0 commit comments

Comments
 (0)