From 70c063635e2c644a16ffec707cad5ae24e3c0a10 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 9 Mar 2021 16:31:03 +0100 Subject: [PATCH 1/2] Add backlight and title to MacOS --- src/dev/posix/hasp_posix.cpp | 2 -- src/drv/tft_driver_sdl2.h | 2 -- src/main_sdl2.cpp | 2 ++ user_setups/darwin_sdl/darwin_sdl_64bits.ini | 3 ++- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/dev/posix/hasp_posix.cpp b/src/dev/posix/hasp_posix.cpp index 52604f2a..b3782006 100644 --- a/src/dev/posix/hasp_posix.cpp +++ b/src/dev/posix/hasp_posix.cpp @@ -73,9 +73,7 @@ bool PosixDevice::get_backlight_power() void PosixDevice::update_backlight() { -#ifndef TARGET_OS_MAC monitor_backlight(_backlight_power ? map(_backlight_level, 0, 100, 0, 255) : 0); -#endif } size_t PosixDevice::get_free_max_block() diff --git a/src/drv/tft_driver_sdl2.h b/src/drv/tft_driver_sdl2.h index e917ee74..2b443fad 100644 --- a/src/drv/tft_driver_sdl2.h +++ b/src/drv/tft_driver_sdl2.h @@ -49,9 +49,7 @@ class TftSdl2 : BaseTft { /* Add a display * Use the 'monitor' driver which creates window on PC's monitor to simulate a display*/ monitor_init(); -#ifndef TARGET_OS_MAC monitor_title(haspDevice.get_hostname()); -#endif /* Add the mouse as input device * Use the 'mouse' driver which reads the PC's mouse*/ diff --git a/src/main_sdl2.cpp b/src/main_sdl2.cpp index 302fcf29..80ef08a9 100644 --- a/src/main_sdl2.cpp +++ b/src/main_sdl2.cpp @@ -218,6 +218,7 @@ int main(int argc, char* argv[]) // To retrieve host information host_entry = gethostbyname(hostbuffer); // checkHostEntry(host_entry); + haspDevice.set_hostname(hostbuffer); // To convert an Internet network // address into ASCII string @@ -245,6 +246,7 @@ int main(int argc, char* argv[]) // return 67; } #endif + for(count = 0; count < argc; count++) { if(argv[count][0] == '-') { diff --git a/user_setups/darwin_sdl/darwin_sdl_64bits.ini b/user_setups/darwin_sdl/darwin_sdl_64bits.ini index 08bda544..1b16060d 100644 --- a/user_setups/darwin_sdl/darwin_sdl_64bits.ini +++ b/user_setups/darwin_sdl/darwin_sdl_64bits.ini @@ -56,10 +56,11 @@ build_flags = lib_deps = ${env.lib_deps} - lv_drivers@~7.9.1 + ; lv_drivers@~7.9.1 ;lv_drivers=https://github.com/littlevgl/lv_drivers/archive/7d71907c1d6b02797d066f50984b866e080ebeed.zip https://github.com/eclipse/paho.mqtt.c.git bblanchon/ArduinoJson@^6.17.2 ; Json(l) parser + https://github.com/fvanroie/lv_drivers lib_ignore = paho From be2019d34441d9870e3380aac96ab43206024a08 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 9 Mar 2021 16:31:14 +0100 Subject: [PATCH 2/2] Add README --- src/hal/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/hal/README.md diff --git a/src/hal/README.md b/src/hal/README.md new file mode 100644 index 00000000..25db048a --- /dev/null +++ b/src/hal/README.md @@ -0,0 +1,2 @@ +These files need to be obsoleted. +The functions should be moved to the respective device ot tft objects. \ No newline at end of file