diff --git a/src/dev/posix/hasp_posix.cpp b/src/dev/posix/hasp_posix.cpp index b3782006..96e46630 100644 --- a/src/dev/posix/hasp_posix.cpp +++ b/src/dev/posix/hasp_posix.cpp @@ -1,6 +1,7 @@ #if defined(POSIX) #include +#include #include "hasp_posix.h" @@ -10,14 +11,29 @@ #include "display/monitor.h" +extern monitor_t monitor; + namespace dev { void PosixDevice::reboot() {} void PosixDevice::show_info() { - LOG_VERBOSE(0, F("Processor : %s"), "unknown"); - LOG_VERBOSE(0, F("CPU freq. : %i MHz"), 0); + + struct utsname uts; + + if (uname(&uts) < 0) { + LOG_ERROR(0,"uname() error"); + } else { + LOG_VERBOSE(0,"Sysname: %s", uts.sysname); + LOG_VERBOSE(0,"Nodename: %s", uts.nodename); + LOG_VERBOSE(0,"Release: %s", uts.release); + LOG_VERBOSE(0,"Version: %s", uts.version); + LOG_VERBOSE(0,"Machine: %s", uts.machine); + } + + LOG_VERBOSE(0, "Processor : %s", "unknown"); + LOG_VERBOSE(0, "CPU freq. : %i MHz", 0); } @@ -28,6 +44,7 @@ const char* PosixDevice::get_hostname() void PosixDevice::set_hostname(const char* hostname) { _hostname = hostname; + SDL_SetWindowTitle(monitor.window, hostname); } const char* PosixDevice::get_core_version() { @@ -73,7 +90,14 @@ bool PosixDevice::get_backlight_power() void PosixDevice::update_backlight() { - monitor_backlight(_backlight_power ? map(_backlight_level, 0, 100, 0, 255) : 0); + uint8_t level = _backlight_power ? map(_backlight_level, 0, 100, 0, 255) : 0; + + SDL_SetTextureColorMod(monitor.texture, level, level, level); + // window_update(&monitor); + monitor.sdl_refr_qry = true; + // monitor_sdl_refr(NULL); + const lv_area_t area = {1,1,0,0}; + //monitor_flush(NULL,&area,NULL); } size_t PosixDevice::get_free_max_block() diff --git a/src/dev/win32/hasp_win32.cpp b/src/dev/win32/hasp_win32.cpp index 6142cdb8..eb7494bc 100644 --- a/src/dev/win32/hasp_win32.cpp +++ b/src/dev/win32/hasp_win32.cpp @@ -49,6 +49,7 @@ const char* Win32Device::get_hostname() void Win32Device::set_hostname(const char* hostname) { _hostname = hostname; + SDL_SetWindowTitle(monitor.window, hostname); } const char* Win32Device::get_core_version() { diff --git a/user_setups/linux_sdl/linux_sdl_64bits.ini b/user_setups/linux_sdl/linux_sdl_64bits.ini index ac81d624..7587733c 100644 --- a/user_setups/linux_sdl/linux_sdl_64bits.ini +++ b/user_setups/linux_sdl/linux_sdl_64bits.ini @@ -55,6 +55,7 @@ lib_deps = ;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