diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,2 @@ 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters -a0ca246cc2057880086d028aab3cf35be244efbc header/lfr_common_headers +6a30b7a924d9c3824f432332ed79bcee25954455 header/lfr_common_headers 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 @@ -2,7 +2,7 @@ TEMPLATE = app # CONFIG += console v8 sim # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch # lpp_dpu_destid -CONFIG += console verbose lpp_dpu_destid stack_report +CONFIG += console verbose lpp_dpu_destid cpu_usage_report CONFIG -= qt include(./sparc.pri) diff --git a/src/fsw_spacewire.c b/src/fsw_spacewire.c --- a/src/fsw_spacewire.c +++ b/src/fsw_spacewire.c @@ -216,11 +216,13 @@ rtems_task send_task( rtems_task_argumen size_t size; // size of the incoming TC packet rtems_id queue_send_id; unsigned int sid; + unsigned char sidAsUnsignedChar; incomingRingNodePtr = NULL; ring_node_address = 0; charPtr = (char *) &ring_node_address; sid = 0; + sidAsUnsignedChar = 0; init_header_cwf( &headerCWF ); init_header_swf( &headerSWF ); @@ -291,6 +293,20 @@ rtems_task send_task( rtems_task_argumen } else if ( incomingData[0] == CCSDS_DESTINATION_ID ) // the incoming message is a ccsds packet { + sidAsUnsignedChar = (unsigned char) incomingData[ PACKET_POS_PA_LFR_SID_PKT ]; + sid = sidAsUnsignedChar; + // SET THE SEQUENCE_CNT PARAMETER IN CASE OF BP0 OR BP1 PACKETS + if ( (sid == SID_NORM_BP1_F0) || (sid == SID_NORM_BP1_F1) || (sid == SID_NORM_BP1_F2) + || (sid == SID_NORM_BP2_F0) || (sid == SID_NORM_BP2_F1) || (sid == SID_NORM_BP2_F2) + || (sid == SID_BURST_BP1_F0) || (sid == SID_BURST_BP1_F1) + || (sid == SID_BURST_BP2_F0) || (sid == SID_BURST_BP2_F1) + || (sid == SID_SBM1_BP1_F0) || (sid == SID_SBM1_BP2_F0) + || (sid == SID_SBM2_BP1_F0) || (sid == SID_SBM2_BP1_F1) + || (sid == SID_SBM2_BP2_F0) || (sid == SID_SBM2_BP2_F1)) + { + increment_seq_counter_source_id( (unsigned char*) &incomingData[ PACKET_POS_SEQUENCE_CNT ], sid ); + } + status = write( fdSPW, incomingData, size ); if (status == -1){ PRINTF2("in SEND *** (2.a) ERRNO = %d, size = %d\n", errno, size) 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 @@ -427,8 +427,6 @@ void BP_send(char *data, rtems_id queue_ { rtems_status_code status; - // SET THE SEQUENCE_CNT PARAMETER - increment_seq_counter_source_id( (unsigned char*) &data[ PACKET_POS_SEQUENCE_CNT ], sid ); // SEND PACKET status = rtems_message_queue_send( queue_id, data, nbBytesToSend); if (status != RTEMS_SUCCESSFUL) diff --git a/src/wf_handler.c b/src/wf_handler.c --- a/src/wf_handler.c +++ b/src/wf_handler.c @@ -1367,7 +1367,7 @@ void increment_seq_counter_source_id( un } } - //*********************************** - // RESET THE MODE OF THE CALLING TASK + //************************************* + // RESTORE THE MODE OF THE CALLING TASK status = rtems_task_mode( initial_mode_set, RTEMS_PREEMPT_MASK, ¤t_mode_set ); }