# HG changeset patch # User paul # Date 2015-02-04 15:20:55 # Node ID 193b5419a0cb54198c3c7e94340238f4a023de21 # Parent 392adb5bc7c9577b4e4cace6e4398ba4b22b685b 2.0.2.1 diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,2 @@ a586fe639ac179e95bdc150ebdbab0312f31dc30 LFR_basic-parameters -b984c315bf99562bdfbbd6bda8de296d2e692adc header/lfr_common_headers +6d02d4b02291d2b25c387fa74037dc7929cd92b5 header/lfr_common_headers diff --git a/header/fsw_misc.h b/header/fsw_misc.h --- a/header/fsw_misc.h +++ b/header/fsw_misc.h @@ -34,8 +34,8 @@ void increment_seq_counter(unsigned shor void getTime( unsigned char *time); unsigned long long int getTimeAsUnsignedLongLongInt( ); void send_dumb_hk( void ); +void get_temperatures( unsigned char *temperatures ); void get_v_e1_e2_f3( unsigned char *spacecraft_potential ); -void get_temperatures( unsigned char *temperatures ); void get_cpu_load( unsigned char *resource_statistics ); extern int sched_yield( void ); diff --git a/header/processing/fsw_processing.h b/header/processing/fsw_processing.h --- a/header/processing/fsw_processing.h +++ b/header/processing/fsw_processing.h @@ -139,9 +139,10 @@ static inline void SM_average(float *ave ring_node *ring_node_tab[], unsigned int nbAverageNORM, unsigned int nbAverageSBM, asm_msg *msgForMATR ); -static inline void SM_average_debug( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM, - ring_node *ring_node_tab[], - unsigned int nbAverageNORM, unsigned int nbAverageSBM ); +static inline void SM_average_debug(float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM, + ring_node *ring_node_tab[], + unsigned int nbAverageNORM, unsigned int nbAverageSBM, + asm_msg *msgForMATR ); void ASM_patch( float *inputASM, float *outputASM ); void extractReImVectors(float *inputASM, float *outputASM, unsigned int asmComponent ); @@ -201,8 +202,9 @@ void SM_average( float *averaged_spec_ma } void SM_average_debug( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM, - ring_node *ring_node_tab[], - unsigned int nbAverageNORM, unsigned int nbAverageSBM ) + ring_node *ring_node_tab[], + unsigned int nbAverageNORM, unsigned int nbAverageSBM, + asm_msg *msgForMATR ) { float sum; unsigned int i; @@ -210,26 +212,12 @@ void SM_average_debug( float *averaged_s for(i=0; ibuffer_address) ) [ i ]; - - if ( (nbAverageNORM == 0) && (nbAverageSBM == 0) ) - { - averaged_spec_mat_NORM[ i ] = sum; - averaged_spec_mat_SBM[ i ] = sum; - } - else if ( (nbAverageNORM != 0) && (nbAverageSBM != 0) ) - { - averaged_spec_mat_NORM[ i ] = sum; - averaged_spec_mat_SBM[ i ] = sum; - } - else if ( (nbAverageNORM != 0) && (nbAverageSBM == 0) ) - { - averaged_spec_mat_NORM[ i ] = sum; - averaged_spec_mat_SBM[ i ] = sum; - } - else - { - PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNORM, nbAverageSBM) - } + averaged_spec_mat_NORM[ i ] = sum; + averaged_spec_mat_SBM[ i ] = sum; + msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime; + msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime; + msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime; + msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime; } } diff --git a/src/fsw_misc.c b/src/fsw_misc.c --- a/src/fsw_misc.c +++ b/src/fsw_misc.c @@ -225,8 +225,8 @@ rtems_task hous_task(rtems_task_argument spacewire_update_statistics(); - get_v_e1_e2_f3( housekeeping_packet.hk_lfr_sc_v_f3 ); - get_temperatures( housekeeping_packet.hk_lfr_temp_scm); + get_temperatures( housekeeping_packet.hk_lfr_temp_scm ); + get_v_e1_e2_f3( housekeeping_packet.hk_lfr_sc_v_f3 ); get_cpu_load( (unsigned char *) &housekeeping_packet.hk_lfr_cpu_load ); // SEND PACKET @@ -442,6 +442,24 @@ void send_dumb_hk( void ) PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); } +void get_temperatures( unsigned char *temperatures ) +{ + unsigned char* temp_scm_ptr; + unsigned char* temp_pcb_ptr; + unsigned char* temp_fpga_ptr; + + temp_scm_ptr = (unsigned char *) &time_management_regs->temp_scm; + temp_pcb_ptr = (unsigned char *) &time_management_regs->temp_pcb; + temp_fpga_ptr = (unsigned char *) &time_management_regs->temp_fpga; + + temperatures[0] = temp_scm_ptr[2]; + temperatures[1] = temp_scm_ptr[3]; + temperatures[2] = temp_pcb_ptr[2]; + temperatures[3] = temp_pcb_ptr[3]; + temperatures[4] = temp_fpga_ptr[2]; + temperatures[5] = temp_fpga_ptr[3]; +} + void get_v_e1_e2_f3( unsigned char *spacecraft_potential ) { unsigned char* v_ptr; @@ -460,24 +478,6 @@ void get_v_e1_e2_f3( unsigned char *spac spacecraft_potential[5] = e2_ptr[3]; } -void get_temperatures( unsigned char *temperatures ) -{ - unsigned char* temp_scm_ptr; - unsigned char* temp_pcb_ptr; - unsigned char* temp_fpga_ptr; - - temp_scm_ptr = (unsigned char *) &time_management_regs->temp_scm; - temp_pcb_ptr = (unsigned char *) &time_management_regs->temp_pcb; - temp_fpga_ptr = (unsigned char *) &time_management_regs->temp_fpga; - - temperatures[0] = temp_scm_ptr[2]; - temperatures[1] = temp_scm_ptr[3]; - temperatures[2] = temp_pcb_ptr[2]; - temperatures[3] = temp_pcb_ptr[3]; - temperatures[4] = temp_fpga_ptr[2]; - temperatures[5] = temp_fpga_ptr[3]; -} - void get_cpu_load( unsigned char *resource_statistics ) { unsigned char cpu_load; diff --git a/src/fsw_spacewire.c b/src/fsw_spacewire.c --- a/src/fsw_spacewire.c +++ b/src/fsw_spacewire.c @@ -988,9 +988,6 @@ int spw_send_waveform_CWF3_light( ring_n header->blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8); header->blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 ); - printf("spw_send_waveform_CWF3_light => [0] = %x, [1] = %x, [2] = %x, [3] = %x, [4] = %x, [5] = %x\n", - dataPtr[0], dataPtr[1], dataPtr[2], dataPtr[3], dataPtr[4], dataPtr[5]); - //********************* // SEND CWF3_light DATA for (i=0; iprevious; - ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2; - current_ring_node_f2 = current_ring_node_f2->next; + ring_node_to_send_cwf_f2 = current_ring_node_f2->previous; + ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2; ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_0_coarse_time; ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_0_fine_time; + current_ring_node_f2 = current_ring_node_f2->next; waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->buffer_address; if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ); @@ -222,11 +222,11 @@ inline void waveforms_isr_burst( void ) waveform_picker_regs->status = waveform_picker_regs->status & 0x00004410; // [0100 0100 0001 0000] break; case 2: - ring_node_to_send_cwf_f2 = current_ring_node_f2->previous; - ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2; - current_ring_node_f2 = current_ring_node_f2->next; + ring_node_to_send_cwf_f2 = current_ring_node_f2->previous; + ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2; ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_1_coarse_time; ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_1_fine_time; + current_ring_node_f2 = current_ring_node_f2->next; waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address; if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ); @@ -867,8 +867,6 @@ int send_waveform_CWF3_light( ring_node wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; } - printf("send_waveform_CWF3_light => [0] = %x, [1] = %x, [2] = %x\n", dataPtr[0], dataPtr[1], dataPtr[2]); - // SEND PACKET status = rtems_message_queue_send( queue_id, &ring_node_cwf3_light, sizeof( ring_node* ) ); if (status != RTEMS_SUCCESSFUL) { @@ -981,7 +979,6 @@ void build_snapshot_from_ring( ring_node // (2) compute the central reference time centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0; - printf("centerTime_asLong = %llx\n", centerTime_asLong); // (3) compute the acquisition time of the current snapshot switch(frequencyChannel) @@ -1089,8 +1086,8 @@ void snapshot_resynchronization( unsigne deltaPrevious = ((double) deltaPreviousTick) / 65536. * 1000.; deltaNext = ((double) deltaNextTick) / 65536. * 1000.; - printf("delta previous = %f ms, delta next = %f ms\n", deltaPrevious, deltaNext); - printf("delta previous = %llu, delta next = %llu\n", deltaPreviousTick, deltaNextTick); + PRINTF2("delta previous = %f ms, delta next = %f ms\n", deltaPrevious, deltaNext) + PRINTF2("delta previous = %llu, delta next = %llu\n", deltaPreviousTick, deltaNextTick) // which tick is the closest if (deltaPreviousTick > deltaNextTick) @@ -1225,6 +1222,9 @@ void set_wfp_data_shaping( void ) + ( (data_shaping & 0x04) ) // SP1 + ( (data_shaping & 0x02) << 2 ) // R0 + ( (data_shaping & 0x01) << 4 ); // R1 + + // this is a temporary way to set R2, compatible with the release 2 of the flight software + waveform_picker_regs->data_shaping = waveform_picker_regs->data_shaping + ( (0x1) << 5 ); // R2 } void set_wfp_burst_enable_register( unsigned char mode )