Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
46239413
Commit
46239413
authored
Feb 17, 2014
by
Damien George
Browse files
stm: Implement mp_import_stat.
To follow up pull request #309.
parent
4d0588df
Changes
3
Hide whitespace changes
Inline
Side-by-side
stm/Makefile
View file @
46239413
...
...
@@ -49,6 +49,7 @@ SRC_C = \
pendsv.c
\
gccollect.c
\
lexerfatfs.c
\
import.c
\
pyexec.c
\
led.c
\
gpio.c
\
...
...
stm/import.c
0 → 100644
View file @
46239413
#include
<stdint.h>
#include
"misc.h"
#include
"mpconfig.h"
#include
"qstr.h"
#include
"lexer.h"
#include
"ff.h"
mp_import_stat_t
mp_import_stat
(
const
char
*
path
)
{
FILINFO
fno
;
FRESULT
res
=
f_stat
(
path
,
&
fno
);
if
(
res
==
FR_OK
)
{
if
((
fno
.
fattrib
&
AM_DIR
)
!=
0
)
{
return
MP_IMPORT_STAT_DIR
;
}
else
{
return
MP_IMPORT_STAT_FILE
;
}
}
return
MP_IMPORT_STAT_NO_EXIST
;
}
stm/lexerfatfs.c
View file @
46239413
...
...
@@ -51,8 +51,3 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
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
);
}
mp_import_stat_t
mp_import_stat
(
const
char
*
path
)
{
// TODO implement me!
return
MP_IMPORT_STAT_NO_EXIST
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment