annotate src/cs/drivers/drv_app/spi/spi_task.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 34b7059b9337
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 /* */
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
3 /* Name spi_task.c */
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 /* */
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
5 /* Function this file contains the main SPI function: spi_core. */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
6 /* It contains the body of the SPI task. */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
7 /* It will initialize the SPI and then wait for messages */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
8 /* or functions calls. */
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 /* */
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
10 /* Version 0.1 */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
11 /* Author Candice Bazanegue */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
12 /* */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
13 /* Date Modification */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
14 /* ------------------------------------ */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
15 /* 20/08/2000 Create */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
16 /* 01/09/2003 Modfication */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
17 /* Author Pascal Puel */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
18 /* */
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 /* (C) Copyright 2000 by Texas Instruments Incorporated, All Rights Reserved */
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 #ifndef _WINDOWS
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #include "chipset.cfg"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #if (CHIPSET == 12)
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 #include "inth/sys_inth.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #else
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #include "inth/iq.h" // for IQ_Unmask()
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #endif
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include "power/power.h" // for Switch_ON()
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #endif
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "rv/rv_defined_swe.h" // for RVM_PWR_SWE
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #include "rvm/rvm_use_id_list.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #include "spi/spi_env.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #include "spi/spi_process.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #include "spi/spi_task.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #ifdef RVM_PWR_SWE
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #include "pwr/pwr_liion_cha.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #include "pwr/pwr_disch.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "pwr/pwr_process.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "pwr/pwr_env.h"
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #endif
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 /*******************************************************************************
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 ** Function spi_core
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 **
259
365833d1d186 drv_app/spi/*: rm trailing white space
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
49 ** Description Core of the spi task, which initiliazes the spi SWE and
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
50 ** waits for messages.
259
365833d1d186 drv_app/spi/*: rm trailing white space
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
51 **
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 *******************************************************************************/
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 T_RV_RET spi_core(void)
259
365833d1d186 drv_app/spi/*: rm trailing white space
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
54 {
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
55 BOOLEAN error_occured = FALSE;
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
56 T_RV_HDR * msg_ptr;
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
58 rvf_send_trace("SPI_task: Initialization", 24, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID);
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 SPI_GBL_INFO_PTR->SpiTaskReady = TRUE;
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #ifndef _WINDOWS
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 /* Unmask External Interrupt once the SPI task is started */
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #if (CHIPSET == 12)
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 // Unmask ABB ext interrupt
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 F_INTH_ENABLE_ONE_IT(C_INTH_ABB_IRQ_IT);
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #else
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 // Unmask external (ABB) interrupt
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 IQ_Unmask(IQ_EXT);
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 #endif
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
70 // Get the switch on cause from ABB.
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
71 Set_Switch_ON_Cause();
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #endif
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
74 /* loop to process messages */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
75 while (error_occured == FALSE)
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
76 {
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
77 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
78 UINT16 received_event = rvf_wait (0xffff, 0);
259
365833d1d186 drv_app/spi/*: rm trailing white space
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
79
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
80 /* If an event related to mailbox 0 is received, then */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
81 if (received_event & RVF_TASK_MBOX_0_EVT_MASK)
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
82 {
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
83 /* Read the message in the driver mailbox and delegate action..*/
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
84 msg_ptr = (T_RV_HDR *) rvf_read_mbox(SPI_MAILBOX);
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 #ifdef RVM_PWR_SWE
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
87 if(spi_process(msg_ptr))
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
88 {
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
89 pwr_process(msg_ptr);
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
90 }
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #else
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
92 spi_process(msg_ptr);
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
93 #endif
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
94 }
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 #ifdef RVM_PWR_SWE
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
97 /* Timers */
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 if (received_event & SPI_TIMER0_WAIT_EVENT)
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 {
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 pwr_bat_test_timer_process();
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 }
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
103 if (received_event & SPI_TIMER1_WAIT_EVENT)
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
104 /* timer used to detect the end of the CI charge */
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 {
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 pwr_CI_charge_timer_process();
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 }
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 if (received_event & SPI_TIMER2_WAIT_EVENT)
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
110 /* timer used to detect the end of the CV charge */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
111 {
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 pwr_CV_charge_timer_process();
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 }
259
365833d1d186 drv_app/spi/*: rm trailing white space
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
114
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
115 if (received_event & SPI_TIMER3_WAIT_EVENT)
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
116 /* timer used to check the battery discharge level */
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
117 {
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 pwr_discharge_timer_process();
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 }
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
120 #endif
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
121 } // end of while
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
122 return RV_OK;
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 }
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 /**********************************************************************************
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
127 * Function : spi_adc_on
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 *
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 * Description : Put the variable is_adc_on of the T_SPI_GBL_INFO structure to TRUE.
260
34b7059b9337 drv_app/spi/*: code readability fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 259
diff changeset
130 * This variable is used for the battery management.
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 * This function is called by the CST entity.
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 *
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 * Parameters : None
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 *
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 * Return : None
259
365833d1d186 drv_app/spi/*: rm trailing white space
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
136 *
0
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 **********************************************************************************/
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 void spi_adc_on (void)
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 {
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 SPI_GBL_INFO_PTR->is_adc_on = TRUE;
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 rvf_send_trace("SPI: ADC are on",15,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 NULL_PARAM,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 RV_TRACE_LEVEL_DEBUG_LOW,
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 SPI_USE_ID);
4e78acac3d88 src/{condat,cs,gpf,nucleus}: import from Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 }