Skip to content

Commit 326730d

Browse files
committed
alif/mbedtls: Implement the mbedTLS time function.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 46b366d commit 326730d

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

ports/alif/mbedtls/mbedtls_port.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,10 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include "py/obj.h"
27+
#include "py/mphal.h"
2828
#include "se_services.h"
2929
#include "mbedtls_config_port.h"
3030

31-
#if defined(MBEDTLS_HAVE_TIME)
32-
#include "shared/timeutils/timeutils.h"
33-
#include "mbedtls/platform_time.h"
34-
#endif
35-
3631
int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, size_t *olen) {
3732
uint32_t val = 0;
3833
int n = 0;
@@ -52,14 +47,7 @@ int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, size_t
5247
#if defined(MBEDTLS_HAVE_TIME)
5348

5449
time_t alif_mbedtls_time(time_t *timer) {
55-
// TODO implement proper RTC time
56-
unsigned int year = 2025;
57-
unsigned int month = 1;
58-
unsigned int date = 1;
59-
unsigned int hours = 12;
60-
unsigned int minutes = 0;
61-
unsigned int seconds = 0;
62-
return timeutils_seconds_since_epoch(year, month, date, hours, minutes, seconds);
50+
return mp_hal_time_get(NULL);
6351
}
6452

6553
#endif

0 commit comments

Comments
 (0)