changeset 135:c7f1d5598508

src/condat2/com/src/driver/display.c: C139 support from tcs211-c139
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 08 Oct 2016 04:54:29 +0000
parents 86f2e49f3595
children 0b3338d36367
files src/condat2/com/src/driver/display.c
diffstat 1 files changed, 24 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/condat2/com/src/driver/display.c	Sat Oct 08 04:32:26 2016 +0000
+++ b/src/condat2/com/src/driver/display.c	Sat Oct 08 04:54:29 2016 +0000
@@ -152,8 +152,10 @@
 *************************************************************************/
 #if (defined(_TARGET_))
 //#if (BOARD==33)
-#if ((BOARD == 8) || (BOARD == 9))
+/* C139: force C-Sample configuration */
+#if ((BOARD == 8) || (BOARD == 9) || defined(CONFIG_TARGET_C139))
 #define CSAMPLE
+#define CSAMPLE_NEWSTYLE
 #elif ((BOARD == 40) || (BOARD == 41))
 #define DSAMPLE
 #elif (BOARD == 43)
@@ -1951,10 +1953,12 @@
 #ifdef CSAMPLE
 #define HEADER_INFO (3)
 #define DISPLAY_SIZE (LCD_COL*LCD_COL_NUM_LWORDS)
+#ifdef CSAMPLE_OLDSTYLE
 static UINT32 	display_bw [DISPLAY_SIZE+HEADER_INFO+10];
 #ifdef USE_PLOT
 static UINT32 	displayCopy_bw [DISPLAY_SIZE+HEADER_INFO+1];   /* copy to flag differences */
 #endif
+#endif
 static UINT32*  picture_bw=NULL;//Pointer to data in display.
 static UINT32*  pictureCopy_bw= NULL;//Pointer to data in display.
 /* static char scratch [100];      */ /* command buffer - does not support output of new display  */
@@ -2521,7 +2525,7 @@
 //Initialises data required for bolck copy of a 'picture'
 void scrRivPictureClear(void)
 {
-#ifdef CSAMPLE
+#ifdef CSAMPLE_OLDSTYLE
     memset(display_bw,0,sizeof(display_bw));
 #ifdef USE_PLOT
     memset(displayCopy_bw,0,sizeof(displayCopy_bw));
@@ -2593,7 +2597,7 @@
 
 #endif
 
-#ifdef DSAMPLE_LITE
+#if defined(DSAMPLE_LITE) || defined(CSAMPLE_NEWSTYLE)
 	picture_bw = r2d_get_pixmap(r2d_g_lcd_gc);
 	memset(picture_bw,0,DISPLAY_SIZE*4);
 #endif
@@ -2615,7 +2619,7 @@
 	scrRivPictureClear();
 #endif
 
-#ifdef CSAMPLE
+#ifdef CSAMPLE_OLDSTYLE
 	strcpy(mb_name, "FRED");
 	mb_param.size = 256;
 	mb_param.watermark = 128;
@@ -2678,6 +2682,12 @@
 */
 void scrUnfocusDisplay(void)
 {
+/*
+ * FreeCalypso: this code appears to have been written for the D-Sample
+ * LCD only and does not support the older kinds.  Therefore, we are
+ * disabling it when targeting more feeble LCDs.
+ */
+#ifdef DSAMPLE
 #ifndef _SIMULATION_  // Turn off this BMI Schnickschnack ...
 	int x,y;
 	UINT32 *picPtr;
@@ -2716,6 +2726,7 @@
 		}
 	}
 #endif /* _SIMULATION_ */
+#endif /* DSAMPLE */
 }
 
 
@@ -2891,7 +2902,7 @@
 
 
 
-#ifdef CSAMPLE
+#ifdef CSAMPLE_OLDSTYLE
 void scrLCDUpdate (void)
 {
 int kstart,kend,k;
@@ -2960,6 +2971,14 @@
 }
 #endif //CSAMPLE
 
+#ifdef CSAMPLE_NEWSTYLE
+void scrLCDUpdate (void)
+{
+	if (scrEnabled)
+		r2d_flush();
+}
+#endif
+
 //June 03, 2005 REF: GSM-ENH-31636 xpradipg
 //CRR 28825:  xpradipg - 11 Feb 2005
 #if (defined(DSAMPLE) || defined(ESAMPLE) || defined(ISAMPLE) || defined(CALLISTO))// changes for flag cleanup and addition for ISAMPLE