|
1 | NO CONTENT: new file 100644, binary diff hidden |
@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: bin/fsw |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.5) on: |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Fri Oct 11 10:41:32 2013 | |
|
4 | 4 | # Project: fsw-qt.pro |
|
5 | 5 | # Template: app |
|
6 | 6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
@@ -10,7 +10,7 | |||
|
10 | 10 | |
|
11 | 11 | CC = sparc-rtems-gcc |
|
12 | 12 | CXX = sparc-rtems-g++ |
|
13 |
DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=1 |
|
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=15 -DPRINT_MESSAGES_ON_CONSOLE | |
|
14 | 14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | 15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
16 | 16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -7,11 +7,11 CONFIG -= qt | |||
|
7 | 7 | include(./sparc.pri) |
|
8 | 8 | |
|
9 | 9 | # flight software version |
|
10 |
SWVERSION=-0-1 |
|
|
10 | SWVERSION=-0-15 | |
|
11 | 11 | DEFINES += SW_VERSION_N1=0 |
|
12 | 12 | DEFINES += SW_VERSION_N2=0 |
|
13 | 13 | DEFINES += SW_VERSION_N3=0 |
|
14 |
DEFINES += SW_VERSION_N4=1 |
|
|
14 | DEFINES += SW_VERSION_N4=15 | |
|
15 | 15 | |
|
16 | 16 | contains( CONFIG, verbose ) { |
|
17 | 17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
@@ -1,6 +1,6 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by QtCreator 2.8.0, 2013-10-1 |
|
|
3 | <!-- Written by QtCreator 2.8.0, 2013-10-11T07:07:36. --> | |
|
4 | 4 | <qtcreator> |
|
5 | 5 | <data> |
|
6 | 6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -178,13 +178,15 | |||
|
178 | 178 | |
|
179 | 179 | #define SPARE1_PUSVERSION_SPARE2 0x10 |
|
180 | 180 | |
|
181 | #define LEN_TM_LFR_HK 126 + 4 | |
|
182 | #define LEN_TM_LFR_TC_EXE_NOT_IMP 24 +4 | |
|
181 | #define LEN_TM_LFR_HK 130 // 126 + 4 | |
|
182 | #define LEN_TM_LFR_TC_EXE_NOT_IMP 28 // 24 + 4 | |
|
183 | 183 | |
|
184 |
#define TM_LEN_SCI_SWF_340 |
|
|
185 |
#define TM_LEN_SCI_SWF_8 |
|
|
186 |
#define TM_LEN_SCI_CWF_340 |
|
|
187 |
#define TM_LEN_SCI_CWF_8 |
|
|
184 | #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1 | |
|
185 | #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1 | |
|
186 | #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1 | |
|
187 | #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1 | |
|
188 | #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1 | |
|
189 | #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1 | |
|
188 | 190 | #define DEFAULT_PKTCNT 0x07 |
|
189 | 191 | #define BLK_NR_340 0x0154 |
|
190 | 192 | #define BLK_NR_8 0x0008 |
@@ -183,6 +183,8 | |||
|
183 | 183 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 |
|
184 | 184 | #define NB_BYTES_SWF_BLK (2 * 6) |
|
185 | 185 | #define NB_WORDS_SWF_BLK 3 |
|
186 | #define NB_BYTES_CWF3_LIGHT_BLK 6 | |
|
187 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 | |
|
186 | 188 | |
|
187 | 189 | //****************** |
|
188 | 190 | // SEQUENCE COUNTERS |
@@ -29,6 +29,7 extern volatile int wf_snap_f2_norm[ ]; | |||
|
29 | 29 | // |
|
30 | 30 | extern volatile int wf_cont_f3[ ]; |
|
31 | 31 | extern volatile int wf_cont_f3_bis[ ]; |
|
32 | extern char wf_cont_f3_light[ ]; | |
|
32 | 33 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
33 | 34 | |
|
34 | 35 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
@@ -44,11 +45,14 void init_waveforms( void ); | |||
|
44 | 45 | // |
|
45 | 46 |
int init_header_snapshot_wf_table(unsigned int sid |
|
46 | 47 |
int init_header_continuous_wf_table(unsigned int sid |
|
48 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); | |
|
47 | 49 | // |
|
48 | 50 | void reset_waveforms( void ); |
|
49 | 51 | |
|
50 | 52 | int send_waveform_SWF(volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id); |
|
51 | 53 | int send_waveform_CWF(volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id); |
|
54 | int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
|
55 | int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
|
52 | 56 | |
|
53 | 57 | //************** |
|
54 | 58 | // wfp registers |
@@ -37,6 +37,7 volatile int wf_snap_f2_norm[ NB_SAMPLES | |||
|
37 | 37 | // |
|
38 | 38 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
39 | 39 | volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
40 | char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK ]; | |
|
40 | 41 | |
|
41 | 42 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
42 | 43 | volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ]; |
@@ -526,6 +526,8 int action_load_normal_par(ccsdsTelecomm | |||
|
526 | 526 | ) * 8; |
|
527 | 527 | if ( (tmp < 16) || (tmp>65528) ) |
|
528 | 528 | { |
|
529 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, 12, TC->dataAndCRC[2]); | |
|
530 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, 13, TC->dataAndCRC[3]); | |
|
529 | 531 | result = LFR_DEFAULT; |
|
530 | 532 | } |
|
531 | 533 | else |
@@ -9,6 +9,7 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1 | |||
|
9 | 9 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7]; |
|
10 | 10 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7]; |
|
11 | 11 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7]; |
|
12 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7]; | |
|
12 | 13 | |
|
13 | 14 | unsigned char doubleSendCWF1 = 0; |
|
14 | 15 | unsigned char doubleSendCWF2 = 0; |
@@ -277,6 +278,7 rtems_task cwf3_task(rtems_task_argument | |||
|
277 | 278 | rtems_id queue_id; |
|
278 | 279 | |
|
279 | 280 | init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 ); |
|
281 | init_header_continuous_wf3_light_table( headerCWF_F3_light ); | |
|
280 | 282 | |
|
281 | 283 | queue_id = get_pkts_queue_id(); |
|
282 | 284 | |
@@ -290,10 +292,10 rtems_task cwf3_task(rtems_task_argument | |||
|
290 | 292 | #ifdef GSA |
|
291 | 293 | #else |
|
292 | 294 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { |
|
293 |
send_waveform_CWF( wf_cont_f3_bis, |
|
|
295 | send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id ); | |
|
294 | 296 | } |
|
295 | 297 | else { |
|
296 |
send_waveform_CWF( wf_cont_f3, |
|
|
298 | send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id ); | |
|
297 | 299 | } |
|
298 | 300 | #endif |
|
299 | 301 | } |
@@ -551,6 +553,62 int init_header_continuous_wf_table( uns | |||
|
551 | 553 | return LFR_SUCCESSFUL; |
|
552 | 554 | } |
|
553 | 555 | |
|
556 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) | |
|
557 | { | |
|
558 | unsigned int i; | |
|
559 | ||
|
560 | for (i=0; i<7; i++) | |
|
561 | { | |
|
562 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; | |
|
563 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
|
564 | headerCWF[ i ].reserved = DEFAULT_RESERVED; | |
|
565 | headerCWF[ i ].userApplication = CCSDS_USER_APP; | |
|
566 | ||
|
567 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); | |
|
568 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); | |
|
569 | if (i == 0) | |
|
570 | { | |
|
571 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; | |
|
572 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); | |
|
573 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); | |
|
574 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
|
575 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
|
576 | } | |
|
577 | else if (i == 6) | |
|
578 | { | |
|
579 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; | |
|
580 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8); | |
|
581 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 ); | |
|
582 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); | |
|
583 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); | |
|
584 | } | |
|
585 | else | |
|
586 | { | |
|
587 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; | |
|
588 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); | |
|
589 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); | |
|
590 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
|
591 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
|
592 | } | |
|
593 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
|
594 | // DATA FIELD HEADER | |
|
595 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
|
596 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
|
597 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
|
598 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
|
599 | // AUXILIARY DATA HEADER | |
|
600 | headerCWF[ i ].sid = SID_NORM_CWF_F3; | |
|
601 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; | |
|
602 | headerCWF[ i ].time[0] = 0x00; | |
|
603 | headerCWF[ i ].time[0] = 0x00; | |
|
604 | headerCWF[ i ].time[0] = 0x00; | |
|
605 | headerCWF[ i ].time[0] = 0x00; | |
|
606 | headerCWF[ i ].time[0] = 0x00; | |
|
607 | headerCWF[ i ].time[0] = 0x00; | |
|
608 | } | |
|
609 | return LFR_SUCCESSFUL; | |
|
610 | } | |
|
611 | ||
|
554 | 612 | void reset_waveforms( void ) |
|
555 | 613 | { |
|
556 | 614 | int i = 0; |
@@ -694,6 +752,76 int send_waveform_CWF(volatile int *wave | |||
|
694 | 752 | return ret; |
|
695 | 753 | } |
|
696 | 754 | |
|
755 | int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) | |
|
756 | { | |
|
757 | unsigned int i; | |
|
758 | int ret; | |
|
759 | rtems_status_code status; | |
|
760 | spw_ioctl_pkt_send spw_ioctl_send_CWF; | |
|
761 | char *sample; | |
|
762 | ||
|
763 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header | |
|
764 | spw_ioctl_send_CWF.options = 0; | |
|
765 | ||
|
766 | ret = LFR_DEFAULT; | |
|
767 | ||
|
768 | //********************** | |
|
769 | // BUILD CWF3_light DATA | |
|
770 | for ( i=0; i< 2048; i++) | |
|
771 | { | |
|
772 | sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ]; | |
|
773 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ]; | |
|
774 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ]; | |
|
775 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ]; | |
|
776 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ]; | |
|
777 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ]; | |
|
778 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; | |
|
779 | } | |
|
780 | ||
|
781 | //********************* | |
|
782 | // SEND CWF3_light DATA | |
|
783 | ||
|
784 | for (i=0; i<7; i++) // send waveform | |
|
785 | { | |
|
786 | int coarseTime = 0x00; | |
|
787 | int fineTime = 0x00; | |
|
788 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ]; | |
|
789 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; | |
|
790 | // BUILD THE DATA | |
|
791 | if ( i == WFRM_INDEX_OF_LAST_PACKET ) { | |
|
792 | spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK; | |
|
793 | } | |
|
794 | else { | |
|
795 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK; | |
|
796 | } | |
|
797 | // SET PACKET TIME | |
|
798 | coarseTime = time_management_regs->coarse_time; | |
|
799 | fineTime = time_management_regs->fine_time; | |
|
800 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); | |
|
801 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); | |
|
802 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); | |
|
803 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); | |
|
804 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); | |
|
805 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); | |
|
806 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); | |
|
807 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); | |
|
808 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); | |
|
809 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); | |
|
810 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); | |
|
811 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); | |
|
812 | // SEND PACKET | |
|
813 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); | |
|
814 | if (status != RTEMS_SUCCESSFUL) { | |
|
815 | printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status); | |
|
816 | ret = LFR_DEFAULT; | |
|
817 | } | |
|
818 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); | |
|
819 | } | |
|
820 | ||
|
821 | return ret; | |
|
822 | } | |
|
823 | ||
|
824 | ||
|
697 | 825 | //************** |
|
698 | 826 | // wfp registers |
|
699 | 827 | void set_wfp_data_shaping() |
@@ -720,6 +848,9 char set_wfp_delta_snapshot() | |||
|
720 | 848 | { |
|
721 | 849 | char ret; |
|
722 | 850 | unsigned int delta_snapshot; |
|
851 | unsigned int aux; | |
|
852 | ||
|
853 | aux = 0; | |
|
723 | 854 | ret = LFR_DEFAULT; |
|
724 | 855 | |
|
725 | 856 | delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256 |
@@ -727,7 +858,6 char set_wfp_delta_snapshot() | |||
|
727 | 858 | |
|
728 | 859 | #ifdef GSA |
|
729 | 860 | #else |
|
730 | unsigned char aux = 0; | |
|
731 | 861 | if ( delta_snapshot < MIN_DELTA_SNAPSHOT ) |
|
732 | 862 | { |
|
733 | 863 | aux = MIN_DELTA_SNAPSHOT; |
General Comments 0
You need to be logged in to leave comments.
Login now