Skip to content

Commit d50aa9f

Browse files
committed
led add pairing color
1 parent 6afc194 commit d50aa9f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/system/led.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,34 +148,39 @@ static int led_pwm_period[4][3] = {
148148
{0, 10000, 0}, // Success
149149
{10000, 0, 0}, // Error
150150
{8000, 2000, 0}, // Charging
151+
{0, 0, 10000}, // Pairing
151152
};
152153
#elif defined(LED_TRI_COLOR)
153154
static int led_pwm_period[4][3] = {
154155
{0, 0, 10000}, // Default
155156
{0, 10000, 0}, // Success
156157
{10000, 0, 0}, // Error
157158
{6000, 4000, 0}, // Charging
159+
{0, 0, 10000}, // Pairing
158160
};
159161
#elif defined(LED_RG_COLOR)
160162
static int led_pwm_period[4][2] = {
161163
{CONFIG_LED_DEFAULT_COLOR_R, CONFIG_LED_DEFAULT_COLOR_G}, // Default
162164
{0, 10000}, // Success
163165
{10000, 0}, // Error
164166
{8000, 2000}, // Charging
167+
{4000, 6000}, // Pairing
165168
};
166169
#elif defined(LED_DUAL_COLOR)
167170
static int led_pwm_period[4][2] = {
168171
{0, 10000}, // Default
169172
{0, 10000}, // Success
170173
{10000, 0}, // Error
171174
{6000, 4000}, // Charging
175+
{0, 10000}, // Pairing
172176
};
173177
#else
174178
static int led_pwm_period[4][1] = {
175179
{10000}, // Default
176180
{10000}, // Success
177181
{10000}, // Error
178182
{10000}, // Charging
183+
{10000}, // Pairing
179184
};
180185
#endif
181186

@@ -264,7 +269,7 @@ static void led_thread(void)
264269
break;
265270
case SYS_LED_PATTERN_SHORT:
266271
led_pattern_state = (led_pattern_state + 1) % 2;
267-
led_pin_set(SYS_LED_COLOR_DEFAULT, 10000, led_pattern_state * 10000);
272+
led_pin_set(SYS_LED_COLOR_PAIRING, 10000, led_pattern_state * 10000);
268273
k_msleep(led_pattern_state == 1 ? 100 : 900);
269274
break;
270275
case SYS_LED_PATTERN_LONG:

src/system/led.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum sys_led_pattern {
3636

3737
SYS_LED_PATTERN_OFF, // yield to lower priority patterns
3838
SYS_LED_PATTERN_ON, // Default | indicates busy
39-
SYS_LED_PATTERN_SHORT, // 100ms on 900ms off // Default | indicates waiting (pairing)
39+
SYS_LED_PATTERN_SHORT, // 100ms on 900ms off // Pairing | indicates waiting (pairing)
4040
SYS_LED_PATTERN_LONG, // 500ms on 500ms off // Default | indicates waiting
4141
SYS_LED_PATTERN_FLASH, // 200ms on 200ms off // Default | indicates readiness
4242

@@ -61,6 +61,7 @@ enum sys_led_color {
6161
SYS_LED_COLOR_SUCCESS,
6262
SYS_LED_COLOR_ERROR,
6363
SYS_LED_COLOR_CHARGING,
64+
SYS_LED_COLOR_PAIRING,
6465
};
6566

6667
void set_led(enum sys_led_pattern led_pattern, int priority);

0 commit comments

Comments
 (0)