annotate src/cs/drivers/drv_app/fchg/fchg_common.h @ 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 75067af48bfd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * The definitions in this header file are used both in the external API
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * and in the internal structures.
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #ifndef __FCHG_COMMON_H
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #define __FCHG_COMMON_H
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 enum fchg_state {
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 FCHG_STATE_NO_EXT_PWR = 0,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 FCHG_STATE_PWR_PLUG_TIMER,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 FCHG_STATE_READY_TO_CHARGE,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 FCHG_STATE_READY_TO_RECHARGE,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 FCHG_STATE_I2V_CAL_1,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 FCHG_STATE_I2V_CAL_2,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 FCHG_STATE_CI_CHARGING,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 FCHG_STATE_CV_CHARGING,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 FCHG_STATE_RECHARGE_TIMER,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 FCHG_STATE_NO_CHARGING
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 };
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 /* from original PWR SWE */
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 typedef UINT8 T_PWR_PERCENT;
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
61
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
25 enum fchg_event {
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
26 FCHG_EVENT_DISCHARGE,
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
27 FCHG_EVENT_CHARGER_PLUG,
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
28 FCHG_EVENT_CHARGER_UNPLUG,
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
29 FCHG_EVENT_CHARGING_START,
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
30 FCHG_EVENT_CHARGING_COMPLETE,
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
31 FCHG_EVENT_CHARGING_STOPPED,
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
32 FCHG_EVENT_CHARGING_TIMEOUT
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
33 };
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
34
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
35 typedef void (*T_FCHG_EVENT_HANDLER)(enum fchg_event);
75067af48bfd FCHG updates for Tourmaline UI integration
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
36
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #endif /* include guard */