当执行FRAMWrite_uint64((uint64_t *)FRAM_RECORD_ADDRESS,0); 时,后20*4会被修改为0
原来0xffffffff,0xffffffff,被改为0x0000ffff,0x00000000
当执行FRAMWrite_Long((uint32_t *)FRAM_RECORD_ADDRESS, 0);时,后10*4=40会被修改为0
原来0xffffffff,被改为0x0000ffff,
void FRAMWrite_uint64(uint64_t *pFRAM_write_ptr, uint64_t ui64data)
{
SYSCFG0 &= ~DFWP;
*pFRAM_write_ptr = ui64data;
SYSCFG0 |= DFWP;
}
void FRAMWrite_Long(uint32_t *pFRAM_write_ptr, uint32_t ui32data)
{
SYSCFG0 &= ~DFWP;
*pFRAM_write_ptr = ui32data;
SYSCFG0 |= DFWP;
}
#define FRAM_RECORD_ADDRESS 0x1812
FRAMWrite_uint64((uint64_t *)FRAM_RECORD_ADDRESS,0);
FRAMWrite_Long((uint32_t *)FRAM_RECORD_ADDRESS, 0);
此帖出自
小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
uint32_t *pAddress;
for(i=0;i<Freq_cn;i++)
{
pAddress = (uint32_t *)(FRAM_RECORD_Freq + i*4);
FRAMWrite_Long((uint32_t *)(pAddress),flow_Freq_k[i]);
}
for(i=0;i<Freq_cn;i++)
{
pAddress = (uint32_t *)(FRAM_RECORD_rate + i*4);
FRAMWrite_Long((uint32_t *)(pAddress),flow_rate_k[i]);
}
uint8_t i;
uint32_t *pAddress;
for(i=0;i<Freq_cn;i++)
{
pAddress = (uint32_t *)(FRAM_RECORD_Freq + i*4);
flow_Freq_k[i] = *((uint32_t *)pAddress);
}
for(i=0;i<Freq_cn;i++)
{
pAddress = (uint32_t *)(FRAM_RECORD_rate + i*4);
flow_rate_k[i] = *((uint32_t *)pAddress);
}
FRAMWrite_uint64((uint64_t *)FRAM_RECORD_ADDRESS,0); //写FRAM (刷新)
//FRAMWrite_Long((uint32_t *)FRAM_RECORD_ADDRESS, 0);
//FRAMWrite_uint16((uint16_t *)FRAM_RECORD_ADDRESS, 0);
一样的啊!
一周热门 更多>