]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/src/sys/notification.c
Reformated by uncrustify
[pes-rpp/rpp-lib.git] / rpp / src / sys / notification.c
1 /** @file notification.c
2  *   @brief User Notification Definition File
3  *   @date 15.Mar.2012
4  *   @version 03.01.00
5  *
6  *   This file  defines  empty  notification  routines.
7  *   The user needs to remove the while loop and define
8  *   the sequence.
9  *
10  */
11
12 /* Include Files */
13
14 #include "sys/sys.h"
15 #include "rpp/eth.h"
16
17 void esmGroup1Notification(uint32_t channel)
18 {
19 /*  enter user code and remove the while loop... */
20         while (1) ;
21 }
22
23 void esmGroup2Notification(uint32_t channel)
24 {
25 /*  enter user code and remove the while loop... */
26         while (1) ;
27 }
28
29 void memoryPort0TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
30 {
31 /*  enter user code and remove the while loop... */
32         while (1) ;
33 }
34
35 void memoryPort1TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
36 {
37 /*  enter user code and remove the while loop... */
38         while (1) ;
39 }
40 /** @brief Semaphore blocking task when it waits for interrupt signaling message receive
41  *
42  */
43 void canErrorNotification(canBASE_t *node, uint32_t notification)
44 {}
45
46 void canMessageNotification(canBASE_t *node, uint32_t messageBox)
47 {}
48
49 void gioNotification(int bit)
50 {
51 /*  enter user code and remove the while loop... */
52         while (1) ;
53 }
54
55 void i2cNotification(i2cBASE_t *i2c, uint32_t flags)
56 {
57 /*  enter user code and remove the while loop... */
58         while (1) ;
59 }
60
61 void mibspiNotification(mibspiBASE_t *mibspi, uint32_t flags)
62 {
63 /*  enter user code and remove the while loop... */
64         while (1) ;
65 }
66
67 void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32_t group)
68 {
69 /*  enter user code and remove the while loop... */
70         while (1) ;
71 }
72
73 void pwmNotification(hetBASE_t *hetREG,uint32_t pwm, uint32_t notification)
74 {
75 /*  enter user code and remove the while loop... */
76         while (1) ;
77 }
78
79 void edgeNotification(hetBASE_t *hetREG,uint32_t edge)
80 {
81 /*  enter user code and remove the while loop... */
82         while (1) ;
83 }
84
85 void hetNotification(hetBASE_t *het, uint32_t offset)
86 {
87 /*  enter user code and remove the while loop... */
88         while (1) ;
89 }
90
91 /** Semaphore used to stop command, until message is received */
92 xSemaphoreHandle linMsgReceived;
93 /** Semaphore used to stop command, until ID is received */
94 xSemaphoreHandle linIDReceived;
95 void linNotification(linBASE_t *lin, uint32_t flags)
96 {
97         /* FIXME Moved code from somewhere else. It was in cmd_lin.c
98          * It seems that nobody in the library uses this.
99          * sys/ti_drv_lin.c calls this function from linLowLevelInterrupt()
100          * The function prototipe is in sys/ti_drv_lin.h, so maybe it should be
101          * better to move it there, but because it is a "high-level" notification
102          * it could be here.
103          */
104         if (flags & LIN_ID_INT)
105                 xSemaphoreGiveFromISR(linIDReceived, NULL);
106         if (flags & LIN_RX_INT) {
107                 lin->FLR |= (1 << 9);
108                 xSemaphoreGiveFromISR(linMsgReceived, NULL);
109         }
110 }
111
112 #ifndef FREERTOS_POSIX
113 extern boolean_t HostPendErrHandler(void);
114 #if PHY_LINK_MONITOR_INT
115 extern boolean_t LinkIntHandler(void);
116 #endif
117 #pragma INTERRUPT(MDIOMiscInt, IRQ)
118 void MDIOMiscInt(void)
119 {
120         if (HostPendErrHandler()) return;
121 #if PHY_LINK_MONITOR_INT
122         if (LinkIntHandler()) return;
123 #endif
124 }
125
126 extern void RxIntHandler(uint32_t instNum);
127 extern void TxIntHandler(uint32_t instNum);
128
129 volatile int countEMACCore0RxIsr = 0;
130 #pragma INTERRUPT(EMACCore0RxIsr, IRQ)
131 void EMACCore0RxIsr(void)
132 {
133         countEMACCore0RxIsr++;
134         RxIntHandler(0);
135         /* FIXME was in emac_cmd.c/eth.c and should move somewhere else.
136            rx_irq_cnt++;
137
138            // We know we have only one RX Packet Buffer descriptor --
139            // so we write it in CP to disable interrupt
140            EMACRxCPWrite(emacBase, channel, (unsigned int)rx_desc);
141            EMACCoreIntAck(emacBase, EMAC_INT_CORE0_RX);
142          */
143 }
144
145 volatile int countEMACCore0TxIsr = 0;
146 #pragma INTERRUPT(EMACCore0TxIsr, IRQ)
147 void EMACCore0TxIsr(void)
148 {
149         countEMACCore0TxIsr++;
150         TxIntHandler(0);
151         /* FIXME Was in emac_cmd.c/eth.c and should move somewhere else
152            tx_irq_cnt++;
153            // If is not being processed by the EMAC anymore
154            if (!(fr1.PktFlgLen & EMAC_DSC_FLAG_OWNER)) {
155            EMACTxCPWrite(emacBase, channel, (unsigned int)&fr1);
156            EMACCoreIntAck(emacBase, EMAC_INT_CORE0_TX);
157            }
158          */
159 }
160 #endif /* ifndef FREERTOS_POSIX */