@@ -1,6 +1,6 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 |
# Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw-gsa | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Jun 18 14:00:55 2013 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
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 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 |
DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4= |
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=5 -DPRINT_MESSAGES_ON_CONSOLE -DGSA | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header | |
@@ -78,9 +78,9 DIST = /usr/lib64/qt4/mkspecs/c | |||||
78 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
78 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
79 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
79 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
80 | fsw-qt.pro |
|
80 | fsw-qt.pro | |
81 |
QMAKE_TARGET = fsw |
|
81 | QMAKE_TARGET = fsw-gsa | |
82 | DESTDIR = bin/ |
|
82 | DESTDIR = bin/ | |
83 |
TARGET = bin/fsw |
|
83 | TARGET = bin/fsw-gsa | |
84 |
|
84 | |||
85 | first: all |
|
85 | first: all | |
86 | ####### Implicit rules |
|
86 | ####### Implicit rules | |
@@ -159,8 +159,8 qmake: FORCE | |||||
159 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
159 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
160 |
|
160 | |||
161 | dist: |
|
161 | dist: | |
162 |
@$(CHK_DIR_EXISTS) obj/fsw |
|
162 | @$(CHK_DIR_EXISTS) obj/fsw-gsa1.0.0 || $(MKDIR) obj/fsw-gsa1.0.0 | |
163 |
$(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw |
|
163 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw-gsa1.0.0/ && (cd `dirname obj/fsw-gsa1.0.0` && $(TAR) fsw-gsa1.0.0.tar fsw-gsa1.0.0 && $(COMPRESS) fsw-gsa1.0.0.tar) && $(MOVE) `dirname obj/fsw-gsa1.0.0`/fsw-gsa1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw-gsa1.0.0 | |
164 |
|
164 | |||
165 |
|
165 | |||
166 | clean:compiler_clean |
|
166 | clean:compiler_clean |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -1,13 +1,13 | |||||
1 | TEMPLATE = app |
|
1 | TEMPLATE = app | |
2 | # CONFIG += console v8 sim |
|
2 | # CONFIG += console v8 sim | |
3 | # CONFIG options = verbose *** cpu_usage_report *** gsa |
|
3 | # CONFIG options = verbose *** cpu_usage_report *** gsa | |
4 | CONFIG += console verbose |
|
4 | CONFIG += console verbose gsa | |
5 | CONFIG -= qt |
|
5 | CONFIG -= qt | |
6 |
|
6 | |||
7 | include(./sparc.pri) |
|
7 | include(./sparc.pri) | |
8 |
|
8 | |||
9 | # flight software version |
|
9 | # flight software version | |
10 |
SW |
|
10 | SWVERSION=-0-5 | |
11 | DEFINES += SW_VERSION_N1=0 |
|
11 | DEFINES += SW_VERSION_N1=0 | |
12 | DEFINES += SW_VERSION_N2=0 |
|
12 | DEFINES += SW_VERSION_N2=0 | |
13 | DEFINES += SW_VERSION_N3=0 |
|
13 | DEFINES += SW_VERSION_N3=0 | |
@@ -21,10 +21,10 contains( CONFIG, cpu_usage_report ) { | |||||
21 | DEFINES += PRINT_TASK_STATISTICS |
|
21 | DEFINES += PRINT_TASK_STATISTICS | |
22 | } |
|
22 | } | |
23 |
|
23 | |||
24 |
TARGET = fsw |
|
24 | TARGET = fsw | |
25 | contains( CONFIG, gsa ) { |
|
25 | contains( CONFIG, gsa ) { | |
26 | DEFINES += GSA |
|
26 | DEFINES += GSA | |
27 |
TARGET = fsw-gsa |
|
27 | TARGET = fsw-gsa | |
28 | } |
|
28 | } | |
29 |
|
29 | |||
30 | INCLUDEPATH += \ |
|
30 | INCLUDEPATH += \ |
@@ -1,6 +1,6 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by Qt Creator 2.4.1, 2013-06-1 |
|
3 | <!-- Written by Qt Creator 2.4.1, 2013-06-18T14:38:28. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -58,7 +58,9 int send_tm_lfr_tc_exe_success(ccsdsTele | |||||
58 | // |
|
58 | // | |
59 | int stop_current_mode(); |
|
59 | int stop_current_mode(); | |
60 | int enter_normal_mode(); |
|
60 | int enter_normal_mode(); | |
|
61 | int enter_burst_mode(); | |||
61 | int enter_sbm1_mode(); |
|
62 | int enter_sbm1_mode(); | |
|
63 | int enter_sbm2_mode(); | |||
62 | int action_load_comm(ccsdsTelecommandPacket_t *TC); |
|
64 | int action_load_comm(ccsdsTelecommandPacket_t *TC); | |
63 | int action_load_norm(ccsdsTelecommandPacket_t *TC); |
|
65 | int action_load_norm(ccsdsTelecommandPacket_t *TC); | |
64 | int action_enter(ccsdsTelecommandPacket_t *TC); |
|
66 | int action_enter(ccsdsTelecommandPacket_t *TC); | |
@@ -67,9 +69,6 int action_updt_time(ccsdsTelecommandPac | |||||
67 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC); |
|
69 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC); | |
68 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC); |
|
70 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC); | |
69 | void close_action(ccsdsTelecommandPacket_t *TC, int result); |
|
71 | void close_action(ccsdsTelecommandPacket_t *TC, int result); | |
70 | // |
|
|||
71 | rtems_status_code restart_if_needed(rtems_id id); |
|
|||
72 | rtems_status_code suspend_if_needed(rtems_id id); |
|
|||
73 |
|
72 | |||
74 | #endif // TC_HANDLER_H_INCLUDED |
|
73 | #endif // TC_HANDLER_H_INCLUDED | |
75 |
|
74 |
@@ -20,11 +20,11 extern volatile int wf_snap_f0[ ]; | |||||
20 | extern volatile int wf_snap_f1[ ]; |
|
20 | extern volatile int wf_snap_f1[ ]; | |
21 | extern volatile int wf_snap_f1_bis[ ]; |
|
21 | extern volatile int wf_snap_f1_bis[ ]; | |
22 | extern volatile int wf_snap_f2[ ]; |
|
22 | extern volatile int wf_snap_f2[ ]; | |
|
23 | extern volatile int wf_snap_f2_bis[ ]; | |||
23 | extern volatile int wf_cont_f3[ ]; |
|
24 | extern volatile int wf_cont_f3[ ]; | |
24 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
25 | extern waveform_picker_regs_t *waveform_picker_regs; | |
25 |
|
26 | |||
26 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
|
27 | rtems_isr waveforms_isr( rtems_vector_number vector ); | |
27 | rtems_isr waveforms_isr_alternative( rtems_vector_number vector ); |
|
|||
28 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); |
|
28 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); | |
29 | rtems_task wfrm_task(rtems_task_argument argument); |
|
29 | rtems_task wfrm_task(rtems_task_argument argument); | |
30 |
|
30 |
@@ -22,6 +22,7 volatile int wf_snap_f0[ NB_SAMPLES_PER_ | |||||
22 | volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
22 | volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
23 | volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
23 | volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
24 | volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
24 | volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
|
25 | volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |||
25 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
26 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
26 |
|
27 | |||
27 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
28 | // SPECTRAL MATRICES GLOBAL VARIABLES |
@@ -71,9 +71,10 rtems_task Init( rtems_task_argument ign | |||||
71 | init_housekeeping_parameters(); |
|
71 | init_housekeeping_parameters(); | |
72 | create_message_queue(); |
|
72 | create_message_queue(); | |
73 |
|
73 | |||
74 | create_names(); |
|
74 | create_names(); // create all names | |
75 | create_all_tasks(); |
|
75 | create_all_tasks(); // create all tasks | |
76 | start_all_tasks(); |
|
76 | start_all_tasks(); // start all tasks | |
|
77 | stop_current_mode(); // go in STANDBY mode | |||
77 |
|
78 | |||
78 | grspw_timecode_callback = &timecode_irq_handler; |
|
79 | grspw_timecode_callback = &timecode_irq_handler; | |
79 |
|
80 |
@@ -497,7 +497,7 rtems_task actn_task( rtems_task_argumen | |||||
497 | { |
|
497 | { | |
498 | status = rtems_message_queue_receive(misc_id[0], (char*) &TC, &size, |
|
498 | status = rtems_message_queue_receive(misc_id[0], (char*) &TC, &size, | |
499 | RTEMS_WAIT, RTEMS_NO_TIMEOUT); |
|
499 | RTEMS_WAIT, RTEMS_NO_TIMEOUT); | |
500 | if (status!=RTEMS_SUCCESSFUL) PRINTF1("in task ACTN *** error receiving a message, code %d \n", status) |
|
500 | if (status!=RTEMS_SUCCESSFUL) PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status) | |
501 | else |
|
501 | else | |
502 | { |
|
502 | { | |
503 | subtype = TC.dataFieldHeader[2]; |
|
503 | subtype = TC.dataFieldHeader[2]; | |
@@ -538,6 +538,14 rtems_task actn_task( rtems_task_argumen | |||||
538 | break; |
|
538 | break; | |
539 | // |
|
539 | // | |
540 | case TC_SUBTYPE_ENTER: |
|
540 | case TC_SUBTYPE_ENTER: | |
|
541 | if ( (housekeeping_packet.lfr_status_word[0] & 0xf0) != LFR_MODE_STANDBY) | |||
|
542 | { | |||
|
543 | status = stop_current_mode(); | |||
|
544 | } | |||
|
545 | if (status != RTEMS_SUCCESSFUL) | |||
|
546 | { | |||
|
547 | PRINTF("ERR *** in task ACTN *** TC_SUBTYPE_ENTER *** stop_current_mode\n") | |||
|
548 | } | |||
541 | result = action_enter( &TC ); |
|
549 | result = action_enter( &TC ); | |
542 | close_action( &TC, result ); |
|
550 | close_action( &TC, result ); | |
543 | break; |
|
551 | break; | |
@@ -630,7 +638,7 int action_default(ccsdsTelecommandPacke | |||||
630 |
|
638 | |||
631 | int action_enter(ccsdsTelecommandPacket_t *TC) |
|
639 | int action_enter(ccsdsTelecommandPacket_t *TC) | |
632 | { |
|
640 | { | |
633 | rtems_status_code status; |
|
641 | rtems_status_code status = RTEMS_SUCCESSFUL; | |
634 | unsigned char lfr_mode = TC->dataAndCRC[1]; |
|
642 | unsigned char lfr_mode = TC->dataAndCRC[1]; | |
635 | printf("enter mode %d\n", lfr_mode); |
|
643 | printf("enter mode %d\n", lfr_mode); | |
636 | switch(lfr_mode) |
|
644 | switch(lfr_mode) | |
@@ -638,18 +646,12 int action_enter(ccsdsTelecommandPacket_ | |||||
638 | //******** |
|
646 | //******** | |
639 | // STANDBY |
|
647 | // STANDBY | |
640 | case(LFR_MODE_STANDBY): |
|
648 | case(LFR_MODE_STANDBY): | |
641 | status = stop_current_mode(); |
|
|||
642 | if (status != RTEMS_SUCCESSFUL) |
|
|||
643 | { |
|
|||
644 | PRINTF("in action_enter *** error going back to STANDBY mode\n") |
|
|||
645 | } |
|
|||
646 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_STANDBY << 4) + 0x0d); |
|
649 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_STANDBY << 4) + 0x0d); | |
647 | break; |
|
650 | break; | |
648 |
|
651 | |||
649 | //****** |
|
652 | //****** | |
650 | // NORMAL |
|
653 | // NORMAL | |
651 | case(LFR_MODE_NORMAL): |
|
654 | case(LFR_MODE_NORMAL): | |
652 | status = stop_current_mode(); |
|
|||
653 | status = enter_normal_mode(); |
|
655 | status = enter_normal_mode(); | |
654 | if (status == RTEMS_SUCCESSFUL) |
|
656 | if (status == RTEMS_SUCCESSFUL) | |
655 | { |
|
657 | { | |
@@ -660,7 +662,7 int action_enter(ccsdsTelecommandPacket_ | |||||
660 | //****** |
|
662 | //****** | |
661 | // BURST |
|
663 | // BURST | |
662 | case(LFR_MODE_BURST): |
|
664 | case(LFR_MODE_BURST): | |
663 |
status = |
|
665 | status = enter_burst_mode(); | |
664 | if (status == RTEMS_SUCCESSFUL) |
|
666 | if (status == RTEMS_SUCCESSFUL) | |
665 | { |
|
667 | { | |
666 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_BURST << 4) + 0x0d); |
|
668 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_BURST << 4) + 0x0d); | |
@@ -670,7 +672,6 int action_enter(ccsdsTelecommandPacket_ | |||||
670 | //***** |
|
672 | //***** | |
671 | // SBM1 |
|
673 | // SBM1 | |
672 | case(LFR_MODE_SBM1): |
|
674 | case(LFR_MODE_SBM1): | |
673 | status = stop_current_mode(); |
|
|||
674 | status = enter_sbm1_mode(); |
|
675 | status = enter_sbm1_mode(); | |
675 | if (status == RTEMS_SUCCESSFUL) |
|
676 | if (status == RTEMS_SUCCESSFUL) | |
676 | { |
|
677 | { | |
@@ -681,7 +682,7 int action_enter(ccsdsTelecommandPacket_ | |||||
681 | //***** |
|
682 | //***** | |
682 | // SBM2 |
|
683 | // SBM2 | |
683 | case(LFR_MODE_SBM2): |
|
684 | case(LFR_MODE_SBM2): | |
684 |
status = |
|
685 | status = enter_sbm2_mode(); | |
685 | if (status == RTEMS_SUCCESSFUL) |
|
686 | if (status == RTEMS_SUCCESSFUL) | |
686 | { |
|
687 | { | |
687 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_SBM2 << 4) + 0x0d); |
|
688 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_SBM2 << 4) + 0x0d); | |
@@ -691,11 +692,7 int action_enter(ccsdsTelecommandPacket_ | |||||
691 | //******** |
|
692 | //******** | |
692 | // DEFAULT |
|
693 | // DEFAULT | |
693 | default: |
|
694 | default: | |
694 | status = stop_current_mode(); |
|
|||
695 | if (status == RTEMS_SUCCESSFUL) |
|
|||
696 | { |
|
|||
697 |
|
|
695 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_STANDBY << 4) + 0x0d); | |
698 | } |
|
|||
699 | break; |
|
696 | break; | |
700 | } |
|
697 | } | |
701 | return status; |
|
698 | return status; | |
@@ -704,6 +701,7 int action_enter(ccsdsTelecommandPacket_ | |||||
704 | int stop_current_mode() |
|
701 | int stop_current_mode() | |
705 | { |
|
702 | { | |
706 | rtems_status_code status; |
|
703 | rtems_status_code status; | |
|
704 | ||||
707 | // mask all IRQ lines related to signal processing |
|
705 | // mask all IRQ lines related to signal processing | |
708 | LEON_Mask_interrupt( IRQ_WF ); // mask waveform interrupt (coming from the timer VHDL IP) |
|
706 | LEON_Mask_interrupt( IRQ_WF ); // mask waveform interrupt (coming from the timer VHDL IP) | |
709 | LEON_Mask_interrupt( IRQ_SM ); // mask spectral matrices interrupt (coming from the timer VHDL IP) |
|
707 | LEON_Mask_interrupt( IRQ_SM ); // mask spectral matrices interrupt (coming from the timer VHDL IP) | |
@@ -715,12 +713,18 int stop_current_mode() | |||||
715 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt |
|
713 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt | |
716 |
|
714 | |||
717 | // suspend several tasks |
|
715 | // suspend several tasks | |
718 | status = suspend_if_needed( Task_id[TASKID_AVF0] ); |
|
716 | ||
|
717 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); | |||
|
718 | if (status == RTEMS_SUCCESSFUL) { | |||
|
719 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); | |||
719 | if (status == RTEMS_SUCCESSFUL) { |
|
720 | if (status == RTEMS_SUCCESSFUL) { | |
720 |
status = suspend |
|
721 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); | |
721 | if (status == RTEMS_SUCCESSFUL) { |
|
722 | } | |
722 | status = suspend_if_needed( Task_id[TASKID_WFRM] ); |
|
|||
723 |
|
|
723 | } | |
|
724 | ||||
|
725 | if (status != RTEMS_SUCCESSFUL) | |||
|
726 | { | |||
|
727 | PRINTF("ERR *** in stop_current_mode *** suspending tasks\n") | |||
724 | } |
|
728 | } | |
725 |
|
729 | |||
726 | // initialize the registers |
|
730 | // initialize the registers | |
@@ -733,11 +737,11 int enter_normal_mode() | |||||
733 | { |
|
737 | { | |
734 | rtems_status_code status; |
|
738 | rtems_status_code status; | |
735 |
|
739 | |||
736 |
status = restart |
|
740 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |
737 | if (status == RTEMS_SUCCESSFUL) { |
|
741 | if (status == RTEMS_SUCCESSFUL) { | |
738 |
status = restart |
|
742 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |
739 | if (status == RTEMS_SUCCESSFUL) { |
|
743 | if (status == RTEMS_SUCCESSFUL) { | |
740 |
status = restart |
|
744 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |
741 | } |
|
745 | } | |
742 | } |
|
746 | } | |
743 |
|
747 | |||
@@ -755,14 +759,15 int enter_normal_mode() | |||||
755 | return status; |
|
759 | return status; | |
756 | } |
|
760 | } | |
757 |
|
761 | |||
758 |
int enter_ |
|
762 | int enter_burst_mode() | |
759 | { |
|
763 | { | |
760 | rtems_status_code status; |
|
764 | rtems_status_code status; | |
761 | status = restart_if_needed( Task_id[TASKID_AVF0] ); |
|
765 | ||
|
766 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |||
762 | if (status == RTEMS_SUCCESSFUL) { |
|
767 | if (status == RTEMS_SUCCESSFUL) { | |
763 |
status = restart |
|
768 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |
764 | if (status == RTEMS_SUCCESSFUL) { |
|
769 | if (status == RTEMS_SUCCESSFUL) { | |
765 |
status = restart |
|
770 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |
766 | } |
|
771 | } | |
767 | } |
|
772 | } | |
768 |
|
773 | |||
@@ -770,11 +775,65 int enter_sbm1_mode() | |||||
770 | #else |
|
775 | #else | |
771 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
776 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
772 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
777 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
|
778 | waveform_picker_regs->addr_data_f2 = (int) wf_snap_f2; | |||
|
779 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |||
|
780 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; | |||
|
781 | waveform_picker_regs->status = 0x00; | |||
|
782 | #endif | |||
|
783 | ||||
|
784 | LEON_Unmask_interrupt( IRQ_SM ); | |||
|
785 | return status; | |||
|
786 | } | |||
|
787 | ||||
|
788 | int enter_sbm1_mode() | |||
|
789 | { | |||
|
790 | rtems_status_code status; | |||
|
791 | ||||
|
792 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |||
|
793 | if (status == RTEMS_SUCCESSFUL) { | |||
|
794 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |||
|
795 | if (status == RTEMS_SUCCESSFUL) { | |||
|
796 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |||
|
797 | } | |||
|
798 | } | |||
|
799 | ||||
|
800 | #ifdef GSA | |||
|
801 | #else | |||
|
802 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |||
|
803 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |||
|
804 | waveform_picker_regs->addr_data_f1 = (int) wf_snap_f1; | |||
773 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] burst f2, f1, f0 enable f3 f2 f1 f0 |
|
805 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |
774 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x02; |
|
806 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x02; | |
775 | waveform_picker_regs->status = 0x00; |
|
807 | waveform_picker_regs->status = 0x00; | |
776 | #endif |
|
808 | #endif | |
777 | //LEON_Unmask_interrupt( IRQ_SM ); |
|
809 | ||
|
810 | LEON_Unmask_interrupt( IRQ_SM ); | |||
|
811 | return status; | |||
|
812 | } | |||
|
813 | ||||
|
814 | int enter_sbm2_mode() | |||
|
815 | { | |||
|
816 | rtems_status_code status; | |||
|
817 | ||||
|
818 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |||
|
819 | if (status == RTEMS_SUCCESSFUL) { | |||
|
820 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |||
|
821 | if (status == RTEMS_SUCCESSFUL) { | |||
|
822 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |||
|
823 | } | |||
|
824 | } | |||
|
825 | ||||
|
826 | #ifdef GSA | |||
|
827 | #else | |||
|
828 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |||
|
829 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |||
|
830 | waveform_picker_regs->addr_data_f2 = (int) wf_snap_f2; | |||
|
831 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |||
|
832 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; | |||
|
833 | waveform_picker_regs->status = 0x00; | |||
|
834 | #endif | |||
|
835 | ||||
|
836 | LEON_Unmask_interrupt( IRQ_SM ); | |||
778 | return status; |
|
837 | return status; | |
779 | } |
|
838 | } | |
780 |
|
839 | |||
@@ -835,38 +894,6 int send_tm_lfr_tc_exe_success(ccsdsTele | |||||
835 | return 0; |
|
894 | return 0; | |
836 | } |
|
895 | } | |
837 |
|
896 | |||
838 | rtems_status_code restart_if_needed(rtems_id id) |
|
|||
839 | { |
|
|||
840 | rtems_status_code status; |
|
|||
841 |
|
||||
842 | status = rtems_task_is_suspended( id ); |
|
|||
843 |
|
||||
844 | if (status==RTEMS_SUCCESSFUL) { |
|
|||
845 | status = rtems_task_restart( id, 0 ); |
|
|||
846 | if (status!=RTEMS_SUCCESSFUL) { |
|
|||
847 | PRINTF1("in restart_if_needed *** Error restarting with id %d\n", (int) id) |
|
|||
848 | } |
|
|||
849 | } |
|
|||
850 |
|
||||
851 | return status; |
|
|||
852 | } |
|
|||
853 |
|
||||
854 | rtems_status_code suspend_if_needed(rtems_id id) |
|
|||
855 | { |
|
|||
856 | rtems_status_code status; |
|
|||
857 |
|
||||
858 | status = rtems_task_is_suspended( id ); |
|
|||
859 |
|
||||
860 | if (status!=RTEMS_SUCCESSFUL) { |
|
|||
861 | status = rtems_task_suspend( id ); |
|
|||
862 | if (status!=RTEMS_SUCCESSFUL) { |
|
|||
863 | PRINTF1("in suspend_if_needed *** Error suspending task with id %d\n", (int) id) |
|
|||
864 | } |
|
|||
865 | } |
|
|||
866 |
|
||||
867 | return status; |
|
|||
868 | } |
|
|||
869 |
|
||||
870 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC) |
|
897 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC) | |
871 | { |
|
898 | { | |
872 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; |
|
899 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; |
@@ -1,34 +1,5 | |||||
1 | #include <wf_handler.h> |
|
1 | #include <wf_handler.h> | |
2 |
|
2 | |||
3 | rtems_isr waveforms_isr_alternative( rtems_vector_number vector ) |
|
|||
4 | { |
|
|||
5 | if (waveform_picker_regs->burst_enable == 0x22) { |
|
|||
6 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { |
|
|||
7 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); |
|
|||
8 | } |
|
|||
9 | else { |
|
|||
10 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); |
|
|||
11 | } |
|
|||
12 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { |
|
|||
13 | //rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
|||
14 | } |
|
|||
15 | } |
|
|||
16 | waveform_picker_regs->status = 0x00; |
|
|||
17 | /*else if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){// if no channel is enable |
|
|||
18 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { |
|
|||
19 | printf("In timecode_irq_handler *** Error sending event to DUMB\n"); |
|
|||
20 | } |
|
|||
21 | } |
|
|||
22 | else { |
|
|||
23 | if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full |
|
|||
24 | waveform_picker_regs->burst_enable = 0x00; |
|
|||
25 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
|||
26 | printf("In waveforms_isr *** Error sending event to WFRM\n"); |
|
|||
27 | } |
|
|||
28 | } |
|
|||
29 | }*/ |
|
|||
30 | } |
|
|||
31 |
|
||||
32 | rtems_isr waveforms_isr( rtems_vector_number vector ) |
|
3 | rtems_isr waveforms_isr( rtems_vector_number vector ) | |
33 | { |
|
4 | { | |
34 | unsigned char lfrMode; |
|
5 | unsigned char lfrMode; | |
@@ -95,6 +66,23 rtems_isr waveforms_isr( rtems_vector_nu | |||||
95 | //***** |
|
66 | //***** | |
96 | // SBM2 |
|
67 | // SBM2 | |
97 | case(LFR_MODE_SBM2): |
|
68 | case(LFR_MODE_SBM2): | |
|
69 | #ifdef GSA | |||
|
70 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") | |||
|
71 | #else | |||
|
72 | if (waveform_picker_regs->burst_enable == 0x44) { | |||
|
73 | if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |||
|
74 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis); | |||
|
75 | } | |||
|
76 | else { | |||
|
77 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); | |||
|
78 | } | |||
|
79 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |||
|
80 | PRINTF("in waveforms_isr *** Error sending event to WFRM\n") | |||
|
81 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |||
|
82 | } | |||
|
83 | } | |||
|
84 | waveform_picker_regs->status = 0x00; | |||
|
85 | #endif | |||
98 | break; |
|
86 | break; | |
99 |
|
87 | |||
100 | //******** |
|
88 | //******** | |
@@ -106,8 +94,43 rtems_isr waveforms_isr( rtems_vector_nu | |||||
106 |
|
94 | |||
107 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ) |
|
95 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ) | |
108 | { |
|
96 | { | |
109 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
97 | unsigned char lfrMode; | |
110 | printf("In waveforms_isr *** Error sending event to WFRM\n"); |
|
98 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
|
99 | ||||
|
100 | switch(lfrMode) | |||
|
101 | { | |||
|
102 | //******** | |||
|
103 | // STANDBY | |||
|
104 | case(LFR_MODE_STANDBY): | |||
|
105 | break; | |||
|
106 | ||||
|
107 | //****** | |||
|
108 | // NORMAL | |||
|
109 | case(LFR_MODE_NORMAL): | |||
|
110 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |||
|
111 | PRINTF("ERR *** in waveforms_isr *** error sending event to WFRM\n"); | |||
|
112 | } | |||
|
113 | break; | |||
|
114 | ||||
|
115 | //****** | |||
|
116 | // BURST | |||
|
117 | case(LFR_MODE_BURST): | |||
|
118 | break; | |||
|
119 | ||||
|
120 | //***** | |||
|
121 | // SBM1 | |||
|
122 | case(LFR_MODE_SBM1): | |||
|
123 | break; | |||
|
124 | ||||
|
125 | //***** | |||
|
126 | // SBM2 | |||
|
127 | case(LFR_MODE_SBM2): | |||
|
128 | break; | |||
|
129 | ||||
|
130 | //******** | |||
|
131 | // DEFAULT | |||
|
132 | default: | |||
|
133 | break; | |||
111 | } |
|
134 | } | |
112 | } |
|
135 | } | |
113 |
|
136 | |||
@@ -197,6 +220,21 rtems_task wfrm_task(rtems_task_argument | |||||
197 | send_waveform( &header, wf_snap_f1, SID_NORM_SWF_F1, &spw_ioctl_send); |
|
220 | send_waveform( &header, wf_snap_f1, SID_NORM_SWF_F1, &spw_ioctl_send); | |
198 | } |
|
221 | } | |
199 | break; |
|
222 | break; | |
|
223 | ||||
|
224 | //***** | |||
|
225 | // SBM2 | |||
|
226 | case(RTEMS_EVENT_MODE_SBM2): | |||
|
227 | // F2 | |||
|
228 | if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |||
|
229 | send_waveform( &header, wf_snap_f2_bis, SID_NORM_SWF_F2, &spw_ioctl_send); | |||
|
230 | } | |||
|
231 | else { | |||
|
232 | send_waveform( &header, wf_snap_f2, SID_NORM_SWF_F2, &spw_ioctl_send); | |||
|
233 | } | |||
|
234 | break; | |||
|
235 | ||||
|
236 | //******** | |||
|
237 | // DEFAULT | |||
200 | default: |
|
238 | default: | |
201 | break; |
|
239 | break; | |
202 | } |
|
240 | } |
General Comments 0
You need to be logged in to leave comments.
Login now