FreeCalypso > hg > freecalypso-sw
annotate rvinterf/lowlevel/rviflcd.c @ 923:10b4bed10192
gsm-fw/L1: fix for the DSP patch corruption bug
The L1 code we got from the LoCosto fw contains a feature for DSP CPU load
measurement. This feature is a LoCosto-ism, i.e., not applicable to earlier
DBB chips (Calypso) with their respective earlier DSP ROMs. Most of the
code dealing with that feature is conditionalized as #if (DSP >= 38),
but one spot was missed, and the MCU code was writing into an API word
dealing with this feature. In TCS211 this DSP API word happens to be
used by the DSP code patch, hence that write was corrupting the patched
DSP code.
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 19 Oct 2015 17:13:56 +0000 |
parents | 16ed75e266f2 |
children |
rev | line source |
---|---|
908
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * This rvinterf module implements the piping of LCD output to fc-lcdemu |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 */ |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 #include <sys/types.h> |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 #include <stdio.h> |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <string.h> |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include <strings.h> |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 #include <stdlib.h> |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 #include <unistd.h> |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 extern u_char rxpkt[]; |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 extern size_t rxpkt_len; |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 char *extlcd_program; |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 FILE *extlcd_pout; |
909
16ed75e266f2
rvinterf LCD output inversion option implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
908
diff
changeset
|
17 u_char extlcd_invert; |
908
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 void |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 open_extlcd_pipe() |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 { |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 extlcd_pout = popen(extlcd_program, "w"); |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 if (!extlcd_pout) { |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 perror(extlcd_program); |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 exit(1); |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 } |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 } |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 void |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 output_to_extlcd() |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 { |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 int i; |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 fprintf(extlcd_pout, "%u %u ", rxpkt[1], rxpkt[2]); |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 for (i = 3; i < rxpkt_len; i += 2) |
909
16ed75e266f2
rvinterf LCD output inversion option implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
908
diff
changeset
|
36 fprintf(extlcd_pout, "%02X%02X", rxpkt[i+1] ^ extlcd_invert, |
16ed75e266f2
rvinterf LCD output inversion option implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
908
diff
changeset
|
37 rxpkt[i] ^ extlcd_invert); |
908
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 fputc('\n', extlcd_pout); |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 fflush(extlcd_pout); |
ed5dcc53e0b3
rvinterf: hook for fc-lcdemu implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 } |