aboutsummaryrefslogtreecommitdiff
path: root/stmhal/lexerfatfs.c
diff options
context:
space:
mode:
authorDamien George2014-03-17 14:04:19 +0000
committerDamien George2014-03-17 14:04:19 +0000
commitb92d3e1fded0ad335f7a2c8c0f5dea91d258bae0 (patch)
treeada1f189c3fefe4f4fe3150cdb4b0d62b6162aa1 /stmhal/lexerfatfs.c
parent9e5ea4d768da3273b6d060cceffcc858e1c4827d (diff)
stmhal: Add fatfs support, working with flash and SD card.
Diffstat (limited to 'stmhal/lexerfatfs.c')
-rw-r--r--stmhal/lexerfatfs.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/stmhal/lexerfatfs.c b/stmhal/lexerfatfs.c
index 1910587d8..0d1bfe3e2 100644
--- a/stmhal/lexerfatfs.c
+++ b/stmhal/lexerfatfs.c
@@ -1,17 +1,13 @@
#include <stdint.h>
#include <stdio.h>
-#if 0
-#include "ff.h"
-#endif
-
#include "misc.h"
#include "mpconfig.h"
#include "qstr.h"
#include "lexer.h"
#include "lexerfatfs.h"
+#include "ff.h"
-#if 0
typedef struct _mp_lexer_file_buf_t {
FIL fp;
char buf[20];
@@ -40,10 +36,8 @@ static void file_buf_close(mp_lexer_file_buf_t *fb) {
f_close(&fb->fp);
m_del_obj(mp_lexer_file_buf_t, fb);
}
-#endif
mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
-#if 0
mp_lexer_file_buf_t *fb = m_new_obj(mp_lexer_file_buf_t);
FRESULT res = f_open(&fb->fp, filename, FA_READ);
if (res != FR_OK) {
@@ -55,7 +49,4 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
fb->len = n;
fb->pos = 0;
return mp_lexer_new(qstr_from_str(filename), fb, (mp_lexer_stream_next_char_t)file_buf_next_char, (mp_lexer_stream_close_t)file_buf_close);
-#else
- return NULL;
-#endif
}