mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
more contrast values for replacement displays
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/applications/services/notification/notification_app.c b/applications/services/notification/notification_app.c
|
diff --git a/applications/services/notification/notification_app.c b/applications/services/notification/notification_app.c
|
||||||
index 5769ced..c5d3088 100644
|
index 9baa738..91ad7c1 100644
|
||||||
--- a/applications/services/notification/notification_app.c
|
--- a/applications/services/notification/notification_app.c
|
||||||
+++ b/applications/services/notification/notification_app.c
|
+++ b/applications/services/notification/notification_app.c
|
||||||
@@ -9,6 +9,7 @@
|
@@ -9,6 +9,7 @@
|
||||||
@@ -19,7 +19,7 @@ index 5769ced..c5d3088 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/applications/settings/notification_settings/notification_settings_app.c b/applications/settings/notification_settings/notification_settings_app.c
|
diff --git a/applications/settings/notification_settings/notification_settings_app.c b/applications/settings/notification_settings/notification_settings_app.c
|
||||||
index 1955012..19d953d 100644
|
index 2a1d988..dda86f3 100644
|
||||||
--- a/applications/settings/notification_settings/notification_settings_app.c
|
--- a/applications/settings/notification_settings/notification_settings_app.c
|
||||||
+++ b/applications/settings/notification_settings/notification_settings_app.c
|
+++ b/applications/settings/notification_settings/notification_settings_app.c
|
||||||
@@ -3,6 +3,7 @@
|
@@ -3,6 +3,7 @@
|
||||||
@@ -30,16 +30,16 @@ index 1955012..19d953d 100644
|
|||||||
|
|
||||||
#define MAX_NOTIFICATION_SETTINGS 4
|
#define MAX_NOTIFICATION_SETTINGS 4
|
||||||
|
|
||||||
@@ -20,6 +21,8 @@ static const NotificationSequence sequence_note_c = {
|
@@ -13,6 +14,8 @@ typedef struct {
|
||||||
NULL,
|
VariableItemList* variable_item_list;
|
||||||
};
|
} NotificationAppSettings;
|
||||||
|
|
||||||
+static VariableItem* temp_item;
|
+static VariableItem* temp_item;
|
||||||
+
|
+
|
||||||
#define CONTRAST_COUNT 11
|
static const NotificationSequence sequence_note_c = {
|
||||||
const char* const contrast_text[CONTRAST_COUNT] = {
|
&message_note_c5,
|
||||||
"-5",
|
&message_delay_100,
|
||||||
@@ -156,6 +159,59 @@ static void vibro_changed(VariableItem* item) {
|
@@ -168,6 +171,59 @@ static void vibro_changed(VariableItem* item) {
|
||||||
notification_message(app->notification, &sequence_single_vibro);
|
notification_message(app->notification, &sequence_single_vibro);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ index 1955012..19d953d 100644
|
|||||||
static uint32_t notification_app_settings_exit(void* context) {
|
static uint32_t notification_app_settings_exit(void* context) {
|
||||||
UNUSED(context);
|
UNUSED(context);
|
||||||
return VIEW_NONE;
|
return VIEW_NONE;
|
||||||
@@ -180,8 +236,40 @@ static NotificationAppSettings* alloc_settings() {
|
@@ -192,8 +248,40 @@ static NotificationAppSettings* alloc_settings() {
|
||||||
variable_item_set_current_value_index(item, value_index);
|
variable_item_set_current_value_index(item, value_index);
|
||||||
variable_item_set_current_value_text(item, contrast_text[value_index]);
|
variable_item_set_current_value_text(item, contrast_text[value_index]);
|
||||||
|
|
||||||
@@ -462,54 +462,6 @@ index 0000000..68dacda
|
|||||||
+ */
|
+ */
|
||||||
+const char* rgb_backlight_get_color_text(uint8_t index);
|
+const char* rgb_backlight_get_color_text(uint8_t index);
|
||||||
\ No newline at end of file
|
\ No newline at end of file
|
||||||
diff --git a/targets/f7/furi_hal/furi_hal_light.c b/targets/f7/furi_hal/furi_hal_light.c
|
|
||||||
index 83e1603..45798ca 100644
|
|
||||||
--- a/targets/f7/furi_hal/furi_hal_light.c
|
|
||||||
+++ b/targets/f7/furi_hal/furi_hal_light.c
|
|
||||||
@@ -3,6 +3,7 @@
|
|
||||||
#include <furi_hal_light.h>
|
|
||||||
#include <lp5562.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
+#include <applications/settings/notification_settings/rgb_backlight.h>
|
|
||||||
|
|
||||||
#define LED_CURRENT_RED 50
|
|
||||||
#define LED_CURRENT_GREEN 50
|
|
||||||
@@ -31,22 +32,21 @@ void furi_hal_light_init() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void furi_hal_light_set(Light light, uint8_t value) {
|
|
||||||
- furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
|
|
||||||
- if(light & LightRed) {
|
|
||||||
- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelRed, value);
|
|
||||||
- }
|
|
||||||
- if(light & LightGreen) {
|
|
||||||
- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelGreen, value);
|
|
||||||
- }
|
|
||||||
- if(light & LightBlue) {
|
|
||||||
- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value);
|
|
||||||
- }
|
|
||||||
if(light & LightBacklight) {
|
|
||||||
- uint8_t prev = lp5562_get_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelWhite);
|
|
||||||
- lp5562_execute_ramp(
|
|
||||||
- &furi_hal_i2c_handle_power, LP5562Engine1, LP5562ChannelWhite, prev, value, 100);
|
|
||||||
+ rgb_backlight_update(value, false);
|
|
||||||
+ } else {
|
|
||||||
+ furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
|
|
||||||
+ if(light & LightRed) {
|
|
||||||
+ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelRed, value);
|
|
||||||
+ }
|
|
||||||
+ if(light & LightGreen) {
|
|
||||||
+ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelGreen, value);
|
|
||||||
+ }
|
|
||||||
+ if(light & LightBlue) {
|
|
||||||
+ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value);
|
|
||||||
+ }
|
|
||||||
+ furi_hal_i2c_release(&furi_hal_i2c_handle_power);
|
|
||||||
}
|
|
||||||
- furi_hal_i2c_release(&furi_hal_i2c_handle_power);
|
|
||||||
}
|
|
||||||
|
|
||||||
void furi_hal_light_blink_start(Light light, uint8_t brightness, uint16_t on_time, uint16_t period) {
|
|
||||||
diff --git a/lib/drivers/SK6805.c b/lib/drivers/SK6805.c
|
diff --git a/lib/drivers/SK6805.c b/lib/drivers/SK6805.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..572e1df
|
index 0000000..572e1df
|
||||||
@@ -675,3 +627,51 @@ index 0000000..7c58956
|
|||||||
+
|
+
|
||||||
+#endif /* SK6805_H_ */
|
+#endif /* SK6805_H_ */
|
||||||
\ No newline at end of file
|
\ No newline at end of file
|
||||||
|
diff --git a/targets/f7/furi_hal/furi_hal_light.c b/targets/f7/furi_hal/furi_hal_light.c
|
||||||
|
index 83e1603..45798ca 100644
|
||||||
|
--- a/targets/f7/furi_hal/furi_hal_light.c
|
||||||
|
+++ b/targets/f7/furi_hal/furi_hal_light.c
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
#include <furi_hal_light.h>
|
||||||
|
#include <lp5562.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
+#include <applications/settings/notification_settings/rgb_backlight.h>
|
||||||
|
|
||||||
|
#define LED_CURRENT_RED 50
|
||||||
|
#define LED_CURRENT_GREEN 50
|
||||||
|
@@ -31,22 +32,21 @@ void furi_hal_light_init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void furi_hal_light_set(Light light, uint8_t value) {
|
||||||
|
- furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
|
||||||
|
- if(light & LightRed) {
|
||||||
|
- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelRed, value);
|
||||||
|
- }
|
||||||
|
- if(light & LightGreen) {
|
||||||
|
- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelGreen, value);
|
||||||
|
- }
|
||||||
|
- if(light & LightBlue) {
|
||||||
|
- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value);
|
||||||
|
- }
|
||||||
|
if(light & LightBacklight) {
|
||||||
|
- uint8_t prev = lp5562_get_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelWhite);
|
||||||
|
- lp5562_execute_ramp(
|
||||||
|
- &furi_hal_i2c_handle_power, LP5562Engine1, LP5562ChannelWhite, prev, value, 100);
|
||||||
|
+ rgb_backlight_update(value, false);
|
||||||
|
+ } else {
|
||||||
|
+ furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
|
||||||
|
+ if(light & LightRed) {
|
||||||
|
+ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelRed, value);
|
||||||
|
+ }
|
||||||
|
+ if(light & LightGreen) {
|
||||||
|
+ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelGreen, value);
|
||||||
|
+ }
|
||||||
|
+ if(light & LightBlue) {
|
||||||
|
+ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value);
|
||||||
|
+ }
|
||||||
|
+ furi_hal_i2c_release(&furi_hal_i2c_handle_power);
|
||||||
|
}
|
||||||
|
- furi_hal_i2c_release(&furi_hal_i2c_handle_power);
|
||||||
|
}
|
||||||
|
|
||||||
|
void furi_hal_light_blink_start(Light light, uint8_t brightness, uint16_t on_time, uint16_t period) {
|
||||||
|
|||||||
@@ -20,8 +20,11 @@ static const NotificationSequence sequence_note_c = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CONTRAST_COUNT 11
|
#define CONTRAST_COUNT 17
|
||||||
const char* const contrast_text[CONTRAST_COUNT] = {
|
const char* const contrast_text[CONTRAST_COUNT] = {
|
||||||
|
"-8",
|
||||||
|
"-7",
|
||||||
|
"-6",
|
||||||
"-5",
|
"-5",
|
||||||
"-4",
|
"-4",
|
||||||
"-3",
|
"-3",
|
||||||
@@ -33,8 +36,14 @@ const char* const contrast_text[CONTRAST_COUNT] = {
|
|||||||
"+3",
|
"+3",
|
||||||
"+4",
|
"+4",
|
||||||
"+5",
|
"+5",
|
||||||
|
"+6",
|
||||||
|
"+7",
|
||||||
|
"+8",
|
||||||
};
|
};
|
||||||
const int32_t contrast_value[CONTRAST_COUNT] = {
|
const int32_t contrast_value[CONTRAST_COUNT] = {
|
||||||
|
-8,
|
||||||
|
-7,
|
||||||
|
-6,
|
||||||
-5,
|
-5,
|
||||||
-4,
|
-4,
|
||||||
-3,
|
-3,
|
||||||
@@ -46,6 +55,9 @@ const int32_t contrast_value[CONTRAST_COUNT] = {
|
|||||||
3,
|
3,
|
||||||
4,
|
4,
|
||||||
5,
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BACKLIGHT_COUNT 21
|
#define BACKLIGHT_COUNT 21
|
||||||
|
|||||||
Reference in New Issue
Block a user