comparison chipsetsw/layer1/dl1/dl1_com.c @ 167:c19fb53b730b

dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry() reconstruction of this module can be considered complete at this point
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 07 Jun 2016 06:48:07 +0000
parents 5bad5a0bdec2
children
comparison
equal deleted inserted replaced
166:5bad5a0bdec2 167:c19fb53b730b
259 * HISR associated to layer 1 sync. 259 * HISR associated to layer 1 sync.
260 */ 260 */
261 261
262 void layer_1_sync_HISR_entry (void) 262 void layer_1_sync_HISR_entry (void)
263 { 263 {
264 // Call Synchronous Layer1 264 /* automatic var for the CPU load measurement code below */
265 hisr(); 265 #if (TRACE_TYPE == 4)
266 unsigned long cpu;
267 #endif
268
269 // Call Synchronous Layer1
270 hisr();
271
272 /*
273 * FreeCalypso: the following code has been reconstructed from
274 * the disassembly of the TCS211 binary object; it was found to be
275 * similar to the Trace_L1S_CPU_load() function in l1_trace.c
276 * which appears to have been only for (TRACE_TYPE == 1) originally.
277 */
278 #if (TRACE_TYPE == 4)
279 layer_1_sync_end_time = TIMER_RESET_VALUE - TM_ReadTimer(2);
280
281 cpu = (100 * layer_1_sync_end_time) / TICKS_PER_TDMA;
282 if (cpu > max_cpu)
283 {
284 max_cpu=cpu;
285 fn_max_cpu=l1s.actual_time.fn;
286 max_cpu_flag = 1;
287 /*
288 * TCS211 object has this bogus code here:
289
290 if (some non-understood condition) {
291 static int i;
292 i++; // static var never used anywhere
293 max_cpu_flag = 1;
294 }
295
296 * Because this bogus code does not change the result,
297 * I decided not to bother with reconstructing it.
298 */
299 }
300
301 if (((l1s.actual_time.fn%1326) == 0) && (max_cpu_flag == 0))
302 max_cpu = 0;
303 #endif
266 } 304 }
267 305
268 /* the following stub functions live in the dl1_com module per TCS211 */ 306 /* the following stub functions live in the dl1_com module per TCS211 */
269 307
270 void rx_tch_data (API *data_address, 308 void rx_tch_data (API *data_address,