changeset 46:f297861532cf

fix for the keypad backlight flicker (LT_Status() for deep sleep)
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Thu, 12 Nov 2015 05:10:51 +0000
parents e1379873c398
children 3cc7897a6582
files chipsetsw/drivers/drv_app/buzzer/buzzer.c chipsetsw/services/lls/lls_api.c
diffstat 2 files changed, 34 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/drivers/drv_app/buzzer/buzzer.c	Thu Nov 12 02:38:40 2015 +0000
+++ b/chipsetsw/drivers/drv_app/buzzer/buzzer.c	Thu Nov 12 05:10:51 2015 +0000
@@ -159,10 +159,27 @@
 
 /*
  * LT_Status
- * 
+ *
  * Return lighting status for sleep manager
- * 
+ *
+ * FreeCalypso change: the software as delivered by TI is broken
+ * in this regard: when built for D-Sample (BOARD 41), their BMI
+ * treats Iota LEDB as "the backlight", which does require the
+ * 13 MHz clock to be running, but their LT_Status() function
+ * (called from the L1 binary blob) only checks the older B & C
+ * kind of backlight status, and always returns "all clear" on
+ * the D-Sample.
+ *
+ * This bug matters for us on Mot C139 and other targets that use
+ * Iota LEDB for the keypad backlight: when this backlight is on
+ * and L1 enters deep sleep, the light flickers visibly.
+ *
+ * Our solution: we introduce a hacky global variable here which
+ * LT_Status() will simply return, and we'll hack LLS to set and
+ * clear it when it turns Iota LEDB on and off.
  */
+unsigned char iota_ledb_status;
+
 SYS_BOOL LT_Status(void)
 {
 #if (BOARD == 7 || BOARD == 8 || BOARD == 9)
@@ -172,6 +189,6 @@
       return(0); 
 #endif
 
-return(0); 
+return(iota_ledb_status);
 
 }
--- a/chipsetsw/services/lls/lls_api.c	Thu Nov 12 02:38:40 2015 +0000
+++ b/chipsetsw/services/lls/lls_api.c	Thu Nov 12 05:10:51 2015 +0000
@@ -31,6 +31,9 @@
 /** External declaration */
 extern T_LLS_ENV_CTRL_BLK* lls_env_ctrl_blk;
 
+/* FreeCalypso hack, see LT_Status() in drivers/drv_app/buzzer/buzzer.c */
+extern unsigned char iota_ledb_status;
+
 
 /**
  * @name Functions implementation
@@ -62,10 +65,14 @@
 
    if (ret != RV_OK)
    {
-      LLS_SEND_TRACE("LLS: Equipment is unknow", RV_TRACE_LEVEL_ERROR);
+      LLS_SEND_TRACE("LLS: Equipment is unknown", RV_TRACE_LEVEL_ERROR);
       return ret;
    }
 
+   /* FreeCalypso hack */
+   if (equipment_sort == LLS_BACKLIGHT)
+      iota_ledb_status = 1;
+
    ret = lls_manage_equipment(equipment_index, SWITCH_ON);
 
    return ret;
@@ -99,12 +106,16 @@
 
    if (ret != RV_OK)
    {
-      LLS_SEND_TRACE("LLS: Equipment is unknow", RV_TRACE_LEVEL_ERROR);
+      LLS_SEND_TRACE("LLS: Equipment is unknown", RV_TRACE_LEVEL_ERROR);
       return ret;
    }
 
    ret = lls_manage_equipment(equipment_index, SWITCH_OFF);
-   
+
+   /* FreeCalypso hack */
+   if (equipment_sort == LLS_BACKLIGHT)
+      iota_ledb_status = 0;
+
    return ret;
 
 #else