FreeCalypso > hg > fc-tourmaline
view src/cs/drivers/drv_app/r2d/lcds/ColorPC/custom_process.pl @ 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 | 4e78acac3d88 |
children |
line wrap: on
line source
#!perl # Mode os scanning (vertical or horizontal) $mode=$ARGV[0]; # Name of file used to transfer data between this script and the r2d_font_tool $data=$ARGV[1]; if (($#ARGV+1)>2) { $x=$ARGV[3]; open(DATA,">$data") or die "Cannot create data file : $!\n"; $words = int($x)+1; # One word must be added because the alignement is done by excess print DATA $words; close(DATA); } else { # Open the data file to import glyph bit matrix generated by r2d_font_tool open(DATA,"$data") or die "Cannot open input file : $!\n"; # It is the size unmodified by r2d_font_tool (width in vertical mode and # height in horizontal mode). It corresponds to the width/height for the # current glyph $matrix_size=int(<DATA>); # It is the size which is word aligned by r2d_font_tool (height in # vertical mode and width in horizontal one) # It corresponds to the max width/height on all fonts. $matrix_aligned_size=int(<DATA>); # Original value before word alignment # (Max value on all glyphs before alignment) $matrix_max_size=int(<DATA>); # Width of the glyph image in the bitmap $matrix_image_width=int(<DATA>); # Height of the glyph in the bitmap $matrix_image_height=int(<DATA>); if ($mode =~ /vertical/) { # Scanning of the glyph bit matrix done column per column # (since datas are saved column per column by r2d_font_tool # when in horizontal mode) for($i=0;$i<$matrix_size;$i++) { for($j=0;$j<$matrix_aligned_size;$j++) { $matrix{$i.".".$j}=int(<DATA>); } } } else { # Scanning of the glyph bit matrix done line per line for($i=0;$i<$matrix_aligned_size;$i++) { for($j=0;$j<$matrix_size;$j++) { $matrix{$i.".".$j}=int(<DATA>); } } } close(DATA); # That part of the code is translating the glyph (initially represented # as a bit matrix) to a format which is compatible with the current LCD. # # In this example, the LCD is a 24 bpp one. So, a bit 0 (correponding to black) # must be converted to 0, and 1 (for white) to 0xFFFFFF. # # The scanning must use the IMAGE width in vertical mode # and the IMAGE height in horizontal mode. # In vertical mode, the height must use max_size on all glyph # In horizontal mode, the width must use the max_size. # You can either use the aligned_version if you LCD is a 1bpp one and # or you can use the non aligned one (matrix_max_size) and do the alignment # yourself. # In our case, the LCD is a 24bpp, so no alignment is required and the # max_size is used directly. $words=int($matrix_max_size) ; $aligned=$words; open(DATA,">$data") or die "Cannot create data file : $!\n"; # Scanning line per line for($j=0;$j<$matrix_image_height;$j++) { for($i=0;$i<$aligned;$i++) { $ra=$matrix{$i.".".$j}; # Conversion of bit to color value if ($ra == 0) { $ra=0x00FFFFFF; } else { $ra=0x00000000; } $res=sprintf "0x%08X\n",$ra; print DATA $res; } } close(DATA); }