@@ -231,6 +231,9 rtems_task hous_task(rtems_task_argument | |||
|
231 | 231 | rtems_status_code spare_status; |
|
232 | 232 | rtems_id queue_id; |
|
233 | 233 | rtems_rate_monotonic_period_status period_status; |
|
234 | bool isSynchronized; | |
|
235 | ||
|
236 | isSynchronized = false; | |
|
234 | 237 | |
|
235 | 238 | status = get_message_queue_id_send( &queue_id ); |
|
236 | 239 | if (status != RTEMS_SUCCESSFUL) |
@@ -259,11 +262,12 rtems_task hous_task(rtems_task_argument | |||
|
259 | 262 | status = rtems_rate_monotonic_period( HK_id, SY_LFR_TIME_SYN_TIMEOUT_in_ticks ); |
|
260 | 263 | status = rtems_rate_monotonic_get_status( HK_id, &period_status ); |
|
261 | 264 | DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state) |
|
262 |
while(period_status.state != RATE_MONOTONIC_EXPIRED |
|
|
265 | while( (period_status.state != RATE_MONOTONIC_EXPIRED) | |
|
266 | && (isSynchronized == false) ) // after SY_LFR_TIME_SYN_TIMEOUT ms, starts HK anyway | |
|
263 | 267 | { |
|
264 | 268 | if ((time_management_regs->coarse_time & VAL_LFR_SYNCHRONIZED) == INT32_ALL_0) // check time synchronization |
|
265 | 269 | { |
|
266 | break; // break if LFR is synchronized | |
|
270 | isSynchronized = true; | |
|
267 | 271 | } |
|
268 | 272 | else |
|
269 | 273 | { |
@@ -508,7 +508,8 int spacewire_several_connect_attemps( v | |||
|
508 | 508 | rtems_status_code status; |
|
509 | 509 | int i; |
|
510 | 510 | |
|
511 | for ( i=0; i<SY_LFR_DPU_CONNECT_ATTEMPT; i++ ) | |
|
511 | i = 0; | |
|
512 | while (i < SY_LFR_DPU_CONNECT_ATTEMPT) | |
|
512 | 513 | { |
|
513 | 514 | PRINTF1("in spacewire_reset_link *** link recovery, try %d\n", i); |
|
514 | 515 | |
@@ -520,12 +521,12 int spacewire_several_connect_attemps( v | |||
|
520 | 521 | |
|
521 | 522 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
522 | 523 | { |
|
523 | PRINTF1("in spacewire_reset_link *** ERR spacewire_start_link code %d\n", status_spw) | |
|
524 | i = i + 1; | |
|
525 | PRINTF1("in spacewire_reset_link *** ERR spacewire_start_link code %d\n", status_spw); | |
|
524 | 526 | } |
|
525 | ||
|
526 | if ( status_spw == RTEMS_SUCCESSFUL) | |
|
527 | else | |
|
527 | 528 | { |
|
528 | break; | |
|
529 | i = SY_LFR_DPU_CONNECT_ATTEMPT; | |
|
529 | 530 | } |
|
530 | 531 | } |
|
531 | 532 |
@@ -116,6 +116,8 void spectral_matrices_isr_f0( int statu | |||
|
116 | 116 | } |
|
117 | 117 | spectral_matrix_regs->status = BIT_READY_1; // [0000 0010] |
|
118 | 118 | break; |
|
119 | default: | |
|
120 | break; | |
|
119 | 121 | } |
|
120 | 122 | } |
|
121 | 123 | |
@@ -174,6 +176,8 void spectral_matrices_isr_f1( int statu | |||
|
174 | 176 | } |
|
175 | 177 | spectral_matrix_regs->status = BIT_STATUS_F1_1; // [1000 0000] |
|
176 | 178 | break; |
|
179 | default: | |
|
180 | break; | |
|
177 | 181 | } |
|
178 | 182 | } |
|
179 | 183 | |
@@ -217,6 +221,8 void spectral_matrices_isr_f2( int statu | |||
|
217 | 221 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
218 | 222 | } |
|
219 | 223 | break; |
|
224 | default: | |
|
225 | break; | |
|
220 | 226 | } |
|
221 | 227 | } |
|
222 | 228 |
@@ -585,7 +585,7 rtems_task swbd_task(rtems_task_argument | |||
|
585 | 585 | if (event_out == RTEMS_EVENT_MODE_NORM_S1_S2) |
|
586 | 586 | { |
|
587 | 587 | acquisitionTimeF0_asLong = get_acquisition_time( (unsigned char *) &ring_node_to_send_swf_f0->coarseTime ); |
|
588 | build_snapshot_from_ring( ring_node_to_send_swf_f1, 1, acquisitionTimeF0_asLong, | |
|
588 | build_snapshot_from_ring( ring_node_to_send_swf_f1, CHANNELF1, acquisitionTimeF0_asLong, | |
|
589 | 589 | &ring_node_swf1_extracted, swf1_extracted ); |
|
590 | 590 | swf1_ready = true; // the snapshot has been extracted and is ready to be sent |
|
591 | 591 | } |
@@ -770,6 +770,7 void build_snapshot_from_ring( ring_node | |||
|
770 | 770 | int *swf_extracted) |
|
771 | 771 | { |
|
772 | 772 | unsigned int i; |
|
773 | unsigned int node; | |
|
773 | 774 | unsigned long long int centerTime_asLong; |
|
774 | 775 | unsigned long long int acquisitionTime_asLong; |
|
775 | 776 | unsigned long long int bufferAcquisitionTime_asLong; |
@@ -813,24 +814,30 void build_snapshot_from_ring( ring_node | |||
|
813 | 814 | break; |
|
814 | 815 | default: |
|
815 | 816 | acquisitionTime_asLong = centerTime_asLong; |
|
817 | nb_ring_nodes = 0; | |
|
816 | 818 | frequency_asLong = FREQ_F2; |
|
817 | 819 | nbTicksPerSample_asLong = TICKS_PER_T2; |
|
818 | 820 | break; |
|
819 | 821 | } |
|
820 | 822 | |
|
821 | //**************************************************************************** | |
|
823 | //***************************************************************************** | |
|
822 | 824 | // (4) search the ring_node with the acquisition time <= acquisitionTime_asLong |
|
823 | for (i=0; i<nb_ring_nodes; i++) | |
|
825 | node = 0; | |
|
826 | while ( node < nb_ring_nodes) | |
|
824 | 827 | { |
|
825 |
//PRINTF1("%d ... ", |
|
|
828 | //PRINTF1("%d ... ", node); | |
|
826 | 829 |
|
|
827 | 830 | if (bufferAcquisitionTime_asLong <= acquisitionTime_asLong) |
|
828 | 831 | { |
|
829 | 832 | //PRINTF1("buffer found with acquisition time = %llx\n", bufferAcquisitionTime_asLong); |
|
830 |
|
|
|
833 | node = nb_ring_nodes; | |
|
831 | 834 | } |
|
835 | else | |
|
836 | { | |
|
837 | node = node + 1; | |
|
832 | 838 | ring_node_to_send = ring_node_to_send->previous; |
|
833 | 839 | } |
|
840 | } | |
|
834 | 841 | |
|
835 | 842 | // (5) compute the number of samples to take in the current buffer |
|
836 | 843 | sampleOffset_asLong = ((acquisitionTime_asLong - bufferAcquisitionTime_asLong) * frequency_asLong ) >> SHIFT_2_BYTES; |
General Comments 0
You need to be logged in to leave comments.
Login now