##// END OF EJS Templates
Removed unused function and implemented scrubbing perriod counter...
jeandet -
r389:74df79cc7806 No PWD scrub with... draft
parent child
Show More
@@ -129,7 +129,6 void init_housekeeping_parameters( void
129 void increment_seq_counter(unsigned short *packetSequenceControl);
129 void increment_seq_counter(unsigned short *packetSequenceControl);
130 void getTime( unsigned char *time);
130 void getTime( unsigned char *time);
131 unsigned long long int getTimeAsUnsignedLongLongInt( );
131 unsigned long long int getTimeAsUnsignedLongLongInt( );
132 void send_dumb_hk( void );
133 void get_temperatures( unsigned char *temperatures );
132 void get_temperatures( unsigned char *temperatures );
134 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
133 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
135 void get_cpu_load( unsigned char *resource_statistics );
134 void get_cpu_load( unsigned char *resource_statistics );
@@ -19,11 +19,6 if(fix-b2bst)
19 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfix-b2bst")
19 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfix-b2bst")
20 endif()
20 endif()
21
21
22 #if(Coverage)
23 # set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage")
24 # set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
25 #endif()
26
27
22
28 set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <FLAGS> -Xlinker -Map=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
23 set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <FLAGS> -Xlinker -Map=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
29
24
@@ -60,6 +60,7 option(FSW_vhdl_dev "?" OFF)
60 option(FSW_lpp_dpu_destid "Set to debug at LPP" OFF)
60 option(FSW_lpp_dpu_destid "Set to debug at LPP" OFF)
61 option(FSW_debug_watchdog "Enable debug watchdog" OFF)
61 option(FSW_debug_watchdog "Enable debug watchdog" OFF)
62 option(FSW_debug_tch "?" OFF)
62 option(FSW_debug_tch "?" OFF)
63 option(FSW_Instrument_Scrubbing "Enable scrubbing counter" OFF)
63
64
64 set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE)
65 set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE)
65 set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE)
66 set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE)
@@ -106,6 +107,10 add_definitions(-DSW_VERSION_N4=${SW_VER
106
107
107 add_executable(fsw ${SOURCES})
108 add_executable(fsw ${SOURCES})
108
109
110 if(FSW_Instrument_Scrubbing)
111 add_definitions(-DENABLE_SCRUBBING_COUNTER)
112 endif()
113
109 if(Coverage)
114 if(Coverage)
110 target_link_libraries(fsw gcov)
115 target_link_libraries(fsw gcov)
111 SET_TARGET_PROPERTIES(fsw PROPERTIES COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
116 SET_TARGET_PROPERTIES(fsw PROPERTIES COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
@@ -536,9 +536,18 rtems_task scrubbing_task( rtems_task_ar
536 volatile float valuef = 1.;
536 volatile float valuef = 1.;
537 volatile uint32_t* RAM=(uint32_t*)0x40000000;
537 volatile uint32_t* RAM=(uint32_t*)0x40000000;
538 volatile uint32_t value;
538 volatile uint32_t value;
539 #ifdef ENABLE_SCRUBBING_COUNTER
540 housekeeping_packet.lfr_fpga_version[BYTE_0] = 0;
541 #endif
539 while(1){
542 while(1){
540 i=(i+1)%(1024*1024);
543 i=(i+1)%(1024*1024);
541 valuef += 10.f*(float)RAM[i];
544 valuef += 10.f*(float)RAM[i];
545 #ifdef ENABLE_SCRUBBING_COUNTER
546 if(i==0)
547 {
548 housekeeping_packet.lfr_fpga_version[BYTE_0] += 1;
549 }
550 #endif
542 }
551 }
543 }
552 }
544
553
@@ -692,64 +701,6 unsigned long long int getTimeAsUnsigned
692 return time;
701 return time;
693 }
702 }
694
703
695 void send_dumb_hk( void )
696 {
697 Packet_TM_LFR_HK_t dummy_hk_packet;
698 unsigned char *parameters;
699 unsigned int i;
700 rtems_id queue_id;
701
702 queue_id = RTEMS_ID_NONE;
703
704 dummy_hk_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
705 dummy_hk_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
706 dummy_hk_packet.reserved = DEFAULT_RESERVED;
707 dummy_hk_packet.userApplication = CCSDS_USER_APP;
708 dummy_hk_packet.packetID[0] = (unsigned char) (APID_TM_HK >> SHIFT_1_BYTE);
709 dummy_hk_packet.packetID[1] = (unsigned char) (APID_TM_HK);
710 dummy_hk_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
711 dummy_hk_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
712 dummy_hk_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> SHIFT_1_BYTE);
713 dummy_hk_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
714 dummy_hk_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
715 dummy_hk_packet.serviceType = TM_TYPE_HK;
716 dummy_hk_packet.serviceSubType = TM_SUBTYPE_HK;
717 dummy_hk_packet.destinationID = TM_DESTINATION_ID_GROUND;
718 dummy_hk_packet.time[0] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_3_BYTES);
719 dummy_hk_packet.time[1] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_2_BYTES);
720 dummy_hk_packet.time[BYTE_2] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_1_BYTE);
721 dummy_hk_packet.time[BYTE_3] = (unsigned char) (time_management_regs->coarse_time);
722 dummy_hk_packet.time[BYTE_4] = (unsigned char) (time_management_regs->fine_time >> SHIFT_1_BYTE);
723 dummy_hk_packet.time[BYTE_5] = (unsigned char) (time_management_regs->fine_time);
724 dummy_hk_packet.sid = SID_HK;
725
726 // init status word
727 dummy_hk_packet.lfr_status_word[0] = INT8_ALL_F;
728 dummy_hk_packet.lfr_status_word[1] = INT8_ALL_F;
729 // init software version
730 dummy_hk_packet.lfr_sw_version[0] = SW_VERSION_N1;
731 dummy_hk_packet.lfr_sw_version[1] = SW_VERSION_N2;
732 dummy_hk_packet.lfr_sw_version[BYTE_2] = SW_VERSION_N3;
733 dummy_hk_packet.lfr_sw_version[BYTE_3] = SW_VERSION_N4;
734 // init fpga version
735 parameters = (unsigned char *) (REGS_ADDR_WAVEFORM_PICKER + APB_OFFSET_VHDL_REV);
736 dummy_hk_packet.lfr_fpga_version[BYTE_0] = parameters[BYTE_1]; // n1
737 dummy_hk_packet.lfr_fpga_version[BYTE_1] = parameters[BYTE_2]; // n2
738 dummy_hk_packet.lfr_fpga_version[BYTE_2] = parameters[BYTE_3]; // n3
739
740 parameters = (unsigned char *) &dummy_hk_packet.hk_lfr_cpu_load;
741
742 for (i=0; i<(BYTE_POS_HK_REACTION_WHEELS_FREQUENCY - BYTE_POS_HK_LFR_CPU_LOAD); i++)
743 {
744 parameters[i] = INT8_ALL_F;
745 }
746
747 get_message_queue_id_send( &queue_id );
748
749 rtems_message_queue_send( queue_id, &dummy_hk_packet,
750 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
751 }
752
753 void get_temperatures( unsigned char *temperatures )
704 void get_temperatures( unsigned char *temperatures )
754 {
705 {
755 unsigned char* temp_scm_ptr;
706 unsigned char* temp_scm_ptr;
General Comments 0
You need to be logged in to leave comments. Login now