int use_bi_led;
int use_rgb_gpio;
int use_rgb_l2c;
+ bool is_in_blink_mode;
} led_s;
static led_s s_info = {
break;
}
+ if(s_info.is_in_blink_mode) {
+ return;
+ }
+
int ret = peripheral_gpio_write(s_info.gpio_bi_led[LED_COLOR_RED], red);
ret_error_message(ret != PERIPHERAL_ERROR_NONE, ret);
}
_D("RGB GPIO: [%d, %d, %d]", red, green, blue);
+ if(s_info.is_in_blink_mode) {
+ return;
+ }
+
int ret = peripheral_gpio_write(s_info.rgb_gpio[0], red);
ret_error_message(ret != PERIPHERAL_ERROR_NONE, ret);
s_info.current_rgb_l2c_color[2] = blue;
}
+ if(s_info.is_in_blink_mode) {
+ return;
+ }
+
int ret = resource_pca9685_set_value_to_channel(DEFAULT_RGB_L2C_R, 0, RGB_TO_REGISTER(red));
ret_error_message(ret != PERIPHERAL_ERROR_NONE, ret);
static gboolean _restore_rgb_color_cb(gpointer data)
{
FUNCTION_START;
-
+ s_info.is_in_blink_mode = false;
_restore_bi_color_cb(data);
_restore_rgb_gpio_color_cb(data);
_restore_rgb_l2c_color_cb(data);
FUNCTION_START;
_set_rgb(key, false, def_r_3bit, def_g_3bit, def_b_3bit, def_r_24bit, def_g_24bit, def_b_24bit, bi_led);
+ s_info.is_in_blink_mode = true;
g_timeout_add(timeout, _restore_rgb_color_cb, NULL);