From f5c57f6d1d7ecb3d80ddba5cbf3ed21c75f641f6 Mon Sep 17 00:00:00 2001 From: lupeng Date: Wed, 30 Jan 2019 11:45:51 +0800 Subject: [PATCH] [frame] move setting set LCDbrightness func to mail box, make sure PC compile Qt frame success --- package/netease/clockFrame/src/framelogic.cpp | 66 +++++++++++++++++++ package/netease/clockFrame/src/framelogic.h | 3 + package/netease/submodules | 2 +- target/allwinner/mandolin-c1evb/defconfig | 2 +- 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/package/netease/clockFrame/src/framelogic.cpp b/package/netease/clockFrame/src/framelogic.cpp index f6733f643..5d0a68471 100755 --- a/package/netease/clockFrame/src/framelogic.cpp +++ b/package/netease/clockFrame/src/framelogic.cpp @@ -1,6 +1,20 @@ #include #include "framelogic.h" +#include +#include +#include +#include +#include +#include +#include + +#define DISP_DEV "/dev/disp" +#define DISP_LCD_SET_BRIGHTNESS 0x102 +#define DISP_LCD_GET_BRIGHTNESS 0x103 +#define MAX_BRIGHTNESS_LEVEL 256 +#define DEV_CH 0 //显示通道0 + void setMailBox(void) { extern MailBox *mailbox; @@ -97,5 +111,57 @@ int DbusMailBox::s_wifiDisconnect() } +float DbusMailBox::getLCDBrightness(void) +{ + float lcdBl = -1; + int fbd; + unsigned int arg[3]; + unsigned int bl ; + fbd = open (DISP_DEV, O_RDWR); + if (fbd<0) + { + qDebug() << "Error opening framebuffer device:" << fbd; + return lcdBl; + } + + arg[0] = DEV_CH;//显示通道0 + bl = ioctl(fbd, DISP_LCD_GET_BRIGHTNESS, (void*)arg); + + close(fbd); + qDebug() << "Get brightness:" << bl<<"arg:"<=0){ + fbd = open (DISP_DEV, O_RDWR); + if (fbd<0) + { + qDebug() << "Error opening framebuffer device:" << fbd; + return -1; + } + + arg[0] = DEV_CH;//显示通道0 + arg[1] = bl; + ioctl(fbd, DISP_LCD_SET_BRIGHTNESS, (void*)arg); + + close(fbd); + + qDebug() << "Set brightness:" << bl<<"arg:"<getLCDBrightness(); +} diff --git a/package/netease/clockFrame/src/framelogic.h b/package/netease/clockFrame/src/framelogic.h index e58ba1950..20e0017bf 100755 --- a/package/netease/clockFrame/src/framelogic.h +++ b/package/netease/clockFrame/src/framelogic.h @@ -59,5 +59,8 @@ public: Q_INVOKABLE int s_wifiConnect(QString ssid, QString passwd) override; Q_INVOKABLE int s_wifiDisconnect() override; Q_INVOKABLE int s_wifiScan() override; + + float getLCDBrightness(void) override; + float setLCDBrightness(float val) override; }; diff --git a/package/netease/submodules b/package/netease/submodules index 936bfe741..a3dd4b736 160000 --- a/package/netease/submodules +++ b/package/netease/submodules @@ -1 +1 @@ -Subproject commit 936bfe741da4840da0ced51a22dd619ece604835 +Subproject commit a3dd4b7363cbc2e0bc6f6e2832a76d7f8f2ba4b1 diff --git a/target/allwinner/mandolin-c1evb/defconfig b/target/allwinner/mandolin-c1evb/defconfig index a0f6b11db..b7180052f 100755 --- a/target/allwinner/mandolin-c1evb/defconfig +++ b/target/allwinner/mandolin-c1evb/defconfig @@ -2910,7 +2910,7 @@ CONFIG_PACKAGE_libyunxin=y CONFIG_PACKAGE_KPlatinum=y CONFIG_PACKAGE_KPlayer=y CONFIG_PACKAGE_KPlayerTest=y -# CONFIG_PACKAGE_NeteaseInitScript is not set +CONFIG_PACKAGE_NeteaseInitScript=y CONFIG_PACKAGE_SPlayer=y CONFIG_PACKAGE_SPlayer-demo=y CONFIG_PACKAGE_alarmer=y