|
|
@@ -38,6 +38,9 @@
|
|
|
pd.nKiBUsed = ps.nKiBUsed
|
|
|
#define _DELETE_MOUNTPOINT(pd) memset(pd.szMntPoint, 0, sizeof(pd.szMntPoint))
|
|
|
|
|
|
+#define _SYS_FS_TIVA_BACKLIGHT_DUTYCYCLE "/sys/gfa/tiva/backlight/dutycycle"
|
|
|
+#define _SYS_FS_TIVA_BACKLIGHT_BRIGHTNESS "/sys/class/leds/backlight/brightness"
|
|
|
+
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
static const char *g_pszKnownAppNames[] =
|
|
|
@@ -1427,7 +1430,6 @@ void CAppCtrl::Lock(void)
|
|
|
{
|
|
|
if(m_hShm)
|
|
|
{
|
|
|
-// if(::GfaIpcInterlockedIncrement(m_hShm, &m_nLockCount) == 1)
|
|
|
(*m_pfnLockSHM)(m_hShm);
|
|
|
}
|
|
|
}
|
|
|
@@ -1436,7 +1438,6 @@ void CAppCtrl::Unlock(void)
|
|
|
{
|
|
|
if(m_hShm)
|
|
|
{
|
|
|
-// if(::GfaIpcInterlockedDecrement(m_hShm, &m_nLockCount) == 0)
|
|
|
(*m_pfnUnlockSHM)(m_hShm);
|
|
|
}
|
|
|
}
|
|
|
@@ -1455,6 +1456,35 @@ void CAppCtrl::SetLockUnlockFunctions(PFN_GFA_IPC_LOCK_SHM pfnLockSHM, PFN_GFA_I
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+bool CAppCtrl::SetBacklight(int nPercent)
|
|
|
+{
|
|
|
+ FILE *pf = nullptr;
|
|
|
+
|
|
|
+ if(nPercent < 0)
|
|
|
+ nPercent = 0;
|
|
|
+ else if(nPercent > 100)
|
|
|
+ nPercent = 100;
|
|
|
+
|
|
|
+ if(GfAIpcGetTargetHasTiva())
|
|
|
+ {
|
|
|
+ pf = fopen(_SYS_FS_TIVA_BACKLIGHT_DUTYCYCLE, "w");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ nPercent = nPercent * 255 / 100;
|
|
|
+ pf = fopen(_SYS_FS_TIVA_BACKLIGHT_BRIGHTNESS, "w");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(pf)
|
|
|
+ {
|
|
|
+ int ret = fprintf(pf, "%d", nPercent) > 0;
|
|
|
+ fclose(pf);
|
|
|
+ return (ret > 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
@@ -1836,6 +1866,18 @@ bool GfaIpcAppCtrlSetLockUnlockFunctions(HAPPCTRL hAC, PFN_GFA_IPC_LOCK_SHM pfnL
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+bool GfaIpcAppCtrlSetBacklight(HAPPCTRL hAC, int nPercent)
|
|
|
+{
|
|
|
+ CAppCtrl *p = reinterpret_cast<CAppCtrl*>(hAC);
|
|
|
+ if(p)
|
|
|
+ {
|
|
|
+ return p->SetBacklight(nPercent);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
/////////////////////////////////////////////////////////////////////////////
|