Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Enable backlight on ascii event --nobuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Jan 24, 2024
1 parent 7f637e3 commit 637d915
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions applications/services/input/input_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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() {
Expand Down
10 changes: 10 additions & 0 deletions applications/services/notification/notification_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions applications/services/notification/notification_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef struct {
struct NotificationApp {
FuriMessageQueue* queue;
FuriPubSub* event_record;
FuriPubSub* ascii_record;
FuriTimer* display_timer;

NotificationLedLayer display;
Expand Down

0 comments on commit 637d915

Please sign in to comment.