FreeCalypso > hg > fc-tourmaline
comparison src/cs/drivers/drv_app/spi/spi_task.c @ 259:365833d1d186
drv_app/spi/*: rm trailing white space
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 14 May 2021 01:30:13 +0000 |
parents | 4e78acac3d88 |
children | 34b7059b9337 |
comparison
equal
deleted
inserted
replaced
258:45cc81cc6230 | 259:365833d1d186 |
---|---|
45 | 45 |
46 | 46 |
47 /******************************************************************************* | 47 /******************************************************************************* |
48 ** Function spi_core | 48 ** Function spi_core |
49 ** | 49 ** |
50 ** Description Core of the spi task, which initiliazes the spi SWE and | 50 ** Description Core of the spi task, which initiliazes the spi SWE and |
51 ** waits for messages. | 51 ** waits for messages. |
52 ** | 52 ** |
53 *******************************************************************************/ | 53 *******************************************************************************/ |
54 T_RV_RET spi_core(void) | 54 T_RV_RET spi_core(void) |
55 { | 55 { |
56 BOOLEAN error_occured = FALSE; | 56 BOOLEAN error_occured = FALSE; |
57 T_RV_HDR * msg_ptr; | 57 T_RV_HDR * msg_ptr; |
58 | 58 |
59 rvf_send_trace("SPI_task: Initialization", 24, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID); | 59 rvf_send_trace("SPI_task: Initialization", 24, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID); |
60 SPI_GBL_INFO_PTR->SpiTaskReady = TRUE; | 60 SPI_GBL_INFO_PTR->SpiTaskReady = TRUE; |
75 /* loop to process messages */ | 75 /* loop to process messages */ |
76 while (error_occured == FALSE) | 76 while (error_occured == FALSE) |
77 { | 77 { |
78 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */ | 78 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */ |
79 UINT16 received_event = rvf_wait (0xffff, 0); | 79 UINT16 received_event = rvf_wait (0xffff, 0); |
80 | 80 |
81 /* If an event related to mailbox 0 is received, then */ | 81 /* If an event related to mailbox 0 is received, then */ |
82 if (received_event & RVF_TASK_MBOX_0_EVT_MASK) | 82 if (received_event & RVF_TASK_MBOX_0_EVT_MASK) |
83 { | 83 { |
84 /* Read the message in the driver mailbox and delegate action..*/ | 84 /* Read the message in the driver mailbox and delegate action..*/ |
85 msg_ptr = (T_RV_HDR *) rvf_read_mbox(SPI_MAILBOX); | 85 msg_ptr = (T_RV_HDR *) rvf_read_mbox(SPI_MAILBOX); |
86 | 86 |
87 #ifdef RVM_PWR_SWE | 87 #ifdef RVM_PWR_SWE |
88 if(spi_process(msg_ptr)) | 88 if(spi_process(msg_ptr)) |
89 { | 89 { |
90 pwr_process(msg_ptr); | 90 pwr_process(msg_ptr); |
91 } | 91 } |
92 #else | 92 #else |
93 spi_process(msg_ptr); | 93 spi_process(msg_ptr); |
110 if (received_event & SPI_TIMER2_WAIT_EVENT) | 110 if (received_event & SPI_TIMER2_WAIT_EVENT) |
111 /* timer used to detect the end of the CV charge */ | 111 /* timer used to detect the end of the CV charge */ |
112 { | 112 { |
113 pwr_CV_charge_timer_process(); | 113 pwr_CV_charge_timer_process(); |
114 } | 114 } |
115 | 115 |
116 if (received_event & SPI_TIMER3_WAIT_EVENT) | 116 if (received_event & SPI_TIMER3_WAIT_EVENT) |
117 /* timer used to check the battery discharge level */ | 117 /* timer used to check the battery discharge level */ |
118 { | 118 { |
119 pwr_discharge_timer_process(); | 119 pwr_discharge_timer_process(); |
120 } | 120 } |
121 #endif | 121 #endif |
122 } // end of while | 122 } // end of while |
123 return RV_OK; | 123 return RV_OK; |
124 } | 124 } |
125 | 125 |
126 | 126 |
127 | 127 |
128 /********************************************************************************** | 128 /********************************************************************************** |
129 * Function : spi_adc_on | 129 * Function : spi_adc_on |
130 * | 130 * |
131 * Description : Put the variable is_adc_on of the T_SPI_GBL_INFO structure to TRUE. | 131 * Description : Put the variable is_adc_on of the T_SPI_GBL_INFO structure to TRUE. |
132 * This variable is used for the battery management. | 132 * This variable is used for the battery management. |
133 * This function is called by the CST entity. | 133 * This function is called by the CST entity. |
134 * | 134 * |
135 * Parameters : None | 135 * Parameters : None |
136 * | 136 * |
137 * Return : None | 137 * Return : None |
138 * | 138 * |
139 **********************************************************************************/ | 139 **********************************************************************************/ |
140 void spi_adc_on (void) | 140 void spi_adc_on (void) |
141 { | 141 { |
142 SPI_GBL_INFO_PTR->is_adc_on = TRUE; | 142 SPI_GBL_INFO_PTR->is_adc_on = TRUE; |
143 | 143 |