# HG changeset patch # User paul # Date 2013-11-19 09:07:13 # Node ID 4237b1096e59b6bf6406ef45abd2c03102282b1d # Parent 802e295774b99c36a93313aa81d6fd421b21bb97 fsw-1-0 1.0.0.0 functions added to get the message queue identifiers get_message_queue_id_send get_message_queue_id_recv 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: Fri Nov 15 17:09:56 2013 +# Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Nov 19 10:04:58 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=1 -DSW_VERSION_N4=0 -DPRINT_MESSAGES_ON_CONSOLE +DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=0 -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/bin/Makefile b/FSW-qt/bin/Makefile --- a/FSW-qt/bin/Makefile +++ b/FSW-qt/bin/Makefile @@ -1,6 +1,6 @@ SREC_PREFIX = RpwLfrApp -SREC_COUNTER = 0001 -SREC_FSW_REF = fsw-0-7 +SREC_COUNTER = 0002 +SREC_FSW_REF = fsw-1-0 SREC_SUFFIX = .srec SREC_TEXT = $(SREC_PREFIX)_$(SREC_COUNTER)_text_$(SREC_FSW_REF)$(SREC_SUFFIX) SREC_DATA = $(SREC_PREFIX)_$(SREC_COUNTER)_data_$(SREC_FSW_REF)$(SREC_SUFFIX) 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 @@ -8,10 +8,10 @@ include(./sparc.pri) # flight software version SWVERSION=-1-0 -DEFINES += SW_VERSION_N1=0 -DEFINES += SW_VERSION_N2=0 -DEFINES += SW_VERSION_N3=1 -DEFINES += SW_VERSION_N4=0 +DEFINES += SW_VERSION_N1=1 # major +DEFINES += SW_VERSION_N2=0 # minor +DEFINES += SW_VERSION_N3=0 # patch +DEFINES += SW_VERSION_N4=0 # internal 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 @@ -404,7 +404,7 @@ 13 14 - -1 + 2 fsw-qt diff --git a/header/fsw_init.h b/header/fsw_init.h --- a/header/fsw_init.h +++ b/header/fsw_init.h @@ -12,6 +12,9 @@ #include "fsw_spacewire.h" +extern rtems_name Task_name[20]; /* array of task names */ +extern rtems_id Task_id[20]; /* array of task ids */ + // RTEMS TASKS rtems_task Init( rtems_task_argument argument); @@ -21,6 +24,8 @@ int create_all_tasks( void ); int start_all_tasks( void ); // rtems_status_code create_message_queues( void ); +rtems_status_code get_message_queue_id_send( rtems_id *queue_id ); +rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ); // int start_recv_send_tasks( void ); // diff --git a/header/tc_handler.h b/header/tc_handler.h --- a/header/tc_handler.h +++ b/header/tc_handler.h @@ -48,6 +48,9 @@ void update_last_TC_exe(ccsdsTelecommand void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time); void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time); +extern rtems_status_code get_message_queue_id_send( rtems_id *queue_id ); +extern rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ); + #endif // TC_HANDLER_H_INCLUDED diff --git a/header/wf_handler.h b/header/wf_handler.h --- a/header/wf_handler.h +++ b/header/wf_handler.h @@ -35,8 +35,6 @@ extern struct param_local_str param_loca extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; -extern rtems_name misc_name[5]; -extern rtems_name Task_name[20]; /* array of task ids */ extern rtems_id Task_id[20]; /* array of task ids */ extern unsigned char lfrCurrentMode; diff --git a/src/fsw_init.c b/src/fsw_init.c --- a/src/fsw_init.c +++ b/src/fsw_init.c @@ -584,3 +584,27 @@ rtems_status_code create_message_queues( return ret; } + +rtems_status_code get_message_queue_id_send( rtems_id *queue_id ) +{ + rtems_status_code status; + rtems_name queue_name; + + queue_name = rtems_build_name( 'Q', '_', 'S', 'D' ); + + status = rtems_message_queue_ident( queue_name, 0, queue_id ); + + return status; +} + +rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ) +{ + rtems_status_code status; + rtems_name queue_name; + + queue_name = rtems_build_name( 'Q', '_', 'R', 'V' ); + + status = rtems_message_queue_ident( queue_name, 0, queue_id ); + + return status; +} diff --git a/src/fsw_misc.c b/src/fsw_misc.c --- a/src/fsw_misc.c +++ b/src/fsw_misc.c @@ -143,10 +143,10 @@ rtems_task hous_task(rtems_task_argument rtems_status_code status; rtems_id queue_id; - status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id ); + status = get_message_queue_id_send( &queue_id ); if (status != RTEMS_SUCCESSFUL) { - PRINTF1("in HOUS *** ERR %d\n", status) + PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status) } BOOT_PRINTF("in HOUS ***\n") @@ -172,6 +172,7 @@ rtems_task hous_task(rtems_task_argument housekeeping_packet.serviceType = TM_TYPE_HK; housekeeping_packet.serviceSubType = TM_SUBTYPE_HK; housekeeping_packet.destinationID = TM_DESTINATION_ID_GROUND; + housekeeping_packet.sid = SID_HK; status = rtems_rate_monotonic_cancel(HK_id); if( status != RTEMS_SUCCESSFUL ) { @@ -195,7 +196,6 @@ rtems_task hous_task(rtems_task_argument housekeeping_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time); - housekeeping_packet.sid = SID_HK; spacewire_update_statistics(); diff --git a/src/fsw_processing.c b/src/fsw_processing.c --- a/src/fsw_processing.c +++ b/src/fsw_processing.c @@ -188,10 +188,10 @@ rtems_task matr_task(rtems_task_argument init_header_asm( &headerASM ); - status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id ); + status = get_message_queue_id_send( &queue_id ); if (status != RTEMS_SUCCESSFUL) { - PRINTF1("in MATR *** ERR getting queue id, %d\n", status) + PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status) } BOOT_PRINTF("in MATR *** \n") diff --git a/src/fsw_spacewire.c b/src/fsw_spacewire.c --- a/src/fsw_spacewire.c +++ b/src/fsw_spacewire.c @@ -125,16 +125,16 @@ rtems_task recv_task( rtems_task_argumen initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes - status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_recv_id ); + status = get_message_queue_id_recv( &queue_recv_id ); if (status != RTEMS_SUCCESSFUL) { - PRINTF1("in RECV *** ERR getting QUEUE_RECV id, %d\n", status) + PRINTF1("in RECV *** ERR get_message_queue_id_recv %d\n", status) } - status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_send_id ); + status = get_message_queue_id_send( &queue_send_id ); if (status != RTEMS_SUCCESSFUL) { - PRINTF1("in RECV *** ERR getting QUEUE_SEND id, %d\n", status) + PRINTF1("in RECV *** ERR get_message_queue_id_send %d\n", status) } BOOT_PRINTF("in RECV *** \n") @@ -211,10 +211,10 @@ rtems_task send_task( rtems_task_argumen u_int32_t count; rtems_id queue_id; - status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id ); + status = get_message_queue_id_send( &queue_id ); if (status != RTEMS_SUCCESSFUL) { - PRINTF1("in SEND *** ERR getting queue id, %d\n", status) + PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status) } BOOT_PRINTF("in SEND *** \n") @@ -604,21 +604,3 @@ rtems_timer_service_routine user_routine status = RTEMS_SUCCESSFUL; } } - -rtems_status_code rtems_message_queue_send_lfr( rtems_id id, const void *buffer, size_t size ) -{ - rtems_status_code status; - rtems_mode previous_mode_set; - - // set the preemption OFF - status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode_set ); - - // use the message queue - status = rtems_message_queue_send_lfr( id, buffer, size ); - - // set the preemption ON - status = rtems_task_mode( RTEMS_PREEMPT , RTEMS_PREEMPT_MASK, &previous_mode_set ); - - return status; -} - diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -35,16 +35,16 @@ rtems_task actn_task( rtems_task_argumen rtems_id queue_rcv_id; rtems_id queue_snd_id; - status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_rcv_id ); + status = get_message_queue_id_recv( &queue_rcv_id ); if (status != RTEMS_SUCCESSFUL) { - PRINTF1("in ACTN *** ERR getting queue_rcv_id %d\n", status) + PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status) } - status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_snd_id ); + status = get_message_queue_id_send( &queue_snd_id ); if (status != RTEMS_SUCCESSFUL) { - PRINTF1("in ACTN *** ERR getting queue_snd_id %d\n", status) + PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status) } result = LFR_SUCCESSFUL; diff --git a/src/wf_handler.c b/src/wf_handler.c --- a/src/wf_handler.c +++ b/src/wf_handler.c @@ -239,6 +239,7 @@ rtems_task wfrm_task(rtems_task_argument rtems_event_set event_out; rtems_id queue_id; + rtems_status_code status; init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 ); init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 ); @@ -246,7 +247,11 @@ rtems_task wfrm_task(rtems_task_argument init_waveforms(); - queue_id = get_pkts_queue_id(); + status = get_message_queue_id_send( &queue_id ); + if (status != RTEMS_SUCCESSFUL) + { + PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status) + } BOOT_PRINTF("in WFRM ***\n") @@ -314,11 +319,16 @@ rtems_task cwf3_task(rtems_task_argument rtems_event_set event_out; rtems_id queue_id; + rtems_status_code status; init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 ); init_header_continuous_wf3_light_table( headerCWF_F3_light ); - queue_id = get_pkts_queue_id(); + status = get_message_queue_id_send( &queue_id ); + if (status != RTEMS_SUCCESSFUL) + { + PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status) + } BOOT_PRINTF("in CWF3 ***\n") @@ -353,11 +363,16 @@ rtems_task cwf2_task(rtems_task_argument rtems_event_set event_out; rtems_id queue_id; + rtems_status_code status; init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST ); init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 ); - queue_id = get_pkts_queue_id(); + status = get_message_queue_id_send( &queue_id ); + if (status != RTEMS_SUCCESSFUL) + { + PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status) + } BOOT_PRINTF("in CWF2 ***\n") @@ -418,10 +433,15 @@ rtems_task cwf1_task(rtems_task_argument rtems_event_set event_out; rtems_id queue_id; + rtems_status_code status; init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 ); - queue_id = get_pkts_queue_id(); + status = get_message_queue_id_send( &queue_id ); + if (status != RTEMS_SUCCESSFUL) + { + PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status) + } BOOT_PRINTF("in CWF1 ***\n") @@ -1161,22 +1181,6 @@ void reset_local_sbm2_nb_cwf_sent( void param_local.local_sbm2_nb_cwf_sent = 0; } -rtems_id get_pkts_queue_id( void ) -{ - rtems_id queue_id; - rtems_status_code status; - rtems_name queue_send_name; - - queue_send_name = rtems_build_name( 'Q', '_', 'S', 'D' ); - - status = rtems_message_queue_ident( queue_send_name, 0, &queue_id ); - if (status != RTEMS_SUCCESSFUL) - { - PRINTF1("in get_pkts_queue_id *** ERR %d\n", status) - } - return queue_id; -} - void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ) { unsigned short *sequence_cnt;