diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.6) +cmake_minimum_required (VERSION 3.5) project (LFR_FSW) if(NOT CMAKE_BUILD_TYPE) diff --git a/header/tc_handler.h b/header/tc_handler.h --- a/header/tc_handler.h +++ b/header/tc_handler.h @@ -51,11 +51,6 @@ extern unsigned int lastValidEnterModeTime; extern unsigned char oneTcLfrUpdateTimeReceived; -//**** -// ISR -rtems_isr commutation_isr1( rtems_vector_number vector ); -rtems_isr commutation_isr2( rtems_vector_number vector ); - //*********** // RTEMS TASK rtems_task actn_task( rtems_task_argument unused ); diff --git a/libgcov/CMakeLists.txt b/libgcov/CMakeLists.txt --- a/libgcov/CMakeLists.txt +++ b/libgcov/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.5) project(libgcov C) include(sparc-rtems) include(cppcheck) @@ -10,7 +10,7 @@ set(LIB_GCOV_SOURCES libgcov.c ) if(Coverage) -# add_definitions(-DGCOV_USE_EXIT) + add_definitions(-DGCOV_USE_EXIT) add_definitions(-DGCOV_ENABLED) endif() add_library(gcov STATIC ${LIB_GCOV_SOURCES}) diff --git a/sparc/sparc-rtems.cmake b/sparc/sparc-rtems.cmake --- a/sparc/sparc-rtems.cmake +++ b/sparc/sparc-rtems.cmake @@ -11,7 +11,7 @@ option(Coverage "Enables code coverage" set(CMAKE_C_FLAGS_RELEASE "-O2") -set(CMAKE_C_FLAGS_DEBUG "-O2 -g -fno-inline") +set(CMAKE_C_FLAGS_DEBUG "-O2 -g3 -fno-inline") if(fix-b2bst) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,54 +1,54 @@ -cmake_minimum_required (VERSION 3.6) +cmake_minimum_required (VERSION 3.5) project (fsw) include(sparc-rtems) include(cppcheck) include_directories("../header" - "../header/lfr_common_headers" - "../header/processing" - "../LFR_basic-parameters" - "../src") + "../header/lfr_common_headers" + "../header/processing" + "../LFR_basic-parameters" + "../src") set(SOURCES wf_handler.c - tc_handler.c - fsw_misc.c - fsw_init.c - fsw_globals.c - fsw_spacewire.c - tc_load_dump_parameters.c - tm_lfr_tc_exe.c - tc_acceptance.c - processing/fsw_processing.c - processing/avf0_prc0.c - processing/avf1_prc1.c - processing/avf2_prc2.c - lfr_cpu_usage_report.c - ${LFR_BP_SRC} - ../header/wf_handler.h - ../header/tc_handler.h - ../header/grlib_regs.h - ../header/fsw_misc.h - ../header/fsw_init.h - ../header/fsw_spacewire.h - ../header/tc_load_dump_parameters.h - ../header/tm_lfr_tc_exe.h - ../header/tc_acceptance.h - ../header/processing/fsw_processing.h - ../header/processing/avf0_prc0.h - ../header/processing/avf1_prc1.h - ../header/processing/avf2_prc2.h - ../header/fsw_params_wf_handler.h - ../header/lfr_cpu_usage_report.h - ../header/lfr_common_headers/ccsds_types.h - ../header/lfr_common_headers/fsw_params.h - ../header/lfr_common_headers/fsw_params_nb_bytes.h - ../header/lfr_common_headers/fsw_params_processing.h - ../header/lfr_common_headers/tm_byte_positions.h - ../LFR_basic-parameters/basic_parameters.h - ../LFR_basic-parameters/basic_parameters_params.h - ../header/GscMemoryLPP.hpp -) + tc_handler.c + fsw_misc.c + fsw_init.c + fsw_globals.c + fsw_spacewire.c + tc_load_dump_parameters.c + tm_lfr_tc_exe.c + tc_acceptance.c + processing/fsw_processing.c + processing/avf0_prc0.c + processing/avf1_prc1.c + processing/avf2_prc2.c + lfr_cpu_usage_report.c + ${LFR_BP_SRC} + ../header/wf_handler.h + ../header/tc_handler.h + ../header/grlib_regs.h + ../header/fsw_misc.h + ../header/fsw_init.h + ../header/fsw_spacewire.h + ../header/tc_load_dump_parameters.h + ../header/tm_lfr_tc_exe.h + ../header/tc_acceptance.h + ../header/processing/fsw_processing.h + ../header/processing/avf0_prc0.h + ../header/processing/avf1_prc1.h + ../header/processing/avf2_prc2.h + ../header/fsw_params_wf_handler.h + ../header/lfr_cpu_usage_report.h + ../header/lfr_common_headers/ccsds_types.h + ../header/lfr_common_headers/fsw_params.h + ../header/lfr_common_headers/fsw_params_nb_bytes.h + ../header/lfr_common_headers/fsw_params_processing.h + ../header/lfr_common_headers/tm_byte_positions.h + ../LFR_basic-parameters/basic_parameters.h + ../LFR_basic-parameters/basic_parameters_params.h + ../header/GscMemoryLPP.hpp + ) option(FSW_verbose "Enable verbose LFR" OFF) @@ -61,6 +61,7 @@ option(FSW_lpp_dpu_destid "Set to debug option(FSW_debug_watchdog "Enable debug watchdog" OFF) option(FSW_debug_tch "?" OFF) option(FSW_Instrument_Scrubbing "Enable scrubbing counter" OFF) +option(FSW_Enable_Dead_Code "Enable dead code compilation, this is used to hide by default unused code." OFF) set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE) set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE) @@ -68,33 +69,38 @@ set(SW_VERSION_N3 "0" CACHE STRING "Cho set(SW_VERSION_N4 "22" CACHE STRING "Choose N4 FSW Version." FORCE) if(FSW_verbose) - add_definitions(-DPRINT_MESSAGES_ON_CONSOLE) + add_definitions(-DPRINT_MESSAGES_ON_CONSOLE) endif() if(FSW_boot_messages) - add_definitions(-DBOOT_MESSAGES) + add_definitions(-DBOOT_MESSAGES) endif() if(FSW_debug_messages) - add_definitions(-DDEBUG_MESSAGES) + add_definitions(-DDEBUG_MESSAGES) endif() if(FSW_cpu_usage_report) - add_definitions(-DPRINT_TASK_STATISTICS) + add_definitions(-DPRINT_TASK_STATISTICS) endif() if(FSW_stack_report) - add_definitions(-DPRINT_STACK_REPORT) + add_definitions(-DPRINT_STACK_REPORT) endif() if(FSW_vhdl_dev) - add_definitions(-DVHDL_DEV) + add_definitions(-DVHDL_DEV) endif() if(FSW_lpp_dpu_destid) - add_definitions(-DLPP_DPU_DESTID) + add_definitions(-DLPP_DPU_DESTID) endif() if(FSW_debug_watchdog) - add_definitions(-DDEBUG_WATCHDOG) + add_definitions(-DDEBUG_WATCHDOG) endif() if(FSW_debug_tch) - add_definitions(-DDEBUG_TCH) + add_definitions(-DDEBUG_TCH) endif() +if(FSW_Enable_Dead_Code) + add_definitions(-DENABLE_DEAD_CODE) +endif() + + add_definitions(-DMSB_FIRST_TCH) diff --git a/src/fsw_misc.c b/src/fsw_misc.c --- a/src/fsw_misc.c +++ b/src/fsw_misc.c @@ -66,6 +66,7 @@ void timer_configure(unsigned char timer timer_set_clock_divider( timer, clock_divider); } +#ifdef ENABLE_DEAD_CODE void timer_start(unsigned char timer) { /** This function starts a GPTIMER timer. @@ -81,6 +82,7 @@ void timer_start(unsigned char timer) gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_RS; gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_IE; } +#endif void timer_stop(unsigned char timer) { diff --git a/src/tc_acceptance.c b/src/tc_acceptance.c --- a/src/tc_acceptance.c +++ b/src/tc_acceptance.c @@ -222,10 +222,6 @@ int tc_check_type( unsigned char packetT { status = CCSDS_TM_VALID; } - else - { - status = ILL_TYPE; - } return status; } diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -1433,6 +1433,7 @@ void setCalibrationData( void ) } } +#ifdef ENABLE_DEAD_CODE void setCalibrationDataInterleaved( void ) { /** This function is used to store the values used to drive the DAC in order to generate the SCM calibration signal @@ -1477,6 +1478,7 @@ void setCalibrationDataInterleaved( void + ( (dataPtr[1] & CAL_DATA_MASK_INTER) << CAL_DATA_SHIFT_INTER); } } +#endif void setCalibrationReload( bool state) { @@ -1503,6 +1505,7 @@ void setCalibrationEnable( bool state ) } } +#ifdef ENABLE_DEAD_CODE void setCalibrationInterleaved( bool state ) { // this bit drives the multiplexer @@ -1515,6 +1518,7 @@ void setCalibrationInterleaved( bool sta time_management_regs->calDACCtrl = time_management_regs->calDACCtrl & MASK_SET_INTERLEAVED; // [1101 1111] } } +#endif void setCalibration( bool state ) { @@ -1535,6 +1539,7 @@ void setCalibration( bool state ) void configureCalibration( bool interleaved ) { setCalibration( false ); +#ifdef ENABLE_DEAD_CODE if ( interleaved == true ) { setCalibrationInterleaved( true ); @@ -1543,6 +1548,7 @@ void configureCalibration( bool interlea setCalibrationDataInterleaved(); } else +#endif { setCalibrationPrescaler( 0 ); // 25 MHz => 25 000 000 setCalibrationDivisor( CAL_F_DIVISOR ); // => 160 256 (39 - 1) @@ -1648,22 +1654,6 @@ void close_action(ccsdsTelecommandPacket } } -//*************************** -// Interrupt Service Routines -rtems_isr commutation_isr1( rtems_vector_number vector ) -{ - if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { - PRINTF("In commutation_isr1 *** Error sending event to DUMB\n") - } -} - -rtems_isr commutation_isr2( rtems_vector_number vector ) -{ - if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { - PRINTF("In commutation_isr2 *** Error sending event to DUMB\n") - } -} - //**************** // OTHER FUNCTIONS void updateLFRCurrentMode( unsigned char requestedMode ) 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 @@ -240,6 +240,7 @@ int send_tm_lfr_tc_exe_not_executable( c return status; } +#ifdef DENABLE_DEAD_CODE int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ) { /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue. @@ -305,6 +306,7 @@ int send_tm_lfr_tc_exe_not_implemented( return status; } +#endif int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) {