Skip to content

Commit 712b3c3

Browse files
committed
led add pairing color
1 parent 434a9fc commit 712b3c3

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
@@ -180,34 +180,39 @@ static int led_pwm_period[4][3] = {
180180
{0, 10000, 0}, // Success
181181
{10000, 0, 0}, // Error
182182
{8000, 2000, 0}, // Charging
183+
{0, 0, 10000}, // Pairing
183184
};
184185
#elif defined(LED_TRI_COLOR)
185186
static int led_pwm_period[4][3] = {
186187
{0, 0, 10000}, // Default
187188
{0, 10000, 0}, // Success
188189
{10000, 0, 0}, // Error
189190
{6000, 4000, 0}, // Charging
191+
{0, 0, 10000}, // Pairing
190192
};
191193
#elif defined(LED_RG_COLOR)
192194
static int led_pwm_period[4][2] = {
193195
{CONFIG_LED_DEFAULT_COLOR_R, CONFIG_LED_DEFAULT_COLOR_G}, // Default
194196
{0, 10000}, // Success
195197
{10000, 0}, // Error
196198
{8000, 2000}, // Charging
199+
{4000, 6000}, // Pairing
197200
};
198201
#elif defined(LED_DUAL_COLOR)
199202
static int led_pwm_period[4][2] = {
200203
{0, 10000}, // Default
201204
{0, 10000}, // Success
202205
{10000, 0}, // Error
203206
{6000, 4000}, // Charging
207+
{0, 10000}, // Pairing
204208
};
205209
#else
206210
static int led_pwm_period[4][1] = {
207211
{10000}, // Default
208212
{10000}, // Success
209213
{10000}, // Error
210214
{10000}, // Charging
215+
{10000}, // Pairing
211216
};
212217
#endif
213218

@@ -303,7 +308,7 @@ static void led_thread(void)
303308
break;
304309
case SYS_LED_PATTERN_SHORT:
305310
led_pattern_state = (led_pattern_state + 1) % 2;
306-
led_pin_set(SYS_LED_COLOR_DEFAULT, 10000, led_pattern_state * 10000);
311+
led_pin_set(SYS_LED_COLOR_PAIRING, 10000, led_pattern_state * 10000);
307312
k_msleep(led_pattern_state == 1 ? 100 : 900);
308313
break;
309314
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)