# HG changeset patch # User paul # Date 2013-11-14 08:20:39 # Node ID 8d0190b179adfb6a4888343e6d677e59225b9b8b # Parent 7bc622f95e3f9f201ae112e4fdf1fd39f44dfd91 Bug #709 Dans les paquets TM_LFR_TC_EXE_SUCCESS, le temps utilisé est maintenant identique au temps repris dans les HK, dans le paramètre HK_LFR_LAST_EXE_TC_TIME 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: Wed Nov 13 08:18:19 2013 +# Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Nov 14 08:56:42 2013 # 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=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=22 -DPRINT_MESSAGES_ON_CONSOLE +DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=23 -DPRINT_MESSAGES_ON_CONSOLE CFLAGS = -pipe -O3 -Wall $(DEFINES) CXXFLAGS = -pipe -O3 -Wall $(DEFINES) INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header 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 @@ -7,11 +7,11 @@ CONFIG -= qt include(./sparc.pri) # flight software version -SWVERSION=-0-22 +SWVERSION=-0-23 DEFINES += SW_VERSION_N1=0 DEFINES += SW_VERSION_N2=0 DEFINES += SW_VERSION_N3=0 -DEFINES += SW_VERSION_N4=22 +DEFINES += SW_VERSION_N4=23 contains( CONFIG, verbose ) { DEFINES += PRINT_MESSAGES_ON_CONSOLE 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/header/tc_handler.h b/header/tc_handler.h --- a/header/tc_handler.h +++ b/header/tc_handler.h @@ -53,8 +53,8 @@ int suspend_science_tasks(); // other functions void updateLFRCurrentMode(); -void update_last_TC_exe(ccsdsTelecommandPacket_t *TC); -void update_last_TC_rej(ccsdsTelecommandPacket_t *TC); +void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time); +void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time); void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id); #endif // TC_HANDLER_H_INCLUDED diff --git a/header/tm_lfr_tc_exe.h b/header/tm_lfr_tc_exe.h --- a/header/tm_lfr_tc_exe.h +++ b/header/tm_lfr_tc_exe.h @@ -11,7 +11,7 @@ extern time_management_regs_t *time_mana extern Packet_TM_LFR_HK_t housekeeping_packet; extern unsigned short sequenceCounters_TC_EXE[]; -int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); +int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time); int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char byte_position, unsigned char rcv_value); int send_tm_lfr_tc_exe_not_executable(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -677,7 +677,7 @@ int suspend_science_tasks() //**************** // CLOSING ACTIONS -void update_last_TC_exe(ccsdsTelecommandPacket_t *TC) +void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time) { housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; @@ -685,15 +685,15 @@ void update_last_TC_exe(ccsdsTelecommand housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; - housekeeping_packet.hk_lfr_last_exe_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); - housekeeping_packet.hk_lfr_last_exe_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); - housekeeping_packet.hk_lfr_last_exe_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); - housekeeping_packet.hk_lfr_last_exe_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); - housekeeping_packet.hk_lfr_last_exe_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); - housekeeping_packet.hk_lfr_last_exe_tc_time[5] = (unsigned char) (time_management_regs->fine_time); + housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0]; + housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1]; + housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2]; + housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3]; + housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4]; + housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5]; } -void update_last_TC_rej(ccsdsTelecommandPacket_t *TC) +void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time) { housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; @@ -701,17 +701,26 @@ void update_last_TC_rej(ccsdsTelecommand housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; - housekeeping_packet.hk_lfr_last_rej_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); - housekeeping_packet.hk_lfr_last_rej_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); - housekeeping_packet.hk_lfr_last_rej_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); - housekeeping_packet.hk_lfr_last_rej_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); - housekeeping_packet.hk_lfr_last_rej_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); - housekeeping_packet.hk_lfr_last_rej_tc_time[5] = (unsigned char) (time_management_regs->fine_time); + housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0]; + housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1]; + housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2]; + housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3]; + housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4]; + housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5]; } void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id) { unsigned int val = 0; + unsigned char time[6]; + + time[0] = (unsigned char) (time_management_regs->coarse_time>>24); + time[1] = (unsigned char) (time_management_regs->coarse_time>>16); + time[2] = (unsigned char) (time_management_regs->coarse_time>>8); + time[3] = (unsigned char) (time_management_regs->coarse_time); + time[4] = (unsigned char) (time_management_regs->fine_time>>8); + time[5] = (unsigned char) (time_management_regs->fine_time); + if (result == LFR_SUCCESSFUL) { if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) @@ -719,9 +728,9 @@ void close_action(ccsdsTelecommandPacket !( (TC->serviceType==TC_TYPE_GEN) && (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) ) { - send_tm_lfr_tc_exe_success( TC, queue_id ); + send_tm_lfr_tc_exe_success( TC, queue_id, time ); } - update_last_TC_exe( TC ); + update_last_TC_exe( TC, time ); val = housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1]; val++; housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] = (unsigned char) (val >> 8); @@ -729,7 +738,7 @@ void close_action(ccsdsTelecommandPacket } else { - update_last_TC_rej( TC ); + update_last_TC_rej( TC, time ); val = housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1]; val++; housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] = (unsigned char) (val >> 8); diff --git a/src/tm_lfr_tc_exe.c b/src/tm_lfr_tc_exe.c --- a/src/tm_lfr_tc_exe.c +++ b/src/tm_lfr_tc_exe.c @@ -15,7 +15,7 @@ #include "tm_lfr_tc_exe.h" -int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) +int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ) { /** This function sends a TM_LFR_TC_EXE_SUCCESS packet in the dedicated RTEMS message queue. * @@ -51,12 +51,12 @@ int send_tm_lfr_tc_exe_success( ccsdsTel TM.serviceType = TM_TYPE_TC_EXE; TM.serviceSubType = TM_SUBTYPE_EXE_OK; TM.destinationID = TC->sourceID; - TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); - TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); - TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); - TM.time[3] = (unsigned char) (time_management_regs->coarse_time); - TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); - TM.time[5] = (unsigned char) (time_management_regs->fine_time); + TM.time[0] = time[0]; + TM.time[1] = time[1]; + TM.time[2] = time[2]; + TM.time[3] = time[3]; + TM.time[4] = time[4]; + TM.time[5] = time[5]; // TM.telecommand_pkt_id[0] = TC->packetID[0]; TM.telecommand_pkt_id[1] = TC->packetID[1];