mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2025-10-04 02:16:40 +02:00
added new rgb property
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <expansion/expansion.h>
|
||||
#include "../momentum_app.h"
|
||||
|
||||
enum VarItemListIndex {
|
||||
@@ -55,6 +56,10 @@ static void momentum_app_scene_misc_screen_lcd_color_changed(VariableItem* item,
|
||||
variable_item_set_current_value_text(item, lcd_colors[index].name);
|
||||
rgb_backlight_set_color(led, &lcd_colors[index].color);
|
||||
app->save_backlight = true;
|
||||
|
||||
Expansion* expansion = furi_record_open(RECORD_EXPANSION);
|
||||
expansion_disable(expansion);
|
||||
expansion_enable(expansion);
|
||||
}
|
||||
static void momentum_app_scene_misc_screen_lcd_color_0_changed(VariableItem* item) {
|
||||
momentum_app_scene_misc_screen_lcd_color_changed(item, 0);
|
||||
|
@@ -1,3 +1,6 @@
|
||||
#include "SK6805.h"
|
||||
#include "colors.h"
|
||||
#include "property.h"
|
||||
#include <furi_hal_info.h>
|
||||
#include <furi_hal_region.h>
|
||||
#include <furi_hal_version.h>
|
||||
@@ -9,6 +12,10 @@
|
||||
#include <furi.h>
|
||||
#include <protobuf_version.h>
|
||||
|
||||
#include "momentum/momentum.h"
|
||||
#include "rgb_backlight.h"
|
||||
#include <stdint.h>
|
||||
|
||||
FURI_WEAK void furi_hal_info_get_api_version(uint16_t* major, uint16_t* minor) {
|
||||
*major = 0;
|
||||
*minor = 0;
|
||||
@@ -64,6 +71,21 @@ void furi_hal_info_get(PropertyValueCallback out, char sep, void* context) {
|
||||
property_value_out(
|
||||
&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++){
|
||||
RgbColor rgb;
|
||||
rgb_backlight_get_color(i, &rgb);
|
||||
|
||||
uint32_t led_value = 0;
|
||||
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));
|
||||
}
|
||||
|
||||
if(sep == '.') {
|
||||
property_value_out(
|
||||
&property_context,
|
||||
|
Reference in New Issue
Block a user