From 394b1fd752178af5eeed68fa30bf239cf84885fe Mon Sep 17 00:00:00 2001 From: Will Xu Date: Tue, 4 Jun 2024 01:54:10 -0400 Subject: [PATCH] Add more weak symbols for llemu --- include/pros/llemu.hpp | 15 ++++++++++----- src/devices/screen.cpp | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/pros/llemu.hpp b/include/pros/llemu.hpp index 4f75d6c79..85ae81f3b 100644 --- a/include/pros/llemu.hpp +++ b/include/pros/llemu.hpp @@ -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 * @{ diff --git a/src/devices/screen.cpp b/src/devices/screen.cpp index 018732ad3..b7b0fda9c 100644 --- a/src/devices/screen.cpp +++ b/src/devices/screen.cpp @@ -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 extern __attribute__((weak)) bool print(std::int16_t line, const char* fmt, Params... args) {return false;} } // namespace lcd