1 /** @file notification.c
\r
2 * @brief User Notification Definition File
\r
6 * This file defines empty notification routines.
\r
7 * The user needs to remove the while loop and define
\r
15 #include "sys_selftest.h"
\r
22 /* USER CODE BEGIN (0) */
\r
23 #include "FreeRTOS.h"
\r
24 #include "os_semphr.h"
\r
25 #include "os_task.h"
\r
27 /** @brief Semaphore blocking task when it waits for interrupt signaling message receive
\r
29 * Defined in commands.c */
\r
30 extern xSemaphoreHandle canMsgReceived;
\r
31 /** @brief Semaphore blocking task when it waits for interrupt signaling end of the conversion
\r
33 * Defined in commands.c */
\r
34 extern xSemaphoreHandle adcDataConverted;
\r
35 /** @brief Data structure containing converted data from ADC
\r
37 * Defined in commands.c */
\r
38 extern ADCData_t adcData;
\r
41 void esmGroup1Notification(uint32_t channel)
\r
43 /* enter user code and remove the while loop... */
\r
45 /* USER CODE BEGIN (1) */
\r
50 /* USER CODE BEGIN (2) */
\r
53 void esmGroup2Notification(uint32_t channel)
\r
55 /* enter user code and remove the while loop... */
\r
57 /* USER CODE BEGIN (3) */
\r
62 /* USER CODE BEGIN (4) */
\r
65 void memoryPort0TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
\r
67 /* enter user code and remove the while loop... */
\r
69 /* USER CODE BEGIN (5) */
\r
74 /* USER CODE BEGIN (6) */
\r
77 void memoryPort1TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
\r
79 /* enter user code and remove the while loop... */
\r
81 /* USER CODE BEGIN (7) */
\r
86 /* USER CODE BEGIN (8) */
\r
88 void adcNotification(adcBASE_t *adc, uint32_t group)
\r
90 /* USER CODE BEGIN (11) */
\r
91 // Group selected by group selector has been read
\r
92 if (adc->GxINTFLG[group] & 8) {
\r
94 ch_count = adcGetData(adc, group, &adcData.adc_data[0]);
\r
95 adcData.flags |= (ch_count == adcData.ch_count) ? 0 : BAD_CHANNELS_COUNT;
\r
96 xSemaphoreGiveFromISR(adcDataConverted, NULL);
\r
98 // Memory overrun detected - set flag
\r
99 if (adc->GxINTFLG[group] & 2) {
\r
100 adcData.flags |= MEM_OVERRUN;
\r
101 adc->GxFIFORESETCR[1] = 1;
\r
103 /* USER CODE END */
\r
106 /* USER CODE BEGIN (12) */
\r
107 /* USER CODE END */
\r
108 void canErrorNotification(canBASE_t *node, uint32_t notification)
\r
110 /* USER CODE BEGIN (13) */
\r
111 if (notification != canERROR_OK) while(1) ; // Critical error during CAN transaction
\r
112 /* USER CODE END */
\r
116 /* USER CODE BEGIN (14) */
\r
117 /* USER CODE END */
\r
119 void canMessageNotification(canBASE_t *node, uint32_t messageBox)
\r
121 /* USER CODE BEGIN (15) */
\r
124 if (messageBox == canMESSAGE_BOX1)
\r
126 /* node 2 - receive testloopback message complete */
\r
127 while(!canIsRxMessageArrived(canREG2, canMESSAGE_BOX1));
\r
128 xSemaphoreGiveFromISR(canMsgReceived, NULL);
\r
132 /* USER CODE END */
\r
135 /* USER CODE BEGIN (16) */
\r
136 /* USER CODE END */
\r
137 void gioNotification(int bit)
\r
139 /* enter user code and remove the while loop... */
\r
141 /* USER CODE BEGIN (19) */
\r
142 /* USER CODE END */
\r
146 /* USER CODE BEGIN (20) */
\r
147 /* USER CODE END */
\r
148 void mibspiNotification(mibspiBASE_t *mibspi, uint32_t flags)
\r
150 /* enter user code and remove the while loop... */
\r
152 /* USER CODE BEGIN (25) */
\r
153 /* USER CODE END */
\r
157 /* USER CODE BEGIN (26) */
\r
158 /* USER CODE END */
\r
160 void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32_t group)
\r
162 /* enter user code and remove the while loop... */
\r
164 /* USER CODE BEGIN (27) */
\r
165 /* USER CODE END */
\r
168 /* USER CODE BEGIN (28) */
\r
169 /* USER CODE END */
\r
171 void sciNotification(sciBASE_t *sci, uint32_t flags)
\r
173 /* USER CODE BEGIN (29) */
\r
174 if (sci == sciREG) {
\r
175 if (flags & SCI_RX_INT) {
\r
176 sciReceive(sci, 1, NULL); // Restart receiving
\r
179 /* USER CODE END */
\r
182 /* USER CODE BEGIN (30) */
\r
183 /* USER CODE END */
\r
184 void pwmNotification(hetBASE_t * hetREG,uint32_t pwm, uint32_t notification)
\r
186 /* enter user code and remove the while loop... */
\r
188 /* USER CODE BEGIN (33) */
\r
189 /* USER CODE END */
\r
193 /* USER CODE BEGIN (34) */
\r
194 /* USER CODE END */
\r
196 void edgeNotification(hetBASE_t * hetREG,uint32_t edge)
\r
198 /* enter user code and remove the while loop... */
\r
200 /* USER CODE BEGIN (35) */
\r
201 /* USER CODE END */
\r
205 /* USER CODE BEGIN (36) */
\r
206 /* USER CODE END */
\r
208 void hetNotification(hetBASE_t *het, uint32_t offset)
\r
210 /* enter user code and remove the while loop... */
\r
212 /* USER CODE BEGIN (37) */
\r
213 /* USER CODE END */
\r
217 /* USER CODE BEGIN (38) */
\r
218 /* USER CODE END */
\r