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
19 /* USER CODE BEGIN (0) */
\r
20 #include "FreeRTOS.h"
\r
21 #include "os_semphr.h"
\r
22 #include "os_task.h"
\r
24 extern xQueueHandle inputCharacterQueue;
\r
25 extern uint8_t character;
\r
26 extern xSemaphoreHandle canMsgReceived;
\r
28 extern xSemaphoreHandle adcDataConverted;
\r
29 extern ADCData_t adc1Data;
\r
33 void esmGroup1Notification(uint32_t channel)
\r
35 /* enter user code and remove the while loop... */
\r
37 /* USER CODE BEGIN (1) */
\r
42 /* USER CODE BEGIN (2) */
\r
45 void esmGroup2Notification(uint32_t channel)
\r
47 /* enter user code and remove the while loop... */
\r
49 /* USER CODE BEGIN (3) */
\r
54 /* USER CODE BEGIN (4) */
\r
57 void memoryPort0TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
\r
59 /* enter user code and remove the while loop... */
\r
61 /* USER CODE BEGIN (5) */
\r
66 /* USER CODE BEGIN (6) */
\r
69 void memoryPort1TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
\r
71 /* enter user code and remove the while loop... */
\r
73 /* USER CODE BEGIN (7) */
\r
78 /* USER CODE BEGIN (8) */
\r
80 void adcNotification(adcBASE_t *adc, uint32_t group)
\r
83 /* USER CODE BEGIN (11) */
\r
84 if (adc->GxINTFLG[group] & 8) { // Group has been read
\r
86 ch_count = adcGetData(adc, group, &adc1Data.adc_data[0]);
\r
87 adc1Data.flags |= (ch_count == adc1Data.ch_count) ? 0 : BAD_CHANNELS_COUNT;
\r
88 xSemaphoreGiveFromISR(adcDataConverted, NULL);
\r
90 if (adc->GxINTFLG[group] & 2) { // Memory overrun detected
\r
91 adc1Data.flags |= MEM_OVERRUN;
\r
92 adc->GxFIFORESETCR[1] = 1;
\r
98 /* USER CODE BEGIN (12) */
\r
100 void canErrorNotification(canBASE_t *node, uint32_t notification)
\r
102 /* USER CODE BEGIN (13) */
\r
103 if (notification != canERROR_OK) while(1) ;
\r
104 /* USER CODE END */
\r
108 /* USER CODE BEGIN (14) */
\r
109 /* USER CODE END */
\r
111 void canMessageNotification(canBASE_t *node, uint32_t messageBox)
\r
114 /* USER CODE BEGIN (15) */
\r
117 if (messageBox == canMESSAGE_BOX1)
\r
119 /* node 2 - receive testloopback message complete */
\r
120 while(!canIsRxMessageArrived(canREG2, canMESSAGE_BOX1));
\r
121 xSemaphoreGiveFromISR(canMsgReceived, NULL);
\r
125 /* USER CODE END */
\r
129 /* USER CODE BEGIN (16) */
\r
130 /* USER CODE END */
\r
132 void sciNotification(sciBASE_t *sci, uint32_t flags)
\r
135 /* USER CODE BEGIN (29) */
\r
136 if (sci == sciREG) {
\r
137 if (flags & SCI_RX_INT) {
\r
138 sciReceive(sci, 1, NULL);
\r
141 /* USER CODE END */
\r
145 /* USER CODE BEGIN (30) */
\r
146 /* USER CODE END */
\r