Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Esonhugh committed Nov 30, 2023
1 parent d4417c5 commit dfa9a98
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions bc_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,42 @@
// FlipperZero libs
#include <furi.h> // Core API
#include <furi_hal.h> // hardware abstraction layer (eg. speaker)

#include <gui/gui.h> // GUI (screen/keyboard) API
#include <gui/canvas.h> // GUI Canvas API

#include <input/input.h> // GUI Input extensions

#include <gui/canvas.h> // 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 <gui/gui_i.h>
/*
#include<gui/gui_i.h>
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<gui/gui.h>
#include<gui/canvas.h>
....
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
Expand Down

0 comments on commit dfa9a98

Please sign in to comment.