comparison src/cs/riviera/rvt/rvt_task.c @ 319:9ffdfacfe969

implemented pseudo-modem keepalive for C139 and Pirelli targets
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 03 Dec 2017 03:51:28 +0000
parents 6cea809631d7
children 61f878c011b0
comparison
equal deleted inserted replaced
318:6cea809631d7 319:9ffdfacfe969
45 #define RVT_ALIVE_POLLING_TIME (RVF_MS_TO_TICKS (20000)) 45 #define RVT_ALIVE_POLLING_TIME (RVF_MS_TO_TICKS (20000))
46 46
47 #define RVT_WAIT_FOR_HEADER (1) 47 #define RVT_WAIT_FOR_HEADER (1)
48 #define RVT_WAIT_FOR_DATA (2) 48 #define RVT_WAIT_FOR_DATA (2)
49 49
50 #ifdef PSEUDO_MODEM_KEEPALIVE
51 extern void rvt_keepalive_register(void);
52 extern void rvt_keepalive_process(void);
53 #endif
50 54
51 /********************************************************************************/ 55 /********************************************************************************/
52 /* */ 56 /* */
53 /* Function Name: rvt_task_core */ 57 /* Function Name: rvt_task_core */
54 /* */ 58 /* */
69 /********************************************************************************/ 73 /********************************************************************************/
70 T_RVM_RETURN rvt_task_core (void) 74 T_RVM_RETURN rvt_task_core (void)
71 { 75 {
72 UINT16 event = 0; 76 UINT16 event = 0;
73 UINT32 nb_bytes_sent = 0; 77 UINT32 nb_bytes_sent = 0;
78
79 #ifdef PSEUDO_MODEM_KEEPALIVE
80 rvt_keepalive_register();
81 #endif
74 82
75 #ifdef FRAMING_PROTOCOL 83 #ifdef FRAMING_PROTOCOL
76 84
77 // Request for the level of filtering, as well as the 32-bit 85 // Request for the level of filtering, as well as the 32-bit
78 // mask related to the software entities to be monitored. 86 // mask related to the software entities to be monitored.
240 nb_bytes_sent += SER_tr_WriteNBytes (SER_LAYER_1, 248 nb_bytes_sent += SER_tr_WriteNBytes (SER_LAYER_1,
241 (UINT8 *) p_rvt_sys_time + nb_bytes_sent, 249 (UINT8 *) p_rvt_sys_time + nb_bytes_sent,
242 sys_time_length - nb_bytes_sent); 250 sys_time_length - nb_bytes_sent);
243 } 251 }
244 252
253 #ifdef PSEUDO_MODEM_KEEPALIVE
254 rvt_keepalive_process();
255 #endif
256
245 } // End of if (event & (RVF_TIMER_0_EVT_MASK)) 257 } // End of if (event & (RVF_TIMER_0_EVT_MASK))
246 } 258 }
247 #else 259 #else
248 260
249 // Start the 'Alive Polling Timer' 261 // Start the 'Alive Polling Timer'