RM2_1 #2

Merged
sundp merged 208 commits from RM2_1 into master 2024-09-13 09:16:14 +08:00
3 changed files with 14 additions and 9 deletions
Showing only changes of commit b2c9e673df - Show all commits

View File

@ -186,7 +186,7 @@ void STS_Lamp_Bar_Refresh(void)
void STS_Lamp_Bar_Set_STS_RGB_Color(uint8_t sts_lamp_color, uint8_t luminance_level) void STS_Lamp_Bar_Set_STS_RGB_Color(uint8_t sts_lamp_color, uint8_t luminance_level)
{ {
uint8_t lum = luminance_level; uint8_t lum = luminance_level;
static bool r_b = false;
STS_Lamp_Bar_Set_RGB_Color(0x0, 0x0, 0x0); STS_Lamp_Bar_Set_RGB_Color(0x0, 0x0, 0x0);
switch (sts_lamp_color) switch (sts_lamp_color)
{ {
@ -215,10 +215,11 @@ void STS_Lamp_Bar_Set_STS_RGB_Color(uint8_t sts_lamp_color, uint8_t luminance_le
STS_Lamp_Bar_Set_RGB_Color(lum, lum, lum); STS_Lamp_Bar_Set_RGB_Color(lum, lum, lum);
break; break;
case STS_RED_BLUE: case STS_RED_BLUE:
if (r_b)
STS_Lamp_Bar_Set_RGB_Color(lum, 0x0, 0x0); STS_Lamp_Bar_Set_RGB_Color(lum, 0x0, 0x0);
HAL_Delay(300); else
STS_Lamp_Bar_Set_RGB_Color(0x0, 0x0, lum); STS_Lamp_Bar_Set_RGB_Color(0x0, 0x0, lum);
HAL_Delay(300); r_b = !r_b;
break; break;
} }
} }

View File

@ -214,11 +214,11 @@ void STS_YunhornSTSEventRFAC_Process(void)
void STS_YunhornSTSEventP1_Process(void) void STS_YunhornSTSEventP1_Process(void)
{ {
sts_reed_hall_1_result = sts_hall1_read; sts_reed_hall_1_result = HALL1_STATE; //sts_hall1_read;
sts_reed_hall_1_changed =0; sts_reed_hall_1_changed =0;
last_sts_reed_hall_1_result = sts_reed_hall_1_result; last_sts_reed_hall_1_result = sts_reed_hall_1_result;
sts_reed_hall_2_result = sts_hall2_read; sts_reed_hall_2_result = HALL2_STATE;// sts_hall2_read;
sts_reed_hall_2_changed =0; sts_reed_hall_2_changed =0;
last_sts_reed_hall_2_result = sts_reed_hall_2_result; last_sts_reed_hall_2_result = sts_reed_hall_2_result;
@ -692,9 +692,9 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
{ {
sts_o7_sensorData.lamp_bar_color = sts_lamp_bar_color; sts_o7_sensorData.lamp_bar_color = sts_lamp_bar_color;
sts_o7_sensorData.workmode = sts_work_mode; sts_o7_sensorData.workmode = sts_work_mode;
sts_o7_sensorData.state_sensor1_on_off = sts_hall1_read; //sts_hsts_reed_hall_result; // sts_hall1_read sts_o7_sensorData.state_sensor1_on_off = HALL1_STATE;//sts_hall1_read; //sts_hsts_reed_hall_result; // sts_hall1_read
sts_o7_sensorData.state_sensor2_on_off = sts_rss_result; sts_o7_sensorData.state_sensor2_on_off = sts_rss_result;
sts_o7_sensorData.state_sensor3_on_off = sts_hall2_read; //sts_emergency_button_pushed; //sts_hall2_read sts_o7_sensorData.state_sensor3_on_off = HALL2_STATE;//sts_hall2_read; //sts_emergency_button_pushed; //sts_hall2_read
sts_o7_sensorData.state_sensor4_on_off = sts_rss_2nd_result; sts_o7_sensorData.state_sensor4_on_off = sts_rss_2nd_result;
if (sts_rss_result == STS_RESULT_MOTION) if (sts_rss_result == STS_RESULT_MOTION)
{ {

View File

@ -915,11 +915,13 @@ static void SendTxData(void)
UTIL_TIMER_Time_t nextTxIn = 0; UTIL_TIMER_Time_t nextTxIn = 0;
uint8_t i = 0; uint8_t i = 0;
if (LmHandlerIsBusy() == false) APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter \r\n\n");
//if (LmHandlerIsBusy() == false)
{ {
AppData.Port = LORAWAN_USER_APP_PORT; AppData.Port = LORAWAN_USER_APP_PORT;
//AppData.Buffer[i++] = AppLedStateOn; //#01 //AppData.Buffer[i++] = AppLedStateOn; //#01
//STS_PRESENCE_SENSOR_Prepare_Send_Data(); STS_PRESENCE_SENSOR_Prepare_Send_Data();
if ((heart_beat_timer != 0L)) // sensor data OVERWRITE heart-beat message, 2024-05-12 if ((heart_beat_timer != 0L)) // sensor data OVERWRITE heart-beat message, 2024-05-12
{ {
@ -927,10 +929,12 @@ static void SendTxData(void)
AppData.Port = sts_sendhtbtport; //LORAWAN_USER_APP_PORT+1; AppData.Port = sts_sendhtbtport; //LORAWAN_USER_APP_PORT+1;
AppData.Buffer[i++]= AppLedStateOn|0x80; AppData.Buffer[i++]= AppLedStateOn|0x80;
AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05 AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter Heart-Beat \r\n\n");
} else if ((upload_message_timer != 0U)||(sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger) } else if ((upload_message_timer != 0U)||(sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger)
{ {
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter Sensor Data Ready \r\n\n");
sensor_data_ready =0; sensor_data_ready =0;