59 lines
764 B
C
59 lines
764 B
C
|
|
|
|
#include "rtthread.h"
|
|
#include "stm32mp1xx.h"
|
|
#include "board.h"
|
|
#include "dev_flash.h"
|
|
#include "debug.h"
|
|
#include "stdlib.h"
|
|
#include "string.h"
|
|
|
|
#ifndef RT_THREAD
|
|
|
|
#define rt_interrupt_enter()
|
|
#define rt_interrupt_leave()
|
|
#define rt_mutex_create(...) 0
|
|
#define rt_mutex_delete(...)
|
|
#define rt_mutex_take(...)
|
|
#define rt_mutex_release(...)
|
|
|
|
#endif
|
|
|
|
typedef struct{
|
|
sys_param_def param;
|
|
}self_def;
|
|
|
|
static self_def g_self;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 保存参数
|
|
int flash_save_param(sys_param_def *par)
|
|
{
|
|
uint8_t *dst=(uint8_t *)&g_self.param;
|
|
uint8_t *src=(uint8_t *)par;
|
|
int size=sizeof(sys_param_def);
|
|
memcpy(dst,src,size);
|
|
return 0;
|
|
}
|
|
|
|
|
|
const sys_param_def *sys_param(void)
|
|
{
|
|
return &g_self.param;
|
|
}
|
|
|
|
|
|
|
|
const scheme_def *check_scheme(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|