diff src/ui/mfw/mfw_mme.c @ 214:adfdbcd360fd

backlight evolution: API between Condat driver and MFW With this change, the API between the Condat backlight driver and its user in MFW now carries more abstract backlight state codes (fully off, fully on, in call, charging boot mode) instead of 0-255 levels. This change is needed in order to more properly support different hardware targets with different capabilities and approaches in terms of backlight handling.
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 23 Apr 2021 23:52:02 +0000
parents 45455ba52f9d
children 3edd1a600218
line wrap: on
line diff
--- a/src/ui/mfw/mfw_mme.c	Thu Apr 22 21:23:16 2021 +0000
+++ b/src/ui/mfw/mfw_mme.c	Fri Apr 23 23:52:02 2021 +0000
@@ -168,11 +168,6 @@
 static U8 battState = 0;                /* state of power supply    */
 static U16 hdsPresence = 0;             /* headset presence         */
 
-/* backlight control internals */
-#define	LIGHT_LEVEL_OFF	0
-#define	LIGHT_LEVEL_LOW	16
-#define	LIGHT_LEVEL_MAX	255
-
 UBYTE mme_backlight_incall, mme_backlight_notimer;
 static U8 current_backlight_level;
 
@@ -462,7 +457,7 @@
 {
 	timStop(&bltimIdleH);
 	timStop(&bltimCallH);
-	mmeBackLight(LIGHT_LEVEL_MAX);
+	mmeBackLight(LIGHT_STATUS_ON);
 	if (mme_backlight_notimer)
 		return;
 	if (mme_backlight_incall)
@@ -475,21 +470,21 @@
 {
 	int ret;
 
-	ret = (current_backlight_level == LIGHT_LEVEL_OFF);
+	ret = (current_backlight_level == LIGHT_STATUS_OFF);
 	timStop(&bltimIdleH);
 	timStop(&bltimCallH);
-	mmeBackLight(LIGHT_LEVEL_MAX);
+	mmeBackLight(LIGHT_STATUS_ON);
 	return ret;
 }
 
 static int bl_timeout_idle (U32 t, void *h)
 {
-	mmeBackLight(LIGHT_LEVEL_OFF);
+	mmeBackLight(LIGHT_STATUS_OFF);
 }
 
 static int bl_timeout_call (U32 t, void *h)
 {
-	mmeBackLight(LIGHT_LEVEL_LOW);
+	mmeBackLight(LIGHT_STATUS_INCALL);
 }