OT6 with default color of vacant and occupy
This commit is contained in:
parent
4b6cf58ec9
commit
94ecc351fb
|
@ -75,7 +75,7 @@ enum sts_oo_work_mode {
|
|||
STS_REMOTE_REED_RSS_MODE, // 6 REMOTE REED SWITCH + RSS MODE 2023-05-04
|
||||
STS_DUAL_RSS_MODE, // 7 RSS_1 + RSS_2 IN TWO UNITS
|
||||
STS_TOF_RSS_MODE, // 8 TOF + RSS MODE
|
||||
STS_TOF_DISTANCE_MODE, // 9 TOF DISTANCE
|
||||
STS_TOF_DISTANCE_MODE, // 9 TOF DISTANCE O6T
|
||||
STS_TOF_PRESENCE_MODE, // A TOF PRESENCE OCCUPANCY
|
||||
STS_TOF_IN_OUT_MODE, // B TOF IN OUT COUNT
|
||||
STS_FALL_DETECTION_MODE, // C FALL DETECTION
|
||||
|
|
|
@ -56,8 +56,8 @@ extern volatile uint8_t sts_service_mask;
|
|||
extern volatile uint8_t sts_work_mode;
|
||||
volatile uint8_t sts_reed_hall_ext_int = 0;
|
||||
volatile uint8_t sts_status_color = STS_GREEN;
|
||||
volatile uint8_t sts_lamp_bar_color = STS_GREEN; //puColor
|
||||
volatile uint8_t sts_color_occupy_vacant = (STS_GREEN<<4)|(STS_RED&0x0f);
|
||||
volatile uint8_t sts_lamp_bar_color = STS_GREEN; //puColor
|
||||
volatile uint8_t sts_lamp_bar_flashing_color = STS_RED_DARK; //0x23; RED_BLUE;
|
||||
volatile uint8_t sts_cloud_netcolor = STS_GREEN; //netColor
|
||||
extern volatile uint8_t sts_occupancy_status;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1581009204476899933" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1759988577722177836" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
@ -16,7 +16,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1581009204476899933" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1759988577722177836" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
Binary file not shown.
|
@ -59,6 +59,9 @@ extern volatile sts_ppc_cfg_type_t ppc_cfg[];
|
|||
extern volatile uint8_t sts_status_color, sts_lamp_bar_color, sts_color_occupy_vacant;//puColor
|
||||
extern uint8_t luminance_level;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
volatile sts_cfg_nvm_t sts_cfg_nvm = {
|
||||
sts_mtmcode1,
|
||||
sts_mtmcode2,
|
||||
|
@ -105,7 +108,7 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
|
|||
0x00, //reserve --P[19]
|
||||
#endif
|
||||
}, // above 20 bytes
|
||||
0x21, // color occupy (red:2) | color vacant (green:1) or other 0x10 occupy(red:1) | color vacant (dark:0)
|
||||
0x20, // color occupy (red:2) | color vacant (green:1) or other 0x20 occupy(red:2) | color vacant (dark:0) for ATAL-HK 20241230
|
||||
0x00, //reserve3
|
||||
0x20, //sensor install height in dm =10 cm, default 32*10=320cm, 3.2meter
|
||||
|
||||
|
@ -126,7 +129,7 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
|
|||
volatile uint8_t nvm_store_value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0};
|
||||
volatile uint8_t sts_ac_code[20]={0x0};
|
||||
volatile uint8_t sts_service_mask=STS_SERVICE_MASK_L0;
|
||||
volatile uint8_t sts_work_mode=4;
|
||||
volatile uint8_t sts_work_mode= STS_TOF_DISTANCE_MODE; //4;
|
||||
volatile uint32_t rfac_timer=0;
|
||||
volatile uint16_t sts_sensor_install_height=3000;
|
||||
volatile uint8_t sensor_data_ready=0;
|
||||
|
@ -175,6 +178,8 @@ volatile uint8_t sts_water_leakage_result=0;
|
|||
volatile uint8_t sts_water_leakage_changed_flag=0;
|
||||
#endif
|
||||
|
||||
#define STS_COLOR_DEFAULT_VACANT (sts_color_occupy_vacant&0x0f)
|
||||
#define STS_COLOR_DEFAULT_OCCUPY ((sts_color_occupy_vacant>>4)&0x0f)
|
||||
|
||||
|
||||
#if (defined(YUNHORN_STS_O6_ENABLED) && defined(USE_ACCONEER_A111))
|
||||
|
@ -412,11 +417,13 @@ void STS_YunhornSTSEventP3_Process(void)
|
|||
#if (defined(STS_O6) ||defined(STS_O7)||defined(STS_T6))
|
||||
if (STS_Reed_Hall_State == STS_Status_Door_Open)
|
||||
{
|
||||
sts_lamp_bar_color =STS_GREEN;
|
||||
// sts_lamp_bar_color =STS_GREEN;
|
||||
sts_lamp_bar_color = STS_COLOR_DEFAULT_VACANT;
|
||||
}
|
||||
else
|
||||
{
|
||||
sts_lamp_bar_color =STS_RED;
|
||||
// sts_lamp_bar_color =STS_RED;
|
||||
sts_lamp_bar_color = STS_COLOR_DEFAULT_OCCUPY;
|
||||
}
|
||||
STS_Lamp_Bar_Scoller(sts_lamp_bar_color, luminance_level);
|
||||
#endif
|
||||
|
@ -665,10 +672,14 @@ void USER_APP_Parse_CMD_P(uint8_t *parse_buffer, uint8_t parse_buffer_size)
|
|||
// P 1 1 M C1 C2 Change default OCCUPANCY AND VACANT COLOR CODE
|
||||
case 6:
|
||||
|
||||
if (sts_work_mode == 1)
|
||||
//if ((sts_work_mode == STS_WIRED_MODE)||(sts_work_mode == STS_TOF_DISTANCE_MODE))
|
||||
{
|
||||
sts_cfg_nvm.color_occupy_vacant = ((uint8_t)(parse_buffer[CFG_CMD5]-0x30)<<4)|((uint8_t)(parse_buffer[CFG_CMD6]-0x30));
|
||||
sts_color_occupy_vacant = sts_cfg_nvm.color_occupy_vacant;
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Workmode=%d Color Occupy=%02X Vacant=%02X \r\n", sts_work_mode, STS_COLOR_DEFAULT_OCCUPY, STS_COLOR_DEFAULT_VACANT);
|
||||
}
|
||||
|
||||
break;
|
||||
case 12:
|
||||
break;
|
||||
|
@ -1417,6 +1428,14 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
|
|||
/* TODO XXX FOR NON STS-P2 */
|
||||
USER_APP_Parse_CMD_P(tlv_buf, parse_buffer_size);
|
||||
|
||||
|
||||
UTIL_MEM_set_8((void*)outbuf, 0x0, sizeof(outbuf));
|
||||
UTIL_MEM_cpy_8((void*)outbuf,(void*)tlv_buf, parse_buffer_size);
|
||||
|
||||
i = parse_buffer_size;
|
||||
|
||||
STS_SENSOR_Upload_Message(YUNHORN_STS_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
|
||||
|
||||
/* TODO XXX FOR NON STS-P2 */
|
||||
|
||||
break;
|
||||
|
@ -1759,9 +1778,10 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
sts_work_mode = sts_cfg_nvm.work_mode;
|
||||
sts_service_mask = sts_cfg_nvm.sts_service_mask;
|
||||
sts_color_occupy_vacant = sts_cfg_nvm.color_occupy_vacant;
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Color Occupy =%02x, VACANT =%02x \r\n",((sts_color_occupy_vacant>>4)&0x0f), sts_color_occupy_vacant&0x0f );
|
||||
|
||||
#ifdef YUNHORN_STS_O6_ENABLED
|
||||
sts_lamp_bar_color = STS_GREEN;
|
||||
sts_lamp_bar_color = STS_COLOR_DEFAULT_VACANT;
|
||||
sts_fall_detection_acc_threshold = (uint8_t)sts_cfg_nvm.fall_detection_acc_threshold*10;
|
||||
sts_fall_detection_depth_threshold = (uint8_t)sts_cfg_nvm.fall_detection_depth_threshold*10; //in cm
|
||||
// **** = sts_cfg_nvm.fall_detection_reserve;
|
||||
|
|
|
@ -24,7 +24,11 @@ extern volatile uint32_t STS_TOFScanPeriod_sec, STS_TxPeriod_sec, STS_HeartBeatT
|
|||
extern volatile sts_cfg_nvm_t sts_cfg_nvm;
|
||||
extern volatile uint8_t nvm_store_value[];
|
||||
volatile uint8_t sts_tof_presence_state=0, sts_tof_presence_state_changed=0, sts_tof_presence_distance_dm=0, sts_pir_state=0;
|
||||
extern volatile uint8_t sts_lamp_bar_color;
|
||||
extern volatile uint8_t sts_lamp_bar_color, sts_color_occupy_vacant;
|
||||
|
||||
#define STS_COLOR_DEFAULT_VACANT (sts_color_occupy_vacant&0x0f)
|
||||
#define STS_COLOR_DEFAULT_OCCUPY ((sts_color_occupy_vacant>>4)&0x0f)
|
||||
|
||||
/* TIMING_BUDGET, in ms possible values [15, 20, 50, 100, 200, 500] */
|
||||
/* DISTANCE_THRESHOLD = MAX - ASSUME_CHILD_HEIGHT(800mm) */
|
||||
|
||||
|
@ -669,13 +673,13 @@ void STS_TOF_VL53LX_PresenceDetection_Process_Start(void)
|
|||
{
|
||||
LED_GREEN_OFF;
|
||||
LED_RED_ON;
|
||||
sts_lamp_bar_color = STS_RED; //(sts_cfg_nvm.color_occupy_vacant>>4)&0x0f; //STS_RED;
|
||||
sts_lamp_bar_color = (sts_cfg_nvm.color_occupy_vacant>>4)&0x0f; //STS_COLOR_DEFAULT_OCCUPY; //(sts_cfg_nvm.color_occupy_vacant>>4)&0x0f; //STS_RED;
|
||||
} else if (sts_tof_presence_state ==0)
|
||||
{
|
||||
|
||||
LED_RED_OFF;
|
||||
LED_GREEN_ON;
|
||||
sts_lamp_bar_color = STS_GREEN; //(sts_cfg_nvm.color_occupy_vacant)&0x0f; //STS_GREEN;
|
||||
sts_lamp_bar_color = (sts_cfg_nvm.color_occupy_vacant)&0x0f; //STS_COLOR_DEFAULT_VACANT; //(sts_cfg_nvm.color_occupy_vacant)&0x0f; //STS_GREEN;
|
||||
}
|
||||
sts_people_count_sensor_data.Count_Valid = (status ==0)? 1:0;
|
||||
//APP_LOG(TS_OFF, VLEVEL_M,"############### SUB-PROCESS running .... \r\n");
|
||||
|
|
Loading…
Reference in New Issue