You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't issue a proper pull request at the moment, but it's a really simple patch for tf_card.c so I'll just put it here for now:
DWORD get_fattime (void)
{
datetime_t t;
if (rtc_get_datetime(&t))
{
return (((t.year - 1980) << 25) + (t.month << 21) + (t.day << 16) + (t.hour << 11) + (t.min << 5) + (t.sec >> 1));
}
else
{
// Quoting the FatFs documentation, see http://elm-chan.org/fsw/ff/doc/fattime.html :
// "The get_fattime function shall return any valid time even if the system does not support
// a real time clock. If a zero is returned, the file will not have a valid timestamp."
return (((2024 - 1980) << 25) + (1 << 21) + (1 << 16)); // -> 2024, January 1, 00:00:00
}
}
...plus the associated Pico SDK #include and target_link_library for hardware_rtc elsewhere of course.
Hi all,
I can't issue a proper pull request at the moment, but it's a really simple patch for tf_card.c so I'll just put it here for now:
...plus the associated Pico SDK #include and target_link_library for hardware_rtc elsewhere of course.
Thanks,
BR//Karl @xoblite
The text was updated successfully, but these errors were encountered: