From dcec366b0a1f00a528c054de9321e94568520fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Fri, 30 Oct 2020 22:24:03 +0100 Subject: [PATCH] Implement config_parser_reset_to_start() --- stm-firmware/config-parser/config-parser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stm-firmware/config-parser/config-parser.c b/stm-firmware/config-parser/config-parser.c index 740173b..3d15e19 100644 --- a/stm-firmware/config-parser/config-parser.c +++ b/stm-firmware/config-parser/config-parser.c @@ -64,7 +64,14 @@ enum config_parser_ret config_parser_get_line(config_parser_handle_t handle, str enum config_parser_ret config_parser_reset_to_start(config_parser_handle_t handle) { + FRESULT res; + struct config_parser *p; config_parser_check_handle(handle); + p = CONFIG_PARSER(handle); + + res = f_rewind(&p->file); + if (res != FR_OK) + return CONFIG_PARSER_IOERR; return CONFIG_PARSER_OK; }