g0b1vetx-board/middleware/easyflash/port/ef_api.c
2023-04-29 09:09:12 +08:00

45 lines
736 B
C

#include "stm32g0xx_hal.h"
#include <easyflash.h>
#include <stdlib.h>
#include <string.h>
// 获取uint32_t 的数值
uint32_t ef_get_integer(const char * key)
{
uint32_t integer = NULL;
char * value_ptr;
/* get the boot count number from Env */
value_ptr = ef_get_env (key);
integer = atol (value_ptr);
return integer;
}
// 获取double 的数值
double ef_get_double(const char * key)
{
double ffloat = NULL;
char * value_ptr;
/* get the boot count number from Env */
value_ptr = ef_get_env (key);
ffloat = atof (value_ptr);
return ffloat;
}
// 获取字符串的数值
char * ef_get_string(const char * key)
{
char * value_ptr;
/* get the boot count number from Env */
value_ptr = ef_get_env (key);
return value_ptr;
}