Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add more weak symbols for llemu #674

Open
wants to merge 1 commit into
base: develop-pros-4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions include/pros/llemu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@ namespace lcd {
* For documentation on these functions, please see the doxygen comments for
* these functions in the libvgl llemu headers.
*/

extern __attribute__((weak)) bool is_initialized(void);
extern __attribute__((weak)) bool initialize(void);
extern __attribute__((weak)) bool shutdown(void);
extern __attribute__((weak)) bool set_text(std::int16_t line, std::string text);
extern __attribute__((weak)) bool clear(void);
extern __attribute__((weak)) bool clear_line(std::int16_t line);
extern __attribute__((weak)) bool initialize(void);
extern __attribute__((weak)) std::uint8_t read_buttons(void);
// TODO: Text_Align is defined in liblvgl so this ain't going to compile for now.
// extern __attribute__((weak)) void set_text_align(Text_Align text_align);
extern __attribute__((weak)) void register_btn0_cb(lcd_btn_cb_fn_t cb);
extern __attribute__((weak)) void register_btn1_cb(lcd_btn_cb_fn_t cb);
extern __attribute__((weak)) bool is_initialized(void);

extern __attribute__((weak)) void register_btn2_cb(lcd_btn_cb_fn_t cb);
extern __attribute__((weak)) std::uint8_t read_buttons(void);

/**
* \addtogroup cpp-llemu
* @{
Expand Down
15 changes: 10 additions & 5 deletions src/devices/screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,19 @@ namespace screen {
/******************************************************************************/
namespace lcd {
using lcd_btn_cb_fn_t = void (*)(void);

extern __attribute__((weak)) bool is_initialized(void) {return false;}
extern __attribute__((weak)) bool initialize(void) {return false;}
extern __attribute__((weak)) bool shutdown(void) {return false;}
extern __attribute__((weak)) bool set_text(std::int16_t line, std::string text) {return false;}
extern __attribute__((weak)) bool clear(void) {return false;}
extern __attribute__((weak)) bool clear_line(std::int16_t line) {return false;}
extern __attribute__((weak)) bool initialize(void) {return false;}
extern __attribute__((weak)) bool is_initialized(void) {return false;}
extern __attribute__((weak)) std::uint8_t read_buttons(void) {return 0xf;}
// TODO: Text_Align is defined in liblvgl so this ain't going to compile for now.
// extern __attribute__((weak)) void set_text_align(Text_Align text_align) {}
extern __attribute__((weak)) void register_btn0_cb(lcd_btn_cb_fn_t cb) {}
extern __attribute__((weak)) void register_btn1_cb(lcd_btn_cb_fn_t cb) {}

extern __attribute__((weak)) void register_btn2_cb(lcd_btn_cb_fn_t cb) {}
extern __attribute__((weak)) std::uint8_t read_buttons(void) {return 0xf;}

template <typename... Params>
extern __attribute__((weak)) bool print(std::int16_t line, const char* fmt, Params... args) {return false;}
} // namespace lcd
Expand Down