testing new usb command to save scene
This commit is contained in:
@@ -26,6 +26,7 @@ const osThreadAttr_t LightTask_attr = {
|
||||
static cls_light_GlobalBrightness msg_cls_light_GlobalBrightness;
|
||||
static cls_light_GlobalTheme msg_cls_light_GlobalTheme;
|
||||
static cls_light_ThemeSettings msg_cls_light_ThemeSettings;
|
||||
static cls_light_SaveThemeSettings msg_cls_light_SaveThemeSettings;
|
||||
|
||||
static volatile struct LightSettings_s {
|
||||
volatile uint8_t brightness;
|
||||
@@ -73,7 +74,7 @@ void DataClbk_cls_light_GlobalBrightness(void* msg, uint32_t length) {
|
||||
}
|
||||
|
||||
void DataClbk_cls_light_GlobalTheme(void* msg, uint32_t length) {
|
||||
DATA_CLBK_SETUP(cls_light_ThemeSettings);
|
||||
DATA_CLBK_SETUP(cls_light_GlobalTheme);
|
||||
lightSettings.theme = msg_cls_light_GlobalTheme.theme;
|
||||
settingChangeTime = osKernelGetTickCount();
|
||||
}
|
||||
@@ -94,4 +95,14 @@ void DataClbk_cls_light_ThemeSettings(void* msg, uint32_t length) {
|
||||
data.color.b = (msg_cls_light_ThemeSettings.rgb>>16) & 0xFF;
|
||||
|
||||
CLS_BSP_CAN_AddMessageToSend(&can_header, (uint8_t*)&data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DataClbk_cls_light_SaveThemeSettings(void* msg, uint32_t length) {
|
||||
DATA_CLBK_SETUP(cls_light_SaveThemeSettings);
|
||||
uint8_t device = msg_cls_light_SaveThemeSettings.deviceId & 0x1F;
|
||||
uint16_t msg_light_setting = GENERATE_CLS_ADDRESS(CLS_CODE_CONFIG, device, 4);
|
||||
CLS_BSP_TxHeaderType can_header = CREATE_BSP_CAN_HEADER(msg_light_setting, CLS_BSP_DLC_BYTES_1);
|
||||
CLS_BSP_CAN_AddMessageToSend(&can_header, (uint8_t*)"X");
|
||||
}
|
||||
Reference in New Issue
Block a user