##// END OF EJS Templates
Disabled most dead code + set CMake min Ver to 3.5
jeandet -
r402:eb452cd0caf8 R3++ draft
parent child
Show More
@@ -1,4 +1,4
1 cmake_minimum_required (VERSION 3.6)
1 cmake_minimum_required (VERSION 3.5)
2 2 project (LFR_FSW)
3 3
4 4 if(NOT CMAKE_BUILD_TYPE)
@@ -51,11 +51,6
51 51 extern unsigned int lastValidEnterModeTime;
52 52 extern unsigned char oneTcLfrUpdateTimeReceived;
53 53
54 //****
55 // ISR
56 rtems_isr commutation_isr1( rtems_vector_number vector );
57 rtems_isr commutation_isr2( rtems_vector_number vector );
58
59 54 //***********
60 55 // RTEMS TASK
61 56 rtems_task actn_task( rtems_task_argument unused );
@@ -1,4 +1,4
1 cmake_minimum_required(VERSION 3.6)
1 cmake_minimum_required(VERSION 3.5)
2 2 project(libgcov C)
3 3 include(sparc-rtems)
4 4 include(cppcheck)
@@ -10,7 +10,7 set(LIB_GCOV_SOURCES
10 10 libgcov.c
11 11 )
12 12 if(Coverage)
13 # add_definitions(-DGCOV_USE_EXIT)
13 add_definitions(-DGCOV_USE_EXIT)
14 14 add_definitions(-DGCOV_ENABLED)
15 15 endif()
16 16 add_library(gcov STATIC ${LIB_GCOV_SOURCES})
@@ -11,7 +11,7 option(Coverage "Enables code coverage"
11 11
12 12
13 13 set(CMAKE_C_FLAGS_RELEASE "-O2")
14 set(CMAKE_C_FLAGS_DEBUG "-O2 -g -fno-inline")
14 set(CMAKE_C_FLAGS_DEBUG "-O2 -g3 -fno-inline")
15 15
16 16
17 17 if(fix-b2bst)
@@ -1,54 +1,54
1 cmake_minimum_required (VERSION 3.6)
1 cmake_minimum_required (VERSION 3.5)
2 2 project (fsw)
3 3
4 4 include(sparc-rtems)
5 5 include(cppcheck)
6 6
7 7 include_directories("../header"
8 "../header/lfr_common_headers"
9 "../header/processing"
10 "../LFR_basic-parameters"
11 "../src")
8 "../header/lfr_common_headers"
9 "../header/processing"
10 "../LFR_basic-parameters"
11 "../src")
12 12
13 13 set(SOURCES wf_handler.c
14 tc_handler.c
15 fsw_misc.c
16 fsw_init.c
17 fsw_globals.c
18 fsw_spacewire.c
19 tc_load_dump_parameters.c
20 tm_lfr_tc_exe.c
21 tc_acceptance.c
22 processing/fsw_processing.c
23 processing/avf0_prc0.c
24 processing/avf1_prc1.c
25 processing/avf2_prc2.c
26 lfr_cpu_usage_report.c
27 ${LFR_BP_SRC}
28 ../header/wf_handler.h
29 ../header/tc_handler.h
30 ../header/grlib_regs.h
31 ../header/fsw_misc.h
32 ../header/fsw_init.h
33 ../header/fsw_spacewire.h
34 ../header/tc_load_dump_parameters.h
35 ../header/tm_lfr_tc_exe.h
36 ../header/tc_acceptance.h
37 ../header/processing/fsw_processing.h
38 ../header/processing/avf0_prc0.h
39 ../header/processing/avf1_prc1.h
40 ../header/processing/avf2_prc2.h
41 ../header/fsw_params_wf_handler.h
42 ../header/lfr_cpu_usage_report.h
43 ../header/lfr_common_headers/ccsds_types.h
44 ../header/lfr_common_headers/fsw_params.h
45 ../header/lfr_common_headers/fsw_params_nb_bytes.h
46 ../header/lfr_common_headers/fsw_params_processing.h
47 ../header/lfr_common_headers/tm_byte_positions.h
48 ../LFR_basic-parameters/basic_parameters.h
49 ../LFR_basic-parameters/basic_parameters_params.h
50 ../header/GscMemoryLPP.hpp
51 )
14 tc_handler.c
15 fsw_misc.c
16 fsw_init.c
17 fsw_globals.c
18 fsw_spacewire.c
19 tc_load_dump_parameters.c
20 tm_lfr_tc_exe.c
21 tc_acceptance.c
22 processing/fsw_processing.c
23 processing/avf0_prc0.c
24 processing/avf1_prc1.c
25 processing/avf2_prc2.c
26 lfr_cpu_usage_report.c
27 ${LFR_BP_SRC}
28 ../header/wf_handler.h
29 ../header/tc_handler.h
30 ../header/grlib_regs.h
31 ../header/fsw_misc.h
32 ../header/fsw_init.h
33 ../header/fsw_spacewire.h
34 ../header/tc_load_dump_parameters.h
35 ../header/tm_lfr_tc_exe.h
36 ../header/tc_acceptance.h
37 ../header/processing/fsw_processing.h
38 ../header/processing/avf0_prc0.h
39 ../header/processing/avf1_prc1.h
40 ../header/processing/avf2_prc2.h
41 ../header/fsw_params_wf_handler.h
42 ../header/lfr_cpu_usage_report.h
43 ../header/lfr_common_headers/ccsds_types.h
44 ../header/lfr_common_headers/fsw_params.h
45 ../header/lfr_common_headers/fsw_params_nb_bytes.h
46 ../header/lfr_common_headers/fsw_params_processing.h
47 ../header/lfr_common_headers/tm_byte_positions.h
48 ../LFR_basic-parameters/basic_parameters.h
49 ../LFR_basic-parameters/basic_parameters_params.h
50 ../header/GscMemoryLPP.hpp
51 )
52 52
53 53
54 54 option(FSW_verbose "Enable verbose LFR" OFF)
@@ -61,6 +61,7 option(FSW_lpp_dpu_destid "Set to debug
61 61 option(FSW_debug_watchdog "Enable debug watchdog" OFF)
62 62 option(FSW_debug_tch "?" OFF)
63 63 option(FSW_Instrument_Scrubbing "Enable scrubbing counter" OFF)
64 option(FSW_Enable_Dead_Code "Enable dead code compilation, this is used to hide by default unused code." OFF)
64 65
65 66 set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE)
66 67 set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE)
@@ -68,33 +69,38 set(SW_VERSION_N3 "0" CACHE STRING "Cho
68 69 set(SW_VERSION_N4 "22" CACHE STRING "Choose N4 FSW Version." FORCE)
69 70
70 71 if(FSW_verbose)
71 add_definitions(-DPRINT_MESSAGES_ON_CONSOLE)
72 add_definitions(-DPRINT_MESSAGES_ON_CONSOLE)
72 73 endif()
73 74 if(FSW_boot_messages)
74 add_definitions(-DBOOT_MESSAGES)
75 add_definitions(-DBOOT_MESSAGES)
75 76 endif()
76 77 if(FSW_debug_messages)
77 add_definitions(-DDEBUG_MESSAGES)
78 add_definitions(-DDEBUG_MESSAGES)
78 79 endif()
79 80 if(FSW_cpu_usage_report)
80 add_definitions(-DPRINT_TASK_STATISTICS)
81 add_definitions(-DPRINT_TASK_STATISTICS)
81 82 endif()
82 83 if(FSW_stack_report)
83 add_definitions(-DPRINT_STACK_REPORT)
84 add_definitions(-DPRINT_STACK_REPORT)
84 85 endif()
85 86 if(FSW_vhdl_dev)
86 add_definitions(-DVHDL_DEV)
87 add_definitions(-DVHDL_DEV)
87 88 endif()
88 89 if(FSW_lpp_dpu_destid)
89 add_definitions(-DLPP_DPU_DESTID)
90 add_definitions(-DLPP_DPU_DESTID)
90 91 endif()
91 92 if(FSW_debug_watchdog)
92 add_definitions(-DDEBUG_WATCHDOG)
93 add_definitions(-DDEBUG_WATCHDOG)
93 94 endif()
94 95 if(FSW_debug_tch)
95 add_definitions(-DDEBUG_TCH)
96 add_definitions(-DDEBUG_TCH)
96 97 endif()
97 98
99 if(FSW_Enable_Dead_Code)
100 add_definitions(-DENABLE_DEAD_CODE)
101 endif()
102
103
98 104
99 105
100 106 add_definitions(-DMSB_FIRST_TCH)
@@ -66,6 +66,7 void timer_configure(unsigned char timer
66 66 timer_set_clock_divider( timer, clock_divider);
67 67 }
68 68
69 #ifdef ENABLE_DEAD_CODE
69 70 void timer_start(unsigned char timer)
70 71 {
71 72 /** This function starts a GPTIMER timer.
@@ -81,6 +82,7 void timer_start(unsigned char timer)
81 82 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_RS;
82 83 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_IE;
83 84 }
85 #endif
84 86
85 87 void timer_stop(unsigned char timer)
86 88 {
@@ -222,10 +222,6 int tc_check_type( unsigned char packetT
222 222 {
223 223 status = CCSDS_TM_VALID;
224 224 }
225 else
226 {
227 status = ILL_TYPE;
228 }
229 225
230 226 return status;
231 227 }
@@ -1433,6 +1433,7 void setCalibrationData( void )
1433 1433 }
1434 1434 }
1435 1435
1436 #ifdef ENABLE_DEAD_CODE
1436 1437 void setCalibrationDataInterleaved( void )
1437 1438 {
1438 1439 /** 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
1477 1478 + ( (dataPtr[1] & CAL_DATA_MASK_INTER) << CAL_DATA_SHIFT_INTER);
1478 1479 }
1479 1480 }
1481 #endif
1480 1482
1481 1483 void setCalibrationReload( bool state)
1482 1484 {
@@ -1503,6 +1505,7 void setCalibrationEnable( bool state )
1503 1505 }
1504 1506 }
1505 1507
1508 #ifdef ENABLE_DEAD_CODE
1506 1509 void setCalibrationInterleaved( bool state )
1507 1510 {
1508 1511 // this bit drives the multiplexer
@@ -1515,6 +1518,7 void setCalibrationInterleaved( bool sta
1515 1518 time_management_regs->calDACCtrl = time_management_regs->calDACCtrl & MASK_SET_INTERLEAVED; // [1101 1111]
1516 1519 }
1517 1520 }
1521 #endif
1518 1522
1519 1523 void setCalibration( bool state )
1520 1524 {
@@ -1535,6 +1539,7 void setCalibration( bool state )
1535 1539 void configureCalibration( bool interleaved )
1536 1540 {
1537 1541 setCalibration( false );
1542 #ifdef ENABLE_DEAD_CODE
1538 1543 if ( interleaved == true )
1539 1544 {
1540 1545 setCalibrationInterleaved( true );
@@ -1543,6 +1548,7 void configureCalibration( bool interlea
1543 1548 setCalibrationDataInterleaved();
1544 1549 }
1545 1550 else
1551 #endif
1546 1552 {
1547 1553 setCalibrationPrescaler( 0 ); // 25 MHz => 25 000 000
1548 1554 setCalibrationDivisor( CAL_F_DIVISOR ); // => 160 256 (39 - 1)
@@ -1648,22 +1654,6 void close_action(ccsdsTelecommandPacket
1648 1654 }
1649 1655 }
1650 1656
1651 //***************************
1652 // Interrupt Service Routines
1653 rtems_isr commutation_isr1( rtems_vector_number vector )
1654 {
1655 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
1656 PRINTF("In commutation_isr1 *** Error sending event to DUMB\n")
1657 }
1658 }
1659
1660 rtems_isr commutation_isr2( rtems_vector_number vector )
1661 {
1662 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
1663 PRINTF("In commutation_isr2 *** Error sending event to DUMB\n")
1664 }
1665 }
1666
1667 1657 //****************
1668 1658 // OTHER FUNCTIONS
1669 1659 void updateLFRCurrentMode( unsigned char requestedMode )
@@ -240,6 +240,7 int send_tm_lfr_tc_exe_not_executable( c
240 240 return status;
241 241 }
242 242
243 #ifdef DENABLE_DEAD_CODE
243 244 int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time )
244 245 {
245 246 /** 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(
305 306
306 307 return status;
307 308 }
309 #endif
308 310
309 311 int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
310 312 {
General Comments 0
You need to be logged in to leave comments. Login now