mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 20:49:49 +04:00
Start moving RGB MOD from Notification to RGB MOD service.
This commit is contained in:
@@ -11,5 +11,6 @@ App(
|
|||||||
"loader",
|
"loader",
|
||||||
"power",
|
"power",
|
||||||
"namechanger_srv",
|
"namechanger_srv",
|
||||||
|
"rgb_backlight",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
11
applications/services/rgb_backlight/application.fam
Normal file
11
applications/services/rgb_backlight/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="rgb_backlight",
|
||||||
|
name="RgbBackLightSrv",
|
||||||
|
apptype=FlipperAppType.SERVICE,
|
||||||
|
entry_point="rgb_backlight_srv",
|
||||||
|
cdefines=["SRV_RGB_BACKLIGHT"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=99,
|
||||||
|
sdk_headers=["rgb_backlight.h"],
|
||||||
|
provides=["rgb_backlight_settings"],
|
||||||
|
)
|
||||||
15
applications/services/rgb_backlight/rgb_backlight.c
Normal file
15
applications/services/rgb_backlight/rgb_backlight.c
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <furi.h>
|
||||||
|
#include "rgb_backlight.h"
|
||||||
|
|
||||||
|
#define TAG "RGB_BACKLIGHT_SRV"
|
||||||
|
|
||||||
|
int32_t rgb_backlight_srv (void* p){
|
||||||
|
UNUSED (p);
|
||||||
|
while (1){
|
||||||
|
FURI_LOG_I (TAG,"working");
|
||||||
|
furi_delay_ms (2000);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
0
applications/services/rgb_backlight/rgb_backlight.h
Normal file
0
applications/services/rgb_backlight/rgb_backlight.h
Normal file
@@ -6,6 +6,8 @@ App(
|
|||||||
"passport",
|
"passport",
|
||||||
"system_settings",
|
"system_settings",
|
||||||
"clock_settings",
|
"clock_settings",
|
||||||
|
"input_settings",
|
||||||
|
"rgb_backlight_settings",
|
||||||
"about",
|
"about",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
App(
|
||||||
|
appid="rgb_backlight_settings",
|
||||||
|
name="RGB backlight",
|
||||||
|
apptype=FlipperAppType.SETTINGS,
|
||||||
|
entry_point="rgb_backlight_settings",
|
||||||
|
requires=["rgb_backlight"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=110,
|
||||||
|
)
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <furi.h>
|
||||||
|
#include "rgb_backlight_settings.h"
|
||||||
|
|
||||||
|
#define TAG "RGB_BACKLIGHT_SETTINGS"
|
||||||
|
|
||||||
|
int32_t rgb_backlight_settings (void* p){
|
||||||
|
UNUSED (p);
|
||||||
|
FURI_LOG_I (TAG,"Settings");
|
||||||
|
furi_delay_ms (2000);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -58,7 +58,7 @@ void SK6805_set_led_color(uint8_t led_index, uint8_t r, uint8_t g, uint8_t b) {
|
|||||||
void SK6805_update(void) {
|
void SK6805_update(void) {
|
||||||
SK6805_init();
|
SK6805_init();
|
||||||
FURI_CRITICAL_ENTER();
|
FURI_CRITICAL_ENTER();
|
||||||
furi_delay_us(150);
|
furi_delay_us(100);
|
||||||
uint32_t end;
|
uint32_t end;
|
||||||
/* Последовательная отправка цветов светодиодов */
|
/* Последовательная отправка цветов светодиодов */
|
||||||
for(uint8_t lednumber = 0; lednumber < SK6805_LED_COUNT; lednumber++) {
|
for(uint8_t lednumber = 0; lednumber < SK6805_LED_COUNT; lednumber++) {
|
||||||
@@ -98,6 +98,6 @@ void SK6805_update(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
furi_delay_us(150);
|
furi_delay_us(100);
|
||||||
FURI_CRITICAL_EXIT();
|
FURI_CRITICAL_EXIT();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ Header,+,applications/services/locale/locale.h,,
|
|||||||
Header,+,applications/services/notification/notification.h,,
|
Header,+,applications/services/notification/notification.h,,
|
||||||
Header,+,applications/services/notification/notification_messages.h,,
|
Header,+,applications/services/notification/notification_messages.h,,
|
||||||
Header,+,applications/services/power/power_service/power.h,,
|
Header,+,applications/services/power/power_service/power.h,,
|
||||||
|
Header,+,applications/services/rgb_backlight/rgb_backlight.h,,
|
||||||
Header,+,applications/services/rpc/rpc_app.h,,
|
Header,+,applications/services/rpc/rpc_app.h,,
|
||||||
Header,+,applications/services/storage/storage.h,,
|
Header,+,applications/services/storage/storage.h,,
|
||||||
Header,+,lib/bit_lib/bit_lib.h,,
|
Header,+,lib/bit_lib/bit_lib.h,,
|
||||||
|
|||||||
|
Reference in New Issue
Block a user