|
|
@ -360,7 +360,7 @@ static bool AK9757W_Set_XCOEF4_0_Parameter(void)
|
|
|
|
static bool AK9757W_Set_IR_TS_IT_Parameter(void)
|
|
|
|
static bool AK9757W_Set_IR_TS_IT_Parameter(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int error;
|
|
|
|
int error;
|
|
|
|
uint8_t i;
|
|
|
|
uint8_t i;
|
|
|
|
|
|
|
|
|
|
|
|
Eeprom_Get_Parameter(&ParameterInfo);
|
|
|
|
Eeprom_Get_Parameter(&ParameterInfo);
|
|
|
|
if(ParameterInfo.Parameter_Info.isSaveParameter == AK9757W_MAGIC_KEY)
|
|
|
|
if(ParameterInfo.Parameter_Info.isSaveParameter == AK9757W_MAGIC_KEY)
|
|
|
@ -376,24 +376,29 @@ static bool AK9757W_Set_IR_TS_IT_Parameter(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(ParameterInfo.Parameter_Info.CheckSum == CheckSum && readChipID == pHandler->SensorID)
|
|
|
|
if(ParameterInfo.Parameter_Info.CheckSum == CheckSum && readChipID == pHandler->SensorID)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
for(i = 0 ; i < 9 ; i ++)
|
|
|
|
for(i = 0 ; i < 9 ; i ++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[i] = ParameterInfo.Parameter_Buff[EE_INDEX_PA_53 + i];
|
|
|
|
pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[1+i] = ParameterInfo.Parameter_Buff[EE_INDEX_PA_53 + i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dbg_printf(LOG_LEVEL_DEBUG, "Parameter write eeprom\r\n");
|
|
|
|
dbg_printf(LOG_LEVEL_DEBUG, "Parameter write eeprom\r\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memcpy(&pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[0], &default_gir_oir_gts_ots_git_reg_data[1], (sizeof(default_gir_oir_gts_ots_git_reg_data)-1));
|
|
|
|
memcpy(&pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[0], &default_gir_oir_gts_ots_git_reg_data[0], (sizeof(default_gir_oir_gts_ots_git_reg_data)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memcpy(&pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[0], &default_gir_oir_gts_ots_git_reg_data[1], (sizeof(default_gir_oir_gts_ots_git_reg_data)-1));
|
|
|
|
memcpy(&pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[0], &default_gir_oir_gts_ots_git_reg_data[0], (sizeof(default_gir_oir_gts_ots_git_reg_data)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
error = I2C_Master_Write(TEMP_I2C_ADDRESS, &default_gir_oir_gts_ots_git_reg_data[0], sizeof(default_gir_oir_gts_ots_git_reg_data));
|
|
|
|
|
|
|
|
|
|
|
|
pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[0] = AK9757W_REG_PARAMETER;
|
|
|
|
|
|
|
|
pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[1] = 0xE0; // default value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error = I2C_Master_Write(TEMP_I2C_ADDRESS, &pHandler->IR_TS_IT_Info.IR_TS_IT_Buff[0], sizeof(pHandler->IR_TS_IT_Info.IR_TS_IT_Buff));
|
|
|
|
if(error != E_NO_ERROR)
|
|
|
|
if(error != E_NO_ERROR)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dbg_printf(LOG_LEVEL_DEBUG, "I2C IR_TS_IT write Error %d\r\n", error);
|
|
|
|
dbg_printf(LOG_LEVEL_DEBUG, "I2C IR_TS_IT write Error %d\r\n", error);
|
|
|
|