Implement config_parser_reset_to_start()

This commit is contained in:
Mario Hüttel 2020-10-30 22:24:03 +01:00
parent 14b7bdbf19
commit dcec366b0a
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}