mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
Enable backlight on ascii event --nobuild
This commit is contained in:
@@ -60,8 +60,6 @@ static void fake_input(Input* input, InputKey key, InputType type) {
|
||||
|
||||
static void input_cli_keyboard(Cli* cli, FuriString* args, Input* input) {
|
||||
UNUSED(args);
|
||||
FuriPubSub* ascii_events = furi_record_open(RECORD_ASCII_EVENTS);
|
||||
|
||||
printf("Using console keyboard feedback for flipper input\r\n");
|
||||
|
||||
printf("\r\nUsage:\r\n");
|
||||
@@ -130,12 +128,10 @@ static void input_cli_keyboard(Cli* cli, FuriString* args, Input* input) {
|
||||
}
|
||||
if(send_ascii != AsciiValueNUL) {
|
||||
AsciiEvent event = {.value = send_ascii};
|
||||
furi_pubsub_publish(ascii_events, &event);
|
||||
furi_pubsub_publish(input->ascii_pubsub, &event);
|
||||
hold = false;
|
||||
}
|
||||
}
|
||||
|
||||
furi_record_close(RECORD_ASCII_EVENTS);
|
||||
}
|
||||
|
||||
static void input_cli_send_print_usage() {
|
||||
|
||||
@@ -463,6 +463,14 @@ static void input_event_callback(const void* value, void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
static void ascii_event_callback(const void* value, void* context) {
|
||||
furi_assert(value);
|
||||
furi_assert(context);
|
||||
UNUSED(value);
|
||||
NotificationApp* app = context;
|
||||
notification_message(app, &sequence_display_backlight_on);
|
||||
}
|
||||
|
||||
// App alloc
|
||||
static NotificationApp* notification_app_alloc() {
|
||||
NotificationApp* app = malloc(sizeof(NotificationApp));
|
||||
@@ -500,6 +508,8 @@ static NotificationApp* notification_app_alloc() {
|
||||
// display backlight control
|
||||
app->event_record = furi_record_open(RECORD_INPUT_EVENTS);
|
||||
furi_pubsub_subscribe(app->event_record, input_event_callback, app);
|
||||
app->ascii_record = furi_record_open(RECORD_ASCII_EVENTS);
|
||||
furi_pubsub_subscribe(app->ascii_record, ascii_event_callback, app);
|
||||
notification_message(app, &sequence_display_backlight_on);
|
||||
|
||||
return app;
|
||||
|
||||
@@ -49,6 +49,7 @@ typedef struct {
|
||||
struct NotificationApp {
|
||||
FuriMessageQueue* queue;
|
||||
FuriPubSub* event_record;
|
||||
FuriPubSub* ascii_record;
|
||||
FuriTimer* display_timer;
|
||||
|
||||
NotificationLedLayer display;
|
||||
|
||||
Reference in New Issue
Block a user