annotate src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_i_96x64.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 4221c724c664
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include "r2d/lcds/luna/r2d_luna_lcd.h"
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include "r2d/lcds/luna/colormap.h"
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 void r2d_lcd_power_on(void)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 {
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 }
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 void r2d_lcd_power_off(void)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 {
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 }
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 void r2d_refresh(void)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 {
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 UINT16 i, j, k;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 UINT32 v;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 UINT32 *p;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 INT16 y1, y2;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 p=r2d_g_framebuffer->p_memory_words;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 y1=r2d_update_ul_y; //0
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 y2=r2d_update_br_y; //63
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
276
4221c724c664 R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents: 45
diff changeset
24 if (y1 > y2)
4221c724c664 R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents: 45
diff changeset
25 return;
4221c724c664 R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents: 45
diff changeset
26 r2d_reinit_update_region();
4221c724c664 R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents: 45
diff changeset
27
45
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 /* set window area */
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 LCD_REG_WR(0x36, 135);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 LCD_REG_WR(0x37, 40);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 LCD_REG_WR(0x38, y2 + 78);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 LCD_REG_WR(0x39, y1 + 78);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 /* set current write address */
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 LCD_REG_WR(0x20, 40);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 LCD_REG_WR(0x21, y1 + 78);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 /* set up for GRAM write */
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 LCD_IR = 0x22;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 p=p+y1*R2D_MWWIDTH;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 for (i=y1;i<=y2;i++)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 {
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 for (j = 0; j < R2D_MWWIDTH-1; j++)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 {
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 v=*p++;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 for (k=0;k<32;k++)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 {
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 if (v&1)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 LCD_DR = LCD16_COLOR_BLACK;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 else
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 LCD_DR = LCD16_COLOR_WHITE;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 v=v>>1;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 }
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 }
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 p++;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 }
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 }