@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: bin/fsw |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.6) on: |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue Jul 15 15:57:23 2014 | |
|
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= |
|
|
13 | DEFINES = -DSW_VERSION_N1=2 -DSW_VERSION_N2=0 -DSW_VERSION_N3=1 -DSW_VERSION_N4=0 -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 -I../header/processing -I../src/LFR_basic-parameters |
@@ -8,10 +8,10 include(./sparc.pri) | |||
|
8 | 8 | |
|
9 | 9 | # flight software version |
|
10 | 10 | SWVERSION=-1-0 |
|
11 |
DEFINES += SW_VERSION_N1= |
|
|
11 | DEFINES += SW_VERSION_N1=2 # major | |
|
12 | 12 | DEFINES += SW_VERSION_N2=0 # minor |
|
13 |
DEFINES += SW_VERSION_N3= |
|
|
14 |
DEFINES += SW_VERSION_N4= |
|
|
13 | DEFINES += SW_VERSION_N3=1 # patch | |
|
14 | DEFINES += SW_VERSION_N4=0 # internal | |
|
15 | 15 | |
|
16 | 16 | contains( CONFIG, debug_tch ) { |
|
17 | 17 | DEFINES += DEBUG_TCH |
@@ -1,6 +1,6 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by QtCreator 3.0.1, 2014-0 |
|
|
3 | <!-- Written by QtCreator 3.0.1, 2014-07-15T16:01:49. --> | |
|
4 | 4 | <qtcreator> |
|
5 | 5 | <data> |
|
6 | 6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -442,65 +442,6 void send_dumb_hk( void ) | |||
|
442 | 442 | PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); |
|
443 | 443 | } |
|
444 | 444 | |
|
445 | void get_v_e1_e2_f3_old( unsigned char *spacecraft_potential ) | |
|
446 | { | |
|
447 | unsigned int coarseTime; | |
|
448 | unsigned int acquisitionTime; | |
|
449 | unsigned int deltaT = 0; | |
|
450 | unsigned char *bufferPtr; | |
|
451 | ||
|
452 | unsigned int offset_in_samples; | |
|
453 | unsigned int offset_in_bytes; | |
|
454 | unsigned char f3 = 16; // v, e1 and e2 will be picked up each second, f3 = 16 Hz | |
|
455 | ||
|
456 | if (lfrCurrentMode == LFR_MODE_STANDBY) | |
|
457 | { | |
|
458 | spacecraft_potential[0] = 0x00; | |
|
459 | spacecraft_potential[1] = 0x00; | |
|
460 | spacecraft_potential[2] = 0x00; | |
|
461 | spacecraft_potential[3] = 0x00; | |
|
462 | spacecraft_potential[4] = 0x00; | |
|
463 | spacecraft_potential[5] = 0x00; | |
|
464 | } | |
|
465 | else | |
|
466 | { | |
|
467 | coarseTime = time_management_regs->coarse_time & 0x7fffffff; | |
|
468 | bufferPtr = (unsigned char*) current_ring_node_f3->buffer_address; | |
|
469 | acquisitionTime = (unsigned int) ( ( bufferPtr[2] & 0x7f ) << 24 ) | |
|
470 | + (unsigned int) ( bufferPtr[3] << 16 ) | |
|
471 | + (unsigned int) ( bufferPtr[0] << 8 ) | |
|
472 | + (unsigned int) ( bufferPtr[1] ); | |
|
473 | if ( coarseTime > acquisitionTime ) | |
|
474 | { | |
|
475 | deltaT = coarseTime - acquisitionTime; | |
|
476 | offset_in_samples = (deltaT-1) * f3 ; | |
|
477 | } | |
|
478 | else if( coarseTime == acquisitionTime ) | |
|
479 | { | |
|
480 | bufferPtr = (unsigned char*) current_ring_node_f3->previous->buffer_address; // pick up v e1 and e2 in the previous f3 buffer | |
|
481 | offset_in_samples = NB_SAMPLES_PER_SNAPSHOT-1; | |
|
482 | } | |
|
483 | else | |
|
484 | { | |
|
485 | offset_in_samples = 0; | |
|
486 | PRINTF2("ERR *** in get_v_e1_e2_f3 *** coarseTime = %x, acquisitionTime = %x\n", coarseTime, acquisitionTime) | |
|
487 | } | |
|
488 | ||
|
489 | if ( offset_in_samples > (NB_SAMPLES_PER_SNAPSHOT - 1) ) | |
|
490 | { | |
|
491 | PRINTF1("ERR *** in get_v_e1_e2_f3 *** trying to read out of the buffer, counter = %d\n", offset_in_samples) | |
|
492 | offset_in_samples = NB_SAMPLES_PER_SNAPSHOT -1; | |
|
493 | } | |
|
494 | offset_in_bytes = TIME_OFFSET_IN_BYTES + offset_in_samples * NB_WORDS_SWF_BLK * 4; | |
|
495 | spacecraft_potential[0] = bufferPtr[ offset_in_bytes + 0]; | |
|
496 | spacecraft_potential[1] = bufferPtr[ offset_in_bytes + 1]; | |
|
497 | spacecraft_potential[2] = bufferPtr[ offset_in_bytes + 2]; | |
|
498 | spacecraft_potential[3] = bufferPtr[ offset_in_bytes + 3]; | |
|
499 | spacecraft_potential[4] = bufferPtr[ offset_in_bytes + 4]; | |
|
500 | spacecraft_potential[5] = bufferPtr[ offset_in_bytes + 5]; | |
|
501 | } | |
|
502 | } | |
|
503 | ||
|
504 | 445 | void get_v_e1_e2_f3( unsigned char *spacecraft_potential ) |
|
505 | 446 | { |
|
506 | 447 | unsigned int coarseTime; |
@@ -613,10 +613,10 unsigned long long int get_acquisition_t | |||
|
613 | 613 | acquisitionTimeAslong = 0x00; |
|
614 | 614 | acquisitionTimeAslong = ( (unsigned long long int) (timePtr[0] & 0x7f) << 40 ) // [0111 1111] mask the synchronization bit |
|
615 | 615 | + ( (unsigned long long int) timePtr[1] << 32 ) |
|
616 | + ( timePtr[2] << 24 ) | |
|
617 | + ( timePtr[3] << 16 ) | |
|
618 | + ( timePtr[6] << 8 ) | |
|
619 | + ( timePtr[7] ); | |
|
616 | + ( (unsigned long long int) timePtr[2] << 24 ) | |
|
617 | + ( (unsigned long long int) timePtr[3] << 16 ) | |
|
618 | + ( (unsigned long long int) timePtr[6] << 8 ) | |
|
619 | + ( (unsigned long long int) timePtr[7] ); | |
|
620 | 620 | return acquisitionTimeAslong; |
|
621 | 621 | } |
|
622 | 622 |
@@ -841,80 +841,6 int send_waveform_CWF3_light(volatile in | |||
|
841 | 841 | return ret; |
|
842 | 842 | } |
|
843 | 843 | |
|
844 | void compute_acquisition_time_old( unsigned int coarseTime, unsigned int fineTime, | |
|
845 | unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime ) | |
|
846 | { | |
|
847 | unsigned long long int acquisitionTimeAsLong; | |
|
848 | unsigned char localAcquisitionTime[6]; | |
|
849 | double deltaT; | |
|
850 | ||
|
851 | deltaT = 0.; | |
|
852 | ||
|
853 | localAcquisitionTime[0] = (unsigned char) ( coarseTime >> 8 ); | |
|
854 | localAcquisitionTime[1] = (unsigned char) ( coarseTime ); | |
|
855 | localAcquisitionTime[2] = (unsigned char) ( coarseTime >> 24 ); | |
|
856 | localAcquisitionTime[3] = (unsigned char) ( coarseTime >> 16 ); | |
|
857 | localAcquisitionTime[4] = (unsigned char) ( fineTime >> 24 ); | |
|
858 | localAcquisitionTime[5] = (unsigned char) ( fineTime >> 16 ); | |
|
859 | ||
|
860 | acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 ) | |
|
861 | + ( (unsigned long long int) localAcquisitionTime[1] << 32 ) | |
|
862 | + ( localAcquisitionTime[2] << 24 ) | |
|
863 | + ( localAcquisitionTime[3] << 16 ) | |
|
864 | + ( localAcquisitionTime[4] << 8 ) | |
|
865 | + ( localAcquisitionTime[5] ); | |
|
866 | ||
|
867 | switch( sid ) | |
|
868 | { | |
|
869 | case SID_NORM_SWF_F0: | |
|
870 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ; | |
|
871 | break; | |
|
872 | ||
|
873 | case SID_NORM_SWF_F1: | |
|
874 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ; | |
|
875 | break; | |
|
876 | ||
|
877 | case SID_NORM_SWF_F2: | |
|
878 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ; | |
|
879 | break; | |
|
880 | ||
|
881 | case SID_SBM1_CWF_F1: | |
|
882 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 4096. ; | |
|
883 | break; | |
|
884 | ||
|
885 | case SID_SBM2_CWF_F2: | |
|
886 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ; | |
|
887 | break; | |
|
888 | ||
|
889 | case SID_BURST_CWF_F2: | |
|
890 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ; | |
|
891 | break; | |
|
892 | ||
|
893 | case SID_NORM_CWF_F3: | |
|
894 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF_SHORT_F3 * 65536. / 16. ; | |
|
895 | break; | |
|
896 | ||
|
897 | case SID_NORM_CWF_LONG_F3: | |
|
898 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 16. ; | |
|
899 | break; | |
|
900 | ||
|
901 | default: | |
|
902 | PRINTF1("in compute_acquisition_time *** ERR unexpected sid %d", sid) | |
|
903 | deltaT = 0.; | |
|
904 | break; | |
|
905 | } | |
|
906 | ||
|
907 | acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT; | |
|
908 | // | |
|
909 | acquisitionTime[0] = (unsigned char) (acquisitionTimeAsLong >> 40); | |
|
910 | acquisitionTime[1] = (unsigned char) (acquisitionTimeAsLong >> 32); | |
|
911 | acquisitionTime[2] = (unsigned char) (acquisitionTimeAsLong >> 24); | |
|
912 | acquisitionTime[3] = (unsigned char) (acquisitionTimeAsLong >> 16); | |
|
913 | acquisitionTime[4] = (unsigned char) (acquisitionTimeAsLong >> 8 ); | |
|
914 | acquisitionTime[5] = (unsigned char) (acquisitionTimeAsLong ); | |
|
915 | ||
|
916 | } | |
|
917 | ||
|
918 | 844 | void compute_acquisition_time( unsigned int coarseTime, unsigned int fineTime, |
|
919 | 845 | unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime ) |
|
920 | 846 | { |
@@ -933,10 +859,10 void compute_acquisition_time( unsigned | |||
|
933 | 859 | |
|
934 | 860 | acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 ) |
|
935 | 861 | + ( (unsigned long long int) localAcquisitionTime[1] << 32 ) |
|
936 | + ( localAcquisitionTime[2] << 24 ) | |
|
937 | + ( localAcquisitionTime[3] << 16 ) | |
|
938 | + ( localAcquisitionTime[4] << 8 ) | |
|
939 | + ( localAcquisitionTime[5] ); | |
|
862 | + ( (unsigned long long int) localAcquisitionTime[2] << 24 ) | |
|
863 | + ( (unsigned long long int) localAcquisitionTime[3] << 16 ) | |
|
864 | + ( (unsigned long long int) localAcquisitionTime[4] << 8 ) | |
|
865 | + ( (unsigned long long int) localAcquisitionTime[5] ); | |
|
940 | 866 | |
|
941 | 867 | switch( sid ) |
|
942 | 868 | { |
@@ -1098,21 +1024,6 void build_snapshot_from_ring( ring_node | |||
|
1098 | 1024 | } |
|
1099 | 1025 | } |
|
1100 | 1026 | |
|
1101 | void build_acquisition_time_old( unsigned long long int *acquisitionTimeAslong, ring_node *current_ring_node ) | |
|
1102 | { | |
|
1103 | unsigned char *acquisitionTimeCharPtr; | |
|
1104 | ||
|
1105 | acquisitionTimeCharPtr = (unsigned char*) current_ring_node->buffer_address; | |
|
1106 | ||
|
1107 | *acquisitionTimeAslong = 0x00; | |
|
1108 | *acquisitionTimeAslong = ( acquisitionTimeCharPtr[0] << 24 ) | |
|
1109 | + ( acquisitionTimeCharPtr[1] << 16 ) | |
|
1110 | + ( (unsigned long long int) (acquisitionTimeCharPtr[2] & 0x7f) << 40 ) // [0111 1111] mask the synchronization bit | |
|
1111 | + ( (unsigned long long int) acquisitionTimeCharPtr[3] << 32 ) | |
|
1112 | + ( acquisitionTimeCharPtr[4] << 8 ) | |
|
1113 | + ( acquisitionTimeCharPtr[5] ); | |
|
1114 | } | |
|
1115 | ||
|
1116 | 1027 | void build_acquisition_time( unsigned long long int *acquisitionTimeAslong, ring_node *current_ring_node ) |
|
1117 | 1028 | { |
|
1118 | 1029 | unsigned char *acquisitionTimeCharPtr; |
@@ -1122,10 +1033,10 void build_acquisition_time( unsigned lo | |||
|
1122 | 1033 | *acquisitionTimeAslong = 0x00; |
|
1123 | 1034 | *acquisitionTimeAslong = ( (unsigned long long int) (acquisitionTimeCharPtr[0] & 0x7f) << 40 ) // [0111 1111] mask the synchronization bit |
|
1124 | 1035 | + ( (unsigned long long int) acquisitionTimeCharPtr[1] << 32 ) |
|
1125 | + ( acquisitionTimeCharPtr[2] << 24 ) | |
|
1126 | + ( acquisitionTimeCharPtr[3] << 16 ) | |
|
1127 | + ( acquisitionTimeCharPtr[6] << 8 ) | |
|
1128 | + ( acquisitionTimeCharPtr[7] ); | |
|
1036 | + ( (unsigned long long int) acquisitionTimeCharPtr[2] << 24 ) | |
|
1037 | + ( (unsigned long long int) acquisitionTimeCharPtr[3] << 16 ) | |
|
1038 | + ( (unsigned long long int) acquisitionTimeCharPtr[6] << 8 ) | |
|
1039 | + ( (unsigned long long int) acquisitionTimeCharPtr[7] ); | |
|
1129 | 1040 | } |
|
1130 | 1041 | |
|
1131 | 1042 | //************** |
General Comments 0
You need to be logged in to leave comments.
Login now