# HG changeset patch # User paul # Date 2016-02-02 14:45:31 # Node ID 09ea64972ca951407c30f705471d154f7090386c # Parent 2120c4473911497b6ca33efb4bcfd51ce6785b1b two fields added to the housekeeping parameters: housekeeping_packet.hk_lfr_vhdl_aa_sm ousekeeping_packet.hk_lfr_vhdl_iir_cal The contents are below housekeeping_packet.hk_lfr_vhdl_aa_sm = (unsigned char) (statusReg & 0x7c0 >> 6); housekeeping_packet.hk_lfr_vhdl_iir_cal = (unsigned char) ((waveform_picker_regs->status & 0xff00) >> 8); diff --git a/header/fsw_spacewire.h b/header/fsw_spacewire.h --- a/header/fsw_spacewire.h +++ b/header/fsw_spacewire.h @@ -14,7 +14,6 @@ #include "fsw_init.h" extern spw_stats grspw_stats; -extern spw_stats spw_backup; extern rtems_name timecode_timer_name; extern rtems_id timecode_timer_id; diff --git a/src/fsw_globals.c b/src/fsw_globals.c --- a/src/fsw_globals.c +++ b/src/fsw_globals.c @@ -78,6 +78,3 @@ unsigned short sequenceCounters_TC_EXE[S unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID]; unsigned short sequenceCounterHK; spw_stats grspw_stats; -spw_stats spw_backup; - - diff --git a/src/fsw_spacewire.c b/src/fsw_spacewire.c --- a/src/fsw_spacewire.c +++ b/src/fsw_spacewire.c @@ -567,6 +567,17 @@ void spacewire_set_RE( unsigned char val void spacewire_read_statistics( void ) { + /** This function reads the SpaceWire statistics from the grspw RTEMS driver. + * + * @param void + * + * @return void + * + * Once they are read, the counters are stored in a global variable used during the building of the + * HK packets. + * + */ + rtems_status_code status; spw_stats current; diff --git a/src/processing/fsw_processing.c b/src/processing/fsw_processing.c --- a/src/processing/fsw_processing.c +++ b/src/processing/fsw_processing.c @@ -61,13 +61,13 @@ ring_node * getRingNodeForAveraging( uns //*********************************************************** // Interrupt Service Routine for spectral matrices processing -void spectral_matrices_isr_f0( unsigned char statusReg ) +void spectral_matrices_isr_f0( int statusReg ) { unsigned char status; rtems_status_code status_code; ring_node *full_ring_node; - status = statusReg & 0x03; // [0011] get the status_ready_matrix_f0_x bits + status = (unsigned char) (statusReg & 0x03); // [0011] get the status_ready_matrix_f0_x bits switch(status) { @@ -119,13 +119,13 @@ void spectral_matrices_isr_f0( unsigned } } -void spectral_matrices_isr_f1( unsigned char statusReg ) +void spectral_matrices_isr_f1( int statusReg ) { rtems_status_code status_code; unsigned char status; ring_node *full_ring_node; - status = (statusReg & 0x0c) >> 2; // [1100] get the status_ready_matrix_f1_x bits + status = (unsigned char) ((statusReg & 0x0c) >> 2); // [1100] get the status_ready_matrix_f1_x bits switch(status) { @@ -177,12 +177,12 @@ void spectral_matrices_isr_f1( unsigned } } -void spectral_matrices_isr_f2( unsigned char statusReg ) +void spectral_matrices_isr_f2( int statusReg ) { unsigned char status; rtems_status_code status_code; - status = (statusReg & 0x30) >> 4; // [0011 0000] get the status_ready_matrix_f2_x bits + status = (unsigned char) ((statusReg & 0x30) >> 4); // [0011 0000] get the status_ready_matrix_f2_x bits switch(status) { @@ -220,16 +220,27 @@ void spectral_matrices_isr_f2( unsigned } } -void spectral_matrix_isr_error_handler( unsigned char statusReg ) +void spectral_matrix_isr_error_handler( int statusReg ) { + // STATUS REGISTER + // input_fifo_write(2) *** input_fifo_write(1) *** input_fifo_write(0) + // 10 9 8 + // buffer_full ** bad_component_err ** f2_1 ** f2_0 ** f1_1 ** f1_0 ** f0_1 ** f0_0 + // 7 6 5 4 3 2 1 0 + rtems_status_code status_code; + //*************************************************** + // the ASM status register is copied in the HK packet + housekeeping_packet.hk_lfr_vhdl_aa_sm = (unsigned char) (statusReg & 0x7c0 >> 6); // [0111 1100 0000] + if (statusReg & 0x7c0) // [0111 1100 0000] { status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); } spectral_matrix_regs->status = spectral_matrix_regs->status & 0x7c0; + } rtems_isr spectral_matrices_isr( rtems_vector_number vector ) @@ -240,7 +251,7 @@ rtems_isr spectral_matrices_isr( rtems_v // buffer_full ** bad_component_err ** f2_1 ** f2_0 ** f1_1 ** f1_0 ** f0_1 ** f0_0 // 7 6 5 4 3 2 1 0 - unsigned char statusReg; + int statusReg; static restartState state = WAIT_FOR_F2; diff --git a/src/wf_handler.c b/src/wf_handler.c --- a/src/wf_handler.c +++ b/src/wf_handler.c @@ -280,6 +280,11 @@ rtems_isr waveforms_isr( rtems_vector_nu waveforms_isr_f3(); + //************************************************* + // copy the status bits in the housekeeping packets + housekeeping_packet.hk_lfr_vhdl_iir_cal = + (unsigned char) ((waveform_picker_regs->status & 0xff00) >> 8); + if ( (waveform_picker_regs->status & 0xff00) != 0x00) // [1111 1111 0000 0000] check the error bits { spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_10 );