/*--------------------------------------------------------------------------------------
*  @file     ProgramData.c
*  @author   wulianwei
*  @version  base on stm32f0x   
*  @date     2022.01.17
*  @brief    程序运行数据
---------------------------------------------------------------------------------------*/
#include <string.h>
#include "stm32f10x_gpio.h"
#include "TypeDefine.h"
#include "FlashSetup.h"
#include "ProgramData.h"

uint8_t PROGRAM_INFO_DATA[PROGRAM_INFO_SIZE]={0};



RegistInfo *registInfo = (RegistInfo *)PROGRAM_INFO_DATA;

uint32_t *classification = (uint32_t *)(PROGRAM_INFO_DATA+sizeof(RegistInfo)); //输注信息

void ReadProgramData(void)
{
	FlashReadOperate((uint8_t*)PROGRAM_INFO_DATA, PROGRAM_INFO_SIZE,PROGRAM_INFO_ADDR);
}

void WriteProgramData(void)
{
	FlashWriteOperate((uint8_t*)PROGRAM_INFO_DATA,PROGRAM_INFO_SIZE,PROGRAM_INFO_ADDR);
}

void WriteInitProgramData(void)
{
	memset(PROGRAM_INFO_DATA,0,PROGRAM_INFO_SIZE);
	FlashWriteOperate((uint8_t*)PROGRAM_INFO_DATA,PROGRAM_INFO_SIZE,PROGRAM_INFO_ADDR);
}


