color code mapping

This commit is contained in:
Yunhorn 2024-04-14 17:04:18 +08:00
parent c5e4e47ee5
commit ba5c46449c
2 changed files with 15 additions and 5 deletions

View File

@ -80,7 +80,6 @@ extern SysTime_t mems_event_time;
extern volatile uint32_t event_start_time, event_stop_time;
uint8_t luminance_level = DEFAULT_LUMINANCE_LEVEL;
void STS_YunhornSTSEventP1_Process(void)
{
STS_Lamp_Bar_Refresh();

View File

@ -120,6 +120,17 @@ extern volatile uint8_t sensor_data_ready;
extern volatile STS_OO_SensorStatusDataTypeDef sts_o7_sensorData;
extern volatile float sts_distance_rss_distance;
volatile uint8_t sts_presence_fall_detection;
char sts_lamp_color_code[10][10]={
"Dark",
"Green",
"Red",
"Blue",
"Yellow",
"Pink",
"Cyan",
"White",
"Red_Blue",
};
#endif
/* USER CODE END EV */
@ -825,8 +836,8 @@ static uint8_t PrepareSendTxData(void)
AppData.Buffer[i++] = (uint8_t)(0xFF & sts_occupancy_overtime_state); //08 occupancy over time or not
APP_LOG(TS_OFF, VLEVEL_L,
"\r\n######| Color Mode S2 |Distance(mm) MotionScore|"
"\r\n######| %1d %1d %1d |%04d %04d |\r\n",
AppData.Buffer[0], AppData.Buffer[1], AppData.Buffer[2], (uint16_t)o7_data.rss_presence_distance,(uint16_t)o7_data.rss_presence_score);
"\r\n######| %s %1d %1d |%04d %04d |\r\n",
(char*)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], AppData.Buffer[1], AppData.Buffer[2], (uint16_t)o7_data.rss_presence_distance,(uint16_t)o7_data.rss_presence_score);
break;
@ -849,8 +860,8 @@ static uint8_t PrepareSendTxData(void)
AppData.Buffer[i++] = (uint8_t)(0xFF & sts_occupancy_overtime_state); //11 occupancy over time or not
APP_LOG(TS_OFF, VLEVEL_L,
"\r\n######| Color Mode S1 S2 S3 S4 |Distance(mm) MotionScore|"
"\r\n######| %1d %1d %1d %1d %1d %1d |%04d %04d |\r\n",
AppData.Buffer[0], AppData.Buffer[1],AppData.Buffer[2], AppData.Buffer[3],AppData.Buffer[4], AppData.Buffer[5], (uint16_t)o7_data.rss_presence_distance,(uint16_t)o7_data.rss_presence_score);
"\r\n######| %s %1d %1d %1d %1d %1d |%04d %04d |\r\n",
(char *)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], AppData.Buffer[1],AppData.Buffer[2], AppData.Buffer[3],AppData.Buffer[4], AppData.Buffer[5], (uint16_t)o7_data.rss_presence_distance,(uint16_t)o7_data.rss_presence_score);
break;
}