touch & sd working

This commit is contained in:
Adolfo Reyna
2026-01-28 17:22:15 -05:00
commit 57426c6e7d
197 changed files with 33728 additions and 0 deletions

22
fatfs_time.c Normal file
View File

@@ -0,0 +1,22 @@
/*-----------------------------------------------------------------------*/
/* Get current time for FatFS */
/*-----------------------------------------------------------------------*/
#include "ff.h"
#include "pico/stdlib.h"
/* Get current time */
DWORD get_fattime (void)
{
// Return a fixed timestamp (2024-01-01 00:00:00)
// In a real application, you would get this from an RTC
// Format: bit31:25=Year(0-127 +1980), bit24:21=Month(1-12), bit20:16=Day(1-31)
// bit15:11=Hour(0-23), bit10:5=Minute(0-59), bit4:0=Second/2(0-29)
return ((DWORD)(2024 - 1980) << 25) // Year: 2024
| ((DWORD)1 << 21) // Month: January
| ((DWORD)1 << 16) // Day: 1
| ((DWORD)0 << 11) // Hour: 0
| ((DWORD)0 << 5) // Minute: 0
| ((DWORD)0 >> 1); // Second: 0
}