view src/cs/drivers/drv_app/r2d/r2d_fonts.c @ 303:f76436d19a7a default tip

!GPRS config: fix long-standing AT+COPS chance hanging bug There has been a long-standing bug in FreeCalypso going back years: sometimes in the AT command bring-up sequence of an ACI-only MS, the AT+COPS command would produce only a power scan followed by cessation of protocol stack activity (only L1 ADC traces), instead of the expected network search sequence. This behaviour was seen in different FC firmware versions going back to Citrine, and seemed to follow some law of chance, not reliably repeatable. This bug has been tracked down and found to be specific to !GPRS configuration, stemming from our TCS2/TCS3 hybrid and reconstruction of !GPRS support that was bitrotten in TCS3.2/LoCosto version. ACI module psa_mms.c, needed only for !GPRS, was missing in the TCS3 version and had to be pulled from TCS2 - but as it turns out, there is a new field in the MMR_REG_REQ primitive that needs to be set correctly, and that psa_mms.c module is the place where this initialization needed to be added.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 08 Jun 2023 08:23:37 +0000
parents c905daaff834
children
line wrap: on
line source

/**
                                                                          
	@file:	r2d_fonts.c	
	
	@author Christophe Favergeon                              
                                                                          
    @version	0.5	

    Purpose:	Font file including all fonts definition which are LCD
	            dependen
	
*/

/*
																			
 	Date       	Modification												
  ------------------------------------									
    06/02/2001	Create		
	10/18/2001  Version 0.5 for first integration with Riviera database
																											    
																			
 (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
*/

#include "rv/general.h"

#include "rvm/rvm_gen.h"
#include "rvm/rvm_ext_priorities.h"
#include "rvf/rvf_api.h"

#include "r2d/r2d_config.h"
#include "r2d/r2d.h"
#include "r2d/r2d_i.h"


extern T_R2D_FONT_DESCRIPTION *r2d_g_font_configuration;

#define r2d_new_font(name) T_R2D_FRAMEBUFFER* r2d_g_font_framebuffer_##name=NULL; \
	INT32 *r2d_g_font_metrics_##name=(INT32*)r2d_font_metric_##name+R2D_METRIC_START

#define r2d_init_font_field(field,name) { \
r2d_g_font_configuration[field].table=(INT32*)r2d_font_ptree_##name; \
r2d_g_font_configuration[field].metrics=r2d_g_font_metrics_##name; \
r2d_g_font_configuration[field].framebuffer=(T_R2D_FRAMEBUFFER_PTR)r2d_g_font_framebuffer_##name; \
r2d_g_font_configuration[field].compute_bold=FALSE; \
}

#define r2d_init_font_field_without_bold(field,name) { \
r2d_g_font_configuration[field].table=(INT32*)r2d_font_ptree_##name; \
r2d_g_font_configuration[field].metrics=r2d_g_font_metrics_##name; \
r2d_g_font_configuration[field].framebuffer=(T_R2D_FRAMEBUFFER_PTR)r2d_g_font_framebuffer_##name; \
r2d_g_font_configuration[field].compute_bold=TRUE; \
}

#define r2d_clean_font(name) \
 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name->mutex));\
 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\
 r2d_g_font_framebuffer_##name=NULL;

#if (R2D_REFRESH == R2D_VERTICAL) 
#define r2d_init_font(name) \
	h=r2d_font_metric_##name[0]; \
v=r2d_font_metric_##name[1]; \
   words=r2d_font_metric_##name[2]; \
   rvf_get_buf(r2d_mb_id, sizeof(T_R2D_FRAMEBUFFER), \
   (T_RVF_BUFFER**)&r2d_g_font_framebuffer_##name);\
   if (r2d_g_font_framebuffer_##name==NULL)\
     ret_err=R2D_MEMORY_ERR;\
   else\
	 {\
   length=h*words; \
   r2d_g_font_framebuffer_##name->p_memory_words=(UINT32*)r2d_font_bitmap_##name; \
   r2d_g_font_framebuffer_##name->refcount=-1; \
   r2d_g_font_framebuffer_##name->kind=R2D_LCD_KIND; \
   r2d_g_font_framebuffer_##name->p_frame_buffer_end=r2d_g_font_framebuffer_##name->p_memory_words+length; \
   r2d_g_font_framebuffer_##name->width=h; \
   r2d_g_font_framebuffer_##name->height=v; \
   rvf_get_buf(r2d_mb_id, sizeof(T_RVF_MUTEX), \
   (T_RVF_BUFFER**)&(r2d_g_font_framebuffer_##name->mutex));\
   if (r2d_g_font_framebuffer_##name->mutex!=NULL)\
   {\
        T_RVF_RET err;\
		err=rvf_initialize_mutex(r2d_g_font_framebuffer_##name->mutex);\
		if (err!=RVF_OK)\
		{\
		         ret_err=R2D_MEMORY_ERR;\
				 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name->mutex));\
				 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\
				 r2d_g_font_framebuffer_##name=NULL;\
		}\
   }\
   else\
   {\
       ret_err=R2D_MEMORY_ERR;\
	   rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\
	   r2d_g_font_framebuffer_##name=NULL;\
   }\
}
#else
#define r2d_init_font(name) h=r2d_font_metric_##name[0]; \
   v=r2d_font_metric_##name[1]; \
   words=r2d_font_metric_##name[2]; \
   rvf_get_buf(r2d_mb_id, sizeof(T_R2D_FRAMEBUFFER), \
   (T_RVF_BUFFER**)&r2d_g_font_framebuffer_##name);\
   if (r2d_g_font_framebuffer_##name==NULL)\
     ret_err=R2D_MEMORY_ERR;\
   else\
	 {\
   length=v*words; \
   r2d_g_font_framebuffer_##name->p_memory_words=(UINT32*)r2d_font_bitmap_##name; \
   r2d_g_font_framebuffer_##name->refcount=-1; \
   r2d_g_font_framebuffer_##name->kind=R2D_LCD_KIND; \
   r2d_g_font_framebuffer_##name->p_frame_buffer_end=r2d_g_font_framebuffer_##name->p_memory_words+length; \
   r2d_g_font_framebuffer_##name->width=h; \
   r2d_g_font_framebuffer_##name->height=v; \
   rvf_get_buf(r2d_mb_id, sizeof(T_RVF_MUTEX), \
   (T_RVF_BUFFER**)&(r2d_g_font_framebuffer_##name->mutex));\
   if (r2d_g_font_framebuffer_##name->mutex!=NULL)\
   {\
        T_RVF_RET err;\
		err=rvf_initialize_mutex(r2d_g_font_framebuffer_##name->mutex);\
		if (err!=RVF_OK)\
		{\
		         ret_err=R2D_MEMORY_ERR;\
				 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name->mutex));\
				 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\
				 r2d_g_font_framebuffer_##name=NULL;\
		}\
   }\
   else\
   {\
       ret_err=R2D_MEMORY_ERR;\
	   rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\
	   r2d_g_font_framebuffer_##name=NULL;\
   }\
}
#endif

#if (R2D_EMBEDDED_LCD == R2D_SIMPLE_LCD)
#include "lcds/Simple/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_PC_COLOR_LCD)
#include "lcds/ColorPC/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_PC_CSAMPLE)
#include "lcds/PC_CSAMPLE/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_PC_DSAMPLE)
#include "lcds/PC_DSAMPLE/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_MIRRORED_LCD)
#include "lcds/Mirrored/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_CUSTOMER_LCD)
#include "lcds/Customer/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_HORIZONTAL_LCD)
#include "lcds/Horizontal/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_BOARD_COLOR_LCD)
#include "lcds/ColorBoard/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_BOARD_DSAMPLE)
#include "lcds/D_Sample/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_BOARD_BW_DSAMPLE)
#include "lcds/BW_D_Sample/r2d_font_init_i.c"
#endif

#if (R2D_EMBEDDED_LCD == R2D_FB_96x64_BW)
#include "lcds/BW_D_Sample/r2d_font_init_i.c"
#endif