mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 00:58:36 -07:00
Update system apps
This commit is contained in:
39
applications/system/hex_viewer/helpers/hex_viewer_led.c
Normal file
39
applications/system/hex_viewer/helpers/hex_viewer_led.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "hex_viewer_led.h"
|
||||
#include "../hex_viewer.h"
|
||||
|
||||
|
||||
|
||||
void hex_viewer_led_set_rgb(void* context, int red, int green, int blue) {
|
||||
HexViewer* app = context;
|
||||
if (app->led != 1) {
|
||||
return;
|
||||
}
|
||||
NotificationMessage notification_led_message_1;
|
||||
notification_led_message_1.type = NotificationMessageTypeLedRed;
|
||||
NotificationMessage notification_led_message_2;
|
||||
notification_led_message_2.type = NotificationMessageTypeLedGreen;
|
||||
NotificationMessage notification_led_message_3;
|
||||
notification_led_message_3.type = NotificationMessageTypeLedBlue;
|
||||
|
||||
notification_led_message_1.data.led.value = red;
|
||||
notification_led_message_2.data.led.value = green;
|
||||
notification_led_message_3.data.led.value = blue;
|
||||
const NotificationSequence notification_sequence = {
|
||||
¬ification_led_message_1,
|
||||
¬ification_led_message_2,
|
||||
¬ification_led_message_3,
|
||||
&message_do_not_reset,
|
||||
NULL,
|
||||
};
|
||||
notification_message(app->notification, ¬ification_sequence);
|
||||
furi_thread_flags_wait(0, FuriFlagWaitAny, 10); //Delay, prevent removal from RAM before LED value set
|
||||
}
|
||||
|
||||
void hex_viewer_led_reset(void* context) {
|
||||
HexViewer* app = context;
|
||||
notification_message(app->notification, &sequence_reset_red);
|
||||
notification_message(app->notification, &sequence_reset_green);
|
||||
notification_message(app->notification, &sequence_reset_blue);
|
||||
|
||||
furi_thread_flags_wait(0, FuriFlagWaitAny, 300); //Delay, prevent removal from RAM before LED value set
|
||||
}
|
||||
Reference in New Issue
Block a user