4 #include <drivers/fatfs/ff.h>
10 static void badge_browse_textfile_fd(FIL
*fd
) {
11 unsigned linecount
= 0;
14 char buf
[LINE_LENGTH
];
15 while(f_gets(buf
, LINE_LENGTH
, fd
)) {
20 if(FR_OK
!= f_lseek(fd
, 0)) {
24 char lines_buf
[linecount
][LINE_LENGTH
];
25 char const *lines
[linecount
];
28 for(i
= 0; i
< linecount
&& f_gets(lines_buf
[i
], LINE_LENGTH
, fd
); ++i
) {
29 lines
[i
] = lines_buf
[i
];
32 badge_scroll_text(lines
, i
);
35 void badge_browse_textfile(char const *fname
) {
37 if(FR_OK
== f_open(&fd
, fname
, FA_OPEN_EXISTING
| FA_READ
)) {
38 badge_browse_textfile_fd(&fd
);
This page took 0.043098 seconds and 5 git commands to generate.