add MEMS not installed error in seft function testing report S....X
This commit is contained in:
parent
e6e6680177
commit
c4bc2911c4
|
@ -421,6 +421,7 @@ void STS_MOTION_SENSOR_Power_OFF(void);
|
||||||
void STS_SENSOR_Upload_Config_Invalid_Message(void);
|
void STS_SENSOR_Upload_Config_Invalid_Message(void);
|
||||||
void STS_SENSOR_Upload_Message(uint8_t appDataPort, uint8_t appBufferSize, char *appDataBuffer);
|
void STS_SENSOR_Upload_Message(uint8_t appDataPort, uint8_t appBufferSize, char *appDataBuffer);
|
||||||
void STS_SENSOR_Auto_Responder_Process(uint8_t tlv_ver,uint8_t tlv_type, uint8_t tlv_length, uint8_t *tlv_content);
|
void STS_SENSOR_Auto_Responder_Process(uint8_t tlv_ver,uint8_t tlv_type, uint8_t tlv_length, uint8_t *tlv_content);
|
||||||
|
uint8_t STS_SENSOR_MEMS_Get_ID(uint8_t *devID);
|
||||||
|
|
||||||
void STS_M7_GetValue(void);
|
void STS_M7_GetValue(void);
|
||||||
void STS_M7_SineWaveTest(uint16_t cycles);
|
void STS_M7_SineWaveTest(uint16_t cycles);
|
||||||
|
|
|
@ -414,6 +414,20 @@ void STS_MOTION_SENSOR_Disable_Wake_Up_Detection(void)
|
||||||
// DISABLE Activity and In-Activity detection
|
// DISABLE Activity and In-Activity detection
|
||||||
ADXL345_SetRegisterValue(ADXL345_REG_ACT_INACT_CTL, 0x00);
|
ADXL345_SetRegisterValue(ADXL345_REG_ACT_INACT_CTL, 0x00);
|
||||||
|
|
||||||
|
}
|
||||||
|
uint8_t STS_SENSOR_MEMS_Get_ID(uint8_t *devID)
|
||||||
|
{
|
||||||
|
uint8_t scanned_id = 0x00;
|
||||||
|
#ifdef YUNHORN_STS_M7_ENABLED
|
||||||
|
scanned_id = ADXL345_GetDeviceIDValue();
|
||||||
|
*devID = scanned_id;
|
||||||
|
if (scanned_id == ADXL345_ID) {
|
||||||
|
return *devID;
|
||||||
|
} else {
|
||||||
|
return 0x00;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void STS_SENSOR_Power_ON(uint8_t cnt)
|
void STS_SENSOR_Power_ON(uint8_t cnt)
|
||||||
|
|
|
@ -1496,10 +1496,7 @@ void OnRestoreSTSCFGContextProcess(void)
|
||||||
void STS_SENSOR_Function_Test_Process(void)
|
void STS_SENSOR_Function_Test_Process(void)
|
||||||
{
|
{
|
||||||
char outbuf[32] =""; uint8_t i=0, count=10;
|
char outbuf[32] =""; uint8_t i=0, count=10;
|
||||||
int16_t self_test_result[9]={0,0,0,0, 0,0,0, 0,0};
|
uint8_t i2c_Slave_Dev_ID = 0x00;
|
||||||
|
|
||||||
#ifdef YUNHORN_STS_M7_ENABLED
|
|
||||||
STS_MOTION_SENSOR_Function_Test_Process(&self_test_result[0], count);
|
|
||||||
|
|
||||||
outbuf[i++] = (uint8_t) 'S';
|
outbuf[i++] = (uint8_t) 'S';
|
||||||
outbuf[i++] = (uint8_t) sts_mtmcode1;
|
outbuf[i++] = (uint8_t) sts_mtmcode1;
|
||||||
|
@ -1508,6 +1505,15 @@ void STS_SENSOR_Function_Test_Process(void)
|
||||||
outbuf[i++] = (uint8_t) sts_hardware_ver;
|
outbuf[i++] = (uint8_t) sts_hardware_ver;
|
||||||
outbuf[i++] = (uint8_t) (99*((GetBatteryLevel()/254)&0xff));
|
outbuf[i++] = (uint8_t) (99*((GetBatteryLevel()/254)&0xff));
|
||||||
|
|
||||||
|
if (STS_SENSOR_MEMS_Get_ID(&i2c_Slave_Dev_ID) == 0x00) {
|
||||||
|
outbuf[i++] = (uint8_t) 'X'; // Slave MEMS Not Avaliable
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
#ifdef YUNHORN_STS_M7_ENABLED
|
||||||
|
int16_t self_test_result[9]={0,0,0,0, 0,0,0, 0,0};
|
||||||
|
|
||||||
|
STS_MOTION_SENSOR_Function_Test_Process(&self_test_result[0], count);
|
||||||
|
|
||||||
outbuf[i++] = (uint8_t) (self_test_result[0]>>8)&0xff;
|
outbuf[i++] = (uint8_t) (self_test_result[0]>>8)&0xff;
|
||||||
outbuf[i++] = (uint8_t) (self_test_result[0])&0xff;
|
outbuf[i++] = (uint8_t) (self_test_result[0])&0xff;
|
||||||
|
|
||||||
|
@ -1534,11 +1540,10 @@ void STS_SENSOR_Function_Test_Process(void)
|
||||||
|
|
||||||
outbuf[i++] = (uint8_t) (self_test_result[8]>>8)&0xff;
|
outbuf[i++] = (uint8_t) (self_test_result[8]>>8)&0xff;
|
||||||
outbuf[i++] = (uint8_t) (self_test_result[8])&0xff;
|
outbuf[i++] = (uint8_t) (self_test_result[8])&0xff;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
STS_SENSOR_Upload_Message(LORAWAN_USER_APP_CTRL_REPLY_PORT, i, outbuf);
|
STS_SENSOR_Upload_Message(LORAWAN_USER_APP_CTRL_REPLY_PORT, i, outbuf);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
||||||
[.ShellClassInfo]
|
[.ShellClassInfo]
|
||||||
IconResource=C:\WINDOWS\System32\SHELL32.dll,176
|
IconResource=C:\WINDOWS\System32\SHELL32.dll,88
|
||||||
[ViewState]
|
[ViewState]
|
||||||
Mode=
|
Mode=
|
||||||
Vid=
|
Vid=
|
||||||
|
|
Reference in New Issue