62 for (
int i = 0; i < dir->
num_files; i++) {
66 TRANSPARENT, 0,
"%-13s%c %c %s %02u%02u%02u %02u:%02u:%02u %u",
91 int size = (file->
fsize > 30) ? 29 : file->
fsize - 1;
95 buf[file->
fpos] =
'\0';
97 long num = strtol(&(buf[file->
fpos - 4]), NULL, 0);
105 sprintf(buf,
"%04d", num);
const char * text
The label of the button.
static BUTTON_STRUCT b_back
uint16_t txtcolor
The 16-bit text color.
FILE_STATUS filesystem_file_seek(FILE_HANDLE *handle, uint32_t offset)
uint32_t fsize
The total file size in bytes.
void tft_draw_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
unsigned sec
second/2 (0..29)
uint16_t y1
Top Left Y-Coordinate of Area.
static void leave(void *screen)
void tft_print_formatted(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char *format,...)
void tft_print_line(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char *text)
FILE_DATE_STRUCT fdate
Last modified date.
uint8_t fattrib
File/Directory Attributes.
uint16_t x1
Top Left X-Coordinate of Area.
uint16_t bgcolor
The 16-bit background color of the button.
static void update(void *screen)
TOUCH_AREA_STRUCT base
Basic geometry of the button. You only need to set the x1, y1, x2, y2 members of this struct...
uint16_t y2
Bottom Right Y-Coordinate of Area.
FILE_HANDLE * filesystem_file_open(const char *filename)
void filesystem_file_close(FILE_HANDLE *handle)
SCREEN_STRUCT * get_screen_filetest()
bool tft_draw_bitmap_file_unscaled(uint16_t x, uint16_t y, const char *filename)
char * fname
File/Directory name.
void tft_clear(uint16_t color)
uint16_t x2
Bottom Right X-Coordinate of Area.
unsigned year
year from 1980 (0..127)
uint16_t num_files
Number of files/directories in this directory.
unsigned month
month (1..12)
FILE_STATUS filesystem_file_write(FILE_HANDLE *handle, uint8_t *buf, uint32_t size)
static void b_back_cb(void *button)
unsigned min
minute (0..59
uint32_t fpos
The current byte-position in the file.
unsigned hour
hour (0..23)
static SCREEN_STRUCT screen
FILE_STRUCT * files
An array with num_files FILE_STRUCT entries.
void tft_draw_rectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
DIRECTORY_STRUCT * filesystem_dir_open(const char *path)
It's a directory and not a file.
File is readonly. You cannot write to it.
BUTTON_CALLBACK callback
Callback which is executed when the button is pressed.
uint8_t font
The number of the font to use.
static void enter(void *screen)
void filesystem_dir_close(DIRECTORY_STRUCT *dir)
FILE_TIME_STRUCT ftime
Last modified time.
FILE_STATUS filesystem_file_read(FILE_HANDLE *handle, uint8_t *buf, uint32_t size)
uint32_t fsize
File size in bytes. 0 for directories.