good occupy/vacant red fadeout, white fadein

This commit is contained in:
Yunhorn 2025-07-29 19:20:27 +08:00
parent f237b4ad36
commit 5178d2702a
5 changed files with 9 additions and 6 deletions

View File

@ -288,7 +288,7 @@ static void STS_Lamp_Bar_Set_RGB_Color_FadeIn(uint8_t red, uint8_t green, uint8_
{
if (idx >= start_position) {
// the most far tail end, the darker, the most head/first, the brighter
uint8_t rev = idx - fade_len+1;
uint8_t rev = idx - start_position + 1;
uint8_t lin = (rev * 0xFF / fade_len);
uint8_t bri = (lin * lin) >> 8;
@ -302,7 +302,7 @@ static void STS_Lamp_Bar_Set_RGB_Color_FadeIn(uint8_t red, uint8_t green, uint8_
}
} else {
} else if ((idx < start_position)||(idx > (start_position+fade_len))){
// shorter than tail, set to dark
//STS_WS2812B_Set_RGB(red, green, blue, idx);
//STS_WS2812B_Set_RGB(0, 0, 0, idx);

View File

@ -137,8 +137,8 @@ char sts_presence_fall_detection_message[10][20]={
#endif
//#define STS_COLOR_DEFAULT_VACANT (sts_color_occupy_vacant&0x0f)
//#define STS_COLOR_DEFAULT_OCCUPY ((sts_color_occupy_vacant>>4)&0x0f)
#define STS_COLOR_DEFAULT_VACANT (sts_color_occupy_vacant&0x0f)
#define STS_COLOR_DEFAULT_OCCUPY ((sts_color_occupy_vacant>>4)&0x0f)
/*

View File

@ -1281,10 +1281,12 @@ if (last_sts_lamp_bar_color != sts_lamp_bar_color)
{
#if defined(FADEOUT)
if ((sts_rss_result == STS_RESULT_MOTION)||(sts_reed_hall_result == STS_Status_Door_Close )) {
if ((sts_rss_result == STS_RESULT_MOTION)) //||(sts_reed_hall_result == STS_Status_Door_Close ))
{
STS_Lamp_Bar_Set_STS_RGB_Color_FadeOut(sts_lamp_bar_color, luminance_level, LED_COUNT/2);
} else if ((sts_rss_result == STS_RESULT_NO_MOTION)||(sts_reed_hall_result == STS_Status_Door_Open )){
} else //if ((sts_rss_result == STS_RESULT_NO_MOTION)||(sts_reed_hall_result == STS_Status_Door_Open )){
{
STS_Lamp_Bar_Set_STS_RGB_Color_FadeIn(sts_lamp_bar_color, luminance_level, LED_COUNT/2);
}
#else

View File

@ -154,6 +154,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1119592399" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.2024044405" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CORE_CM4"/>
<listOptionValue builtIn="false" value="FADEOUT"/>
<listOptionValue builtIn="false" value="ATAL"/>
<listOptionValue builtIn="false" value="CLOCK_SYNC"/>
<listOptionValue builtIn="false" value="RM2_1"/>

Binary file not shown.