# HG changeset patch # User paul # Date 2014-04-27 14:42:16 # Node ID de367ad91bd062e8efcd0eed1870ad315689b25b # Parent 9657f56b7e43765f656d1f65cc8492ecfb4009c6 Sync diff --git a/FSW-qt/Makefile b/FSW-qt/Makefile --- a/FSW-qt/Makefile +++ b/FSW-qt/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: bin/fsw -# Generated by qmake (2.01a) (Qt 4.8.5) on: Sun Apr 27 14:59:58 2014 +# Generated by qmake (2.01a) (Qt 4.8.5) on: Sun Apr 27 16:27:36 2014 # Project: fsw-qt.pro # Template: app # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro @@ -10,7 +10,7 @@ CC = sparc-rtems-gcc CXX = sparc-rtems-g++ -DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS -DBOOT_MESSAGES +DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DDEBUG_MESSAGES -DPRINT_TASK_STATISTICS -DBOOT_MESSAGES CFLAGS = -pipe -O3 -Wall $(DEFINES) CXXFLAGS = -pipe -O3 -Wall $(DEFINES) INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../src/basic_parameters -I../src/avf_prc diff --git a/FSW-qt/fsw-qt.pro b/FSW-qt/fsw-qt.pro --- a/FSW-qt/fsw-qt.pro +++ b/FSW-qt/fsw-qt.pro @@ -1,7 +1,7 @@ TEMPLATE = app # CONFIG += console v8 sim # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch -CONFIG += console verbose cpu_usage_report boot_messages +CONFIG += console verbose cpu_usage_report boot_messages debug_messages CONFIG -= qt include(./sparc.pri) diff --git a/FSW-qt/fsw-qt.pro.user b/FSW-qt/fsw-qt.pro.user --- a/FSW-qt/fsw-qt.pro.user +++ b/FSW-qt/fsw-qt.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/src/avf_prc/avf0_prc0.c b/src/avf_prc/avf0_prc0.c --- a/src/avf_prc/avf0_prc0.c +++ b/src/avf_prc/avf0_prc0.c @@ -55,6 +55,46 @@ void reset_nb_sm_f0( unsigned char lfrMo } } +void SM_average_f0( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, + ring_node_sm *ring_node_tab[], + unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ) +{ + float sum; + unsigned int i; + + for(i=0; ibuffer_address) ) [ i ] + + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; + + if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) ) + { + averaged_spec_mat_f0[ i ] = sum; + averaged_spec_mat_f1[ i ] = sum; + } + else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) ) + { + averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); + averaged_spec_mat_f1[ i ] = ( averaged_spec_mat_f1[ i ] + sum ); + } + else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) ) + { + averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); + averaged_spec_mat_f1[ i ] = sum; + } + else + { + PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0) + } + } +} + //************ // RTEMS TASKS @@ -81,7 +121,7 @@ rtems_task avf0_task( rtems_task_argumen nb_sbm_bp2 = 0; reset_nb_sm_f0( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions - ASM_generic_init_ring( asm_ring_norm_f0, NB_RING_NODES_ASM_NORM_F0 ); + ASM_generic_init_ring( asm_ring_norm_f0, NB_RING_NODES_ASM_NORM_F0 ); ASM_generic_init_ring( asm_ring_burst_sbm_f0, NB_RING_NODES_ASM_BURST_SBM_F0 ); current_ring_node_asm_norm_f0 = asm_ring_norm_f0; current_ring_node_asm_burst_sbm_f0 = asm_ring_burst_sbm_f0; @@ -104,7 +144,7 @@ rtems_task avf0_task( rtems_task_argumen } // compute the average and store it in the averaged_sm_f1 buffer - SM_average( current_ring_node_asm_norm_f0->matrix, + SM_average_f0( current_ring_node_asm_norm_f0->matrix, current_ring_node_asm_burst_sbm_f0->matrix, ring_node_tab, nb_norm_bp1, nb_sbm_bp1 ); @@ -113,8 +153,8 @@ rtems_task avf0_task( rtems_task_argumen nb_norm_bp1 = nb_norm_bp1 + NB_SM_BEFORE_AVF0; nb_norm_bp2 = nb_norm_bp2 + NB_SM_BEFORE_AVF0; nb_norm_asm = nb_norm_asm + NB_SM_BEFORE_AVF0; - nb_sbm_bp1 = nb_sbm_bp1 + NB_SM_BEFORE_AVF0; - nb_sbm_bp2 = nb_sbm_bp2 + NB_SM_BEFORE_AVF0; + nb_sbm_bp1 = nb_sbm_bp1 + NB_SM_BEFORE_AVF0; + nb_sbm_bp2 = nb_sbm_bp2 + NB_SM_BEFORE_AVF0; //**************************************** // initialize the mesage for the MATR task diff --git a/src/avf_prc/avf0_prc0.h b/src/avf_prc/avf0_prc0.h --- a/src/avf_prc/avf0_prc0.h +++ b/src/avf_prc/avf0_prc0.h @@ -17,12 +17,14 @@ typedef struct { unsigned int sbm2_bp2; } nb_sm_before_bp_asm_f0; -extern struct ring_node_sm *current_ring_node_sm_f0; extern struct ring_node_sm *ring_node_for_averaging_sm_f0; extern rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ); void reset_nb_sm_f0( unsigned char lfrMode ); +void SM_average_f0( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, + ring_node_sm *ring_node_tab[], + unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ); rtems_task avf0_task( rtems_task_argument lfrRequestedMode ); rtems_task prc0_task( rtems_task_argument lfrRequestedMode ); diff --git a/src/avf_prc/avf1_prc1.c b/src/avf_prc/avf1_prc1.c --- a/src/avf_prc/avf1_prc1.c +++ b/src/avf_prc/avf1_prc1.c @@ -48,6 +48,46 @@ void reset_nb_sm_f1( unsigned char lfrMo } } +void SM_average_f1( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, + ring_node_sm *ring_node_tab[], + unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ) +{ + float sum; + unsigned int i; + + for(i=0; ibuffer_address) ) [ i ] + + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] + + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; + + if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) ) + { + averaged_spec_mat_f0[ i ] = sum; + averaged_spec_mat_f1[ i ] = sum; + } + else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) ) + { + averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); + averaged_spec_mat_f1[ i ] = ( averaged_spec_mat_f1[ i ] + sum ); + } + else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) ) + { + averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); + averaged_spec_mat_f1[ i ] = sum; + } + else + { + PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0) + } + } +} + //************ // RTEMS TASKS @@ -97,7 +137,7 @@ rtems_task avf1_task( rtems_task_argumen } // compute the average and store it in the averaged_sm_f1 buffer - SM_average( current_ring_node_asm_norm_f1->matrix, + SM_average_f1( current_ring_node_asm_norm_f1->matrix, current_ring_node_asm_burst_sbm_f1->matrix, ring_node_tab, nb_norm_bp1, nb_sbm_bp1 ); diff --git a/src/avf_prc/avf1_prc1.h b/src/avf_prc/avf1_prc1.h --- a/src/avf_prc/avf1_prc1.h +++ b/src/avf_prc/avf1_prc1.h @@ -15,12 +15,14 @@ typedef struct { unsigned int sbm2_bp2; } nb_sm_before_bp_asm_f1; -extern struct ring_node_sm *current_ring_node_sm_f1; extern struct ring_node_sm *ring_node_for_averaging_sm_f1; extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ); void reset_nb_sm_f1( unsigned char lfrMode ); +void SM_average_f1( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, + ring_node_sm *ring_node_tab[], + unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ); rtems_task avf1_task( rtems_task_argument lfrRequestedMode ); rtems_task prc1_task( rtems_task_argument lfrRequestedMode ); diff --git a/src/avf_prc/avf2_prc2.c b/src/avf_prc/avf2_prc2.c --- a/src/avf_prc/avf2_prc2.c +++ b/src/avf_prc/avf2_prc2.c @@ -54,93 +54,93 @@ void SM_average_f2( float *averaged_spec rtems_task avf2_task( rtems_task_argument lfrRequestedMode ) { - rtems_event_set event_out; - rtems_status_code status; - rtems_id queue_id_prc2; - asm_msg msgForMATR; +// rtems_event_set event_out; +// rtems_status_code status; +// rtems_id queue_id_prc2; +// asm_msg msgForMATR; - unsigned int nb_norm_bp1; - unsigned int nb_norm_bp2; - unsigned int nb_norm_asm; +// unsigned int nb_norm_bp1; +// unsigned int nb_norm_bp2; +// unsigned int nb_norm_asm; - nb_norm_bp1 = 0; - nb_norm_bp2 = 0; - nb_norm_asm = 0; +// nb_norm_bp1 = 0; +// nb_norm_bp2 = 0; +// nb_norm_asm = 0; - reset_nb_sm_f2( ); // reset the sm counters that drive the BP and ASM computations / transmissions +// reset_nb_sm_f2( ); // reset the sm counters that drive the BP and ASM computations / transmissions - BOOT_PRINTF1("in AVF2 *** lfrRequestedMode = %d\n", (int) lfrRequestedMode) +// BOOT_PRINTF1("in AVF2 *** lfrRequestedMode = %d\n", (int) lfrRequestedMode) - status = get_message_queue_id_prc2( &queue_id_prc2 ); - if (status != RTEMS_SUCCESSFUL) - { - PRINTF1("in AVF2 *** ERR get_message_queue_id_prc2 %d\n", status) - } +// status = get_message_queue_id_prc2( &queue_id_prc2 ); +// if (status != RTEMS_SUCCESSFUL) +// { +// PRINTF1("in AVF2 *** ERR get_message_queue_id_prc2 %d\n", status) +// } - while(1){ - rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 +// while(1){ +// rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 - // compute the average and store it in the averaged_sm_f2 buffer - SM_average_f2( current_ring_node_asm_norm_f2->matrix, - ring_node_for_averaging_sm_f2, - nb_norm_bp1 ); +// // compute the average and store it in the averaged_sm_f2 buffer +// SM_average_f2( current_ring_node_asm_norm_f2->matrix, +// ring_node_for_averaging_sm_f2, +// nb_norm_bp1 ); - // update nb_average - nb_norm_bp1 = nb_norm_bp1 + NB_SM_BEFORE_AVF2; - nb_norm_bp2 = nb_norm_bp2 + NB_SM_BEFORE_AVF2; - nb_norm_asm = nb_norm_asm + NB_SM_BEFORE_AVF2; +// // update nb_average +// nb_norm_bp1 = nb_norm_bp1 + NB_SM_BEFORE_AVF2; +// nb_norm_bp2 = nb_norm_bp2 + NB_SM_BEFORE_AVF2; +// nb_norm_asm = nb_norm_asm + NB_SM_BEFORE_AVF2; - //**************************************** - // initialize the mesage for the MATR task - msgForMATR.event = 0x00; // this composite event will be sent to the MATR task - msgForMATR.burst_sbm = NULL; - msgForMATR.norm = current_ring_node_asm_norm_f2; -// msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; -// msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; - msgForMATR.coarseTime = time_management_regs->coarse_time; - msgForMATR.fineTime = time_management_regs->fine_time; +// //**************************************** +// // initialize the mesage for the MATR task +// msgForMATR.event = 0x00; // this composite event will be sent to the MATR task +// msgForMATR.burst_sbm = NULL; +// msgForMATR.norm = current_ring_node_asm_norm_f2; +//// msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; +//// msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; +// msgForMATR.coarseTime = time_management_regs->coarse_time; +// msgForMATR.fineTime = time_management_regs->fine_time; - if (nb_norm_bp1 == nb_sm_before_f2.norm_bp1) - { - nb_norm_bp1 = 0; - // set another ring for the ASM storage - current_ring_node_asm_norm_f2 = current_ring_node_asm_norm_f2->next; - if ( lfrCurrentMode == LFR_MODE_NORMAL ) - { - msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; - } - } +// if (nb_norm_bp1 == nb_sm_before_f2.norm_bp1) +// { +// nb_norm_bp1 = 0; +// // set another ring for the ASM storage +// current_ring_node_asm_norm_f2 = current_ring_node_asm_norm_f2->next; +// if ( lfrCurrentMode == LFR_MODE_NORMAL ) +// { +// msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; +// } +// } - if (nb_norm_bp2 == nb_sm_before_f2.norm_bp2) - { - nb_norm_bp2 = 0; - if ( lfrCurrentMode == LFR_MODE_NORMAL ) - { - msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP2_F2; - } - } +// if (nb_norm_bp2 == nb_sm_before_f2.norm_bp2) +// { +// nb_norm_bp2 = 0; +// if ( lfrCurrentMode == LFR_MODE_NORMAL ) +// { +// msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP2_F2; +// } +// } - if (nb_norm_asm == nb_sm_before_f2.norm_asm) - { - nb_norm_asm = 0; - if ( lfrCurrentMode == LFR_MODE_NORMAL ) - { -// PRINTF1("%lld\n", localTime) - msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_ASM_F2; - } - } +// if (nb_norm_asm == nb_sm_before_f2.norm_asm) +// { +// nb_norm_asm = 0; +// if ( lfrCurrentMode == LFR_MODE_NORMAL ) +// { +//// PRINTF1("%lld\n", localTime) +// msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_ASM_F2; +// } +// } - //************************* - // send the message to MATR - if (msgForMATR.event != 0x00) - { - status = rtems_message_queue_send( queue_id_prc2, (char *) &msgForMATR, MSG_QUEUE_SIZE_PRC0); - } +// //************************* +// // send the message to MATR +// if (msgForMATR.event != 0x00) +// { +// status = rtems_message_queue_send( queue_id_prc2, (char *) &msgForMATR, MSG_QUEUE_SIZE_PRC0); +// } - if (status != RTEMS_SUCCESSFUL) { - printf("in AVF2 *** Error sending message to MATR, code %d\n", status); - } - } +// if (status != RTEMS_SUCCESSFUL) { +// printf("in AVF2 *** Error sending message to MATR, code %d\n", status); +// } +// } } rtems_task prc2_task( rtems_task_argument argument ) diff --git a/src/avf_prc/avf2_prc2.h b/src/avf_prc/avf2_prc2.h --- a/src/avf_prc/avf2_prc2.h +++ b/src/avf_prc/avf2_prc2.h @@ -9,7 +9,6 @@ typedef struct { unsigned int norm_asm; } nb_sm_before_bp_asm_f2; -extern struct ring_node_sm *current_ring_node_sm_f2; extern struct ring_node_sm *ring_node_for_averaging_sm_f2; extern rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id ); diff --git a/src/avf_prc/fsw_processing.c b/src/avf_prc/fsw_processing.c --- a/src/avf_prc/fsw_processing.c +++ b/src/avf_prc/fsw_processing.c @@ -32,41 +32,41 @@ ring_node_sm *ring_node_for_averaging_sm rtems_isr spectral_matrices_isr( rtems_vector_number vector ) { - ring_node_sm *previous_ring_node_sm_f0; +// ring_node_sm *previous_ring_node_sm_f0; -// rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); +//// rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); - previous_ring_node_sm_f0 = current_ring_node_sm_f0; +// previous_ring_node_sm_f0 = current_ring_node_sm_f0; - if ( (spectral_matrix_regs->status & 0x2) == 0x02) // check ready matrix bit f0_1 - { - current_ring_node_sm_f0 = current_ring_node_sm_f0->next; - spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address; - spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101 - nb_sm_f0 = nb_sm_f0 + 1; - } +// if ( (spectral_matrix_regs->status & 0x2) == 0x02) // check ready matrix bit f0_1 +// { +// current_ring_node_sm_f0 = current_ring_node_sm_f0->next; +// spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address; +// spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101 +// nb_sm_f0 = nb_sm_f0 + 1; +// } - //************************ - // reset status error bits - if ( (spectral_matrix_regs->status & 0x30) != 0x00) - { - rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); - spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111 - } +// //************************ +// // reset status error bits +// if ( (spectral_matrix_regs->status & 0x30) != 0x00) +// { +// rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); +// spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111 +// } - //************************************** - // reset ready matrix bits for f0_0, f1 and f2 - spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff2; // 0010 +// //************************************** +// // reset ready matrix bits for f0_0, f1 and f2 +// spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff2; // 0010 - if (nb_sm_f0 == NB_SM_BEFORE_AVF0) - { - ring_node_for_averaging_sm_f0 = previous_ring_node_sm_f0; - if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) - { - rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); - } - nb_sm_f0 = 0; - } +// if (nb_sm_f0 == NB_SM_BEFORE_AVF0) +// { +// ring_node_for_averaging_sm_f0 = previous_ring_node_sm_f0; +// if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) +// { +// rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); +// } +// nb_sm_f0 = 0; +// } } @@ -105,16 +105,16 @@ rtems_isr spectral_matrices_isr_simu( rt //*** // F2 - nb_sm_f0_aux_f2 = nb_sm_f0_aux_f2 + 1; - if (nb_sm_f0_aux_f2 == 96) - { - nb_sm_f0_aux_f2 = 0; - ring_node_for_averaging_sm_f2 = current_ring_node_sm_f2; - if (rtems_event_send( Task_id[TASKID_AVF2], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) - { - rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); - } - } +// nb_sm_f0_aux_f2 = nb_sm_f0_aux_f2 + 1; +// if (nb_sm_f0_aux_f2 == 96) +// { +// nb_sm_f0_aux_f2 = 0; +// ring_node_for_averaging_sm_f2 = current_ring_node_sm_f2; +// if (rtems_event_send( Task_id[TASKID_AVF2], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) +// { +// rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); +// } +// } } //****************** @@ -217,7 +217,9 @@ void SM_reset_current_ring_nodes( void ) current_ring_node_sm_f1 = sm_ring_f1; current_ring_node_sm_f2 = sm_ring_f2; - ring_node_for_averaging_sm_f0 = sm_ring_f0; + ring_node_for_averaging_sm_f0 = sm_ring_f0; + ring_node_for_averaging_sm_f1 = sm_ring_f1; + ring_node_for_averaging_sm_f2 = sm_ring_f2; } void ASM_init_header( Header_TM_LFR_SCIENCE_ASM_t *header) @@ -252,46 +254,6 @@ void ASM_init_header( Header_TM_LFR_SCIE header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB } -void SM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, - ring_node_sm *ring_node_tab[], - unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ) -{ - float sum; - unsigned int i; - - for(i=0; ibuffer_address) ) [ i ] - + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ] - + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ] - + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ] - + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ] - + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ] - + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] - + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; - - if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) ) - { - averaged_spec_mat_f0[ i ] = sum; - averaged_spec_mat_f1[ i ] = sum; - } - else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) ) - { - averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); - averaged_spec_mat_f1[ i ] = ( averaged_spec_mat_f1[ i ] + sum ); - } - else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) ) - { - averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); - averaged_spec_mat_f1[ i ] = sum; - } - else - { - PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0) - } - } -} - void ASM_reorganize_and_divide( float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider ) { int frequencyBin; diff --git a/src/avf_prc/fsw_processing.h b/src/avf_prc/fsw_processing.h --- a/src/avf_prc/fsw_processing.h +++ b/src/avf_prc/fsw_processing.h @@ -74,9 +74,6 @@ void SM_init_rings( void ); void ASM_generic_init_ring(ring_node_asm *ring, unsigned char nbNodes ); void SM_reset_current_ring_nodes( void ); void ASM_init_header( Header_TM_LFR_SCIENCE_ASM_t *header); -void SM_average(float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, - ring_node_sm *ring_node_tab[], - unsigned int firstTimeF0, unsigned int firstTimeF1 ); void ASM_reorganize_and_divide(float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider ); void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat, diff --git a/src/fsw_init.c b/src/fsw_init.c --- a/src/fsw_init.c +++ b/src/fsw_init.c @@ -547,20 +547,20 @@ int start_all_tasks( void ) // start all BOOT_PRINTF("in INIT *** Error starting TASK_PRC1\n") } } - if (status == RTEMS_SUCCESSFUL) // AVF2 - { - status = rtems_task_start( Task_id[TASKID_AVF2], avf2_task, 1 ); - if (status!=RTEMS_SUCCESSFUL) { - BOOT_PRINTF("in INIT *** Error starting TASK_AVF2\n") - } - } - if (status == RTEMS_SUCCESSFUL) // PRC2 - { - status = rtems_task_start( Task_id[TASKID_PRC2], prc2_task, 1 ); - if (status!=RTEMS_SUCCESSFUL) { - BOOT_PRINTF("in INIT *** Error starting TASK_PRC2\n") - } - } +// if (status == RTEMS_SUCCESSFUL) // AVF2 +// { +// status = rtems_task_start( Task_id[TASKID_AVF2], avf2_task, 1 ); +// if (status!=RTEMS_SUCCESSFUL) { +// BOOT_PRINTF("in INIT *** Error starting TASK_AVF2\n") +// } +// } +// if (status == RTEMS_SUCCESSFUL) // PRC2 +// { +// status = rtems_task_start( Task_id[TASKID_PRC2], prc2_task, 1 ); +// if (status!=RTEMS_SUCCESSFUL) { +// BOOT_PRINTF("in INIT *** Error starting TASK_PRC2\n") +// } +// } //**************** // WAVEFORM PICKER diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -628,23 +628,22 @@ int restart_science_tasks(unsigned char PRINTF1("in restart_science_task *** PRC1 ERR %d\n", status[7]) } - status[8] = rtems_task_restart( Task_id[TASKID_AVF2], 1 ); - if (status[8] != RTEMS_SUCCESSFUL) - { - PRINTF1("in restart_science_task *** AVF2 ERR %d\n", status[8]) - } +// status[8] = rtems_task_restart( Task_id[TASKID_AVF2], 1 ); +// if (status[8] != RTEMS_SUCCESSFUL) +// { +// PRINTF1("in restart_science_task *** AVF2 ERR %d\n", status[8]) +// } - status[9] = rtems_task_restart( Task_id[TASKID_PRC2], 1 ); - if (status[9] != RTEMS_SUCCESSFUL) - { - PRINTF1("in restart_science_task *** PRC2 ERR %d\n", status[9]) - } +// status[9] = rtems_task_restart( Task_id[TASKID_PRC2], 1 ); +// if (status[9] != RTEMS_SUCCESSFUL) +// { +// PRINTF1("in restart_science_task *** PRC2 ERR %d\n", status[9]) +// } if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) || (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) || - (status[6] != RTEMS_SUCCESSFUL) || (status[7] != RTEMS_SUCCESSFUL) || - (status[8] != RTEMS_SUCCESSFUL) || (status[9] != RTEMS_SUCCESSFUL)) + (status[6] != RTEMS_SUCCESSFUL) || (status[7] != RTEMS_SUCCESSFUL) ) { ret = RTEMS_UNSATISFIED; } @@ -694,22 +693,22 @@ int suspend_science_tasks() PRINTF1("in suspend_science_task *** PRC1 ERR %d\n", status) } } - if (status == RTEMS_SUCCESSFUL) // suspend AVF2 - { - status = rtems_task_suspend( Task_id[TASKID_AVF2] ); - if (status != RTEMS_SUCCESSFUL) - { - PRINTF1("in suspend_science_task *** AVF2 ERR %d\n", status) - } - } - if (status == RTEMS_SUCCESSFUL) // suspend PRC2 - { - status = rtems_task_suspend( Task_id[TASKID_PRC2] ); - if (status != RTEMS_SUCCESSFUL) - { - PRINTF1("in suspend_science_task *** PRC2 ERR %d\n", status) - } - } +// if (status == RTEMS_SUCCESSFUL) // suspend AVF2 +// { +// status = rtems_task_suspend( Task_id[TASKID_AVF2] ); +// if (status != RTEMS_SUCCESSFUL) +// { +// PRINTF1("in suspend_science_task *** AVF2 ERR %d\n", status) +// } +// } +// if (status == RTEMS_SUCCESSFUL) // suspend PRC2 +// { +// status = rtems_task_suspend( Task_id[TASKID_PRC2] ); +// if (status != RTEMS_SUCCESSFUL) +// { +// PRINTF1("in suspend_science_task *** PRC2 ERR %d\n", status) +// } +// } if (status == RTEMS_SUCCESSFUL) // suspend WFRM { status = rtems_task_suspend( Task_id[TASKID_WFRM] );