@@ -1255,7 +1255,9 void launch_waveform_picker( unsigned ch | |||
|
1255 | 1255 | |
|
1256 | 1256 | if (transitionCoarseTime == 0) |
|
1257 | 1257 | { |
|
1258 | waveform_picker_regs->start_date = time_management_regs->coarse_time; | |
|
1258 | // instant transition means transition on the next valid date | |
|
1259 | // this is mandatory to have a good snapshot period a a good correction of the snapshot period | |
|
1260 | waveform_picker_regs->start_date = time_management_regs->coarse_time + 1; | |
|
1259 | 1261 | } |
|
1260 | 1262 | else |
|
1261 | 1263 | { |
@@ -321,15 +321,12 rtems_task wfrm_task(rtems_task_argument | |||
|
321 | 321 | rtems_event_set event_out; |
|
322 | 322 | rtems_id queue_id; |
|
323 | 323 | rtems_status_code status; |
|
324 | bool resynchronisationEngaged; | |
|
325 | 324 | ring_node *ring_node_swf1_extracted_ptr; |
|
326 | 325 | ring_node *ring_node_swf2_extracted_ptr; |
|
327 | 326 | |
|
328 | 327 | ring_node_swf1_extracted_ptr = (ring_node *) &ring_node_swf1_extracted; |
|
329 | 328 | ring_node_swf2_extracted_ptr = (ring_node *) &ring_node_swf2_extracted; |
|
330 | 329 | |
|
331 | resynchronisationEngaged = false; | |
|
332 | ||
|
333 | 330 | status = get_message_queue_id_send( &queue_id ); |
|
334 | 331 | if (status != RTEMS_SUCCESSFUL) |
|
335 | 332 | { |
@@ -342,18 +339,9 rtems_task wfrm_task(rtems_task_argument | |||
|
342 | 339 | // wait for an RTEMS_EVENT |
|
343 | 340 | rtems_event_receive(RTEMS_EVENT_MODE_NORMAL, |
|
344 | 341 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
345 | if(resynchronisationEngaged == false) | |
|
346 | { // engage resynchronisation | |
|
342 | ||
|
347 | 343 |
|
|
348 | resynchronisationEngaged = true; | |
|
349 | } | |
|
350 | else | |
|
351 | { // reset delta_snapshot to the nominal value | |
|
352 | PRINTF("no resynchronisation, reset delta_snapshot to the nominal value\n"); | |
|
353 | set_wfp_delta_snapshot(); | |
|
354 | resynchronisationEngaged = false; | |
|
355 | } | |
|
356 | // | |
|
344 | ||
|
357 | 345 | if (event_out == RTEMS_EVENT_MODE_NORMAL) |
|
358 | 346 | { |
|
359 | 347 | DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM2\n"); |
@@ -520,7 +508,7 rtems_task cwf1_task(rtems_task_argument | |||
|
520 | 508 | PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status) |
|
521 | 509 | } |
|
522 | 510 | |
|
523 | BOOT_PRINTF("in CWF1 ***\n") | |
|
511 | BOOT_PRINTF("in CWF1 ***\n"); | |
|
524 | 512 | |
|
525 | 513 |
|
|
526 | 514 | // wait for an RTEMS_EVENT |
@@ -905,15 +893,15 void snapshot_resynchronization( unsigne | |||
|
905 | 893 | // which tick is the closest |
|
906 | 894 | if (deltaPreviousTick > deltaNextTick) |
|
907 | 895 | { |
|
908 | // deltaNext is in [ms] | |
|
909 |
deltaTickInF2 = |
|
|
896 | // the snapshot center is just before the second => increase delta_snapshot | |
|
897 | deltaTickInF2 = ceil( (deltaNext_ms * 256. / 1000.) ); | |
|
910 | 898 | waveform_picker_regs->delta_snapshot = waveform_picker_regs->delta_snapshot + 1 * deltaTickInF2; |
|
911 | 899 | PRINTF2("correction of = + %u, delta_snapshot = %d\n", deltaTickInF2, waveform_picker_regs->delta_snapshot); |
|
912 | 900 | } |
|
913 | 901 | else |
|
914 | 902 | { |
|
915 | // deltaPrevious is in [ms] | |
|
916 |
deltaTickInF2 = |
|
|
903 | // the snapshot center is just after the second => decrease delat_snapshot | |
|
904 | deltaTickInF2 = ceil( (deltaPrevious_ms * 256. / 1000.) ); | |
|
917 | 905 | waveform_picker_regs->delta_snapshot = waveform_picker_regs->delta_snapshot - 1 * deltaTickInF2; |
|
918 | 906 | PRINTF2("correction of = - %u, delta_snapshot = %d\n", deltaTickInF2, waveform_picker_regs->delta_snapshot); |
|
919 | 907 | } |
General Comments 0
You need to be logged in to leave comments.
Login now