From dfa9a988fd0dd05892765e9f9ace8a82b61ef604 Mon Sep 17 00:00:00 2001 From: Esonhugh Date: Thu, 30 Nov 2023 18:13:58 +0800 Subject: [PATCH] update comments --- bc_demo.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/bc_demo.c b/bc_demo.c index 3368c1e..8f22903 100644 --- a/bc_demo.c +++ b/bc_demo.c @@ -10,15 +10,42 @@ // FlipperZero libs #include // Core API #include // hardware abstraction layer (eg. speaker) + #include // GUI (screen/keyboard) API +#include // GUI Canvas API + #include // GUI Input extensions -#include // GUI Canvas API // There is no 'getter' for gui->canvas // ...this is dirty/risky, but quicker and (a LOT) easier than getting changes committed to the official API // ...essentially, we are exposing private variables [yes, C has private variables - qv. "typedef struct Gui Gui;"] // --> applications/gui/ -// #include +/* + #include + + struct Gui { + ... + Canvas* canvas; + ... + }; + + gui->canvas; // <-- this is what we want + // but it is so hacky and need cooperated with firmware codes. + // and it is not recommended to use it. + // +*/ +// Update: 2023-11-03 Esonhugh +// Now we can use the API +// Like +/* + #include + #include + + .... + Canvas* canvas = gui_direct_draw_acquire(gui); // get canvas and add lock to gui + .... + gui_direct_draw_release(gui); // release gui lock +*/ // The FlipperZero Settings->System menu allows you to set the logging level at RUN-time // LOG_LEVEL lets you limit it at COMPILE-time