Skip to content

Commit

Permalink
Tidy up RGB screen property info
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Mar 7, 2024
1 parent bf045cc commit 47bd169
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions targets/f7/furi_hal/furi_hal_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,25 @@ void furi_hal_info_get(PropertyValueCallback out, char sep, void* context) {
&property_context, "%d", 2, "hardware", "color", furi_hal_version_get_hw_color());

// RGB Settings
property_value_out(&property_context, "%d", 3, "hardware", "rgb", "enabled", momentum_settings.rgb_backlight);

for(int i = 0; i < SK6805_get_led_count(); i++){
property_value_out(
&property_context,
"%d",
4,
"hardware",
"screen",
"rgb",
"enabled",
momentum_settings.rgb_backlight);
for(int i = 0; i < SK6805_get_led_count(); i++) {
RgbColor rgb;
rgb_backlight_get_color(i, &rgb);

uint32_t led_value = 0;
memcpy(((void *)&led_value) + 1, &rgb, sizeof(RgbColor));
memcpy(((void*)&led_value) + 1, &rgb, sizeof(RgbColor));

char id_string[2] = {'0'+i, '\0'};

property_value_out(&property_context, "%06X", 4, "hardware", "rgb", "led", id_string, __REV(led_value));
char led_string[5] = {'l', 'e', 'd', '0' + i, '\0'};
property_value_out(
&property_context, "%06X", 4, "hardware", "screen", "rgb", led_string, __REV(led_value));
}

// VGM Settings
Expand Down

0 comments on commit 47bd169

Please sign in to comment.