##// END OF EJS Templates
enter_mode removed...
paul -
r237:b287f3b429dd R3
parent child
Show More
@@ -2,7 +2,7 TEMPLATE = app
2 # CONFIG += console v8 sim
2 # CONFIG += console v8 sim
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch
4 # lpp_dpu_destid
4 # lpp_dpu_destid
5 CONFIG += console verbose lpp_dpu_destid cpu_usage_report
5 CONFIG += console verbose lpp_dpu_destid cpu_usage_report stack_report
6 CONFIG -= qt
6 CONFIG -= qt
7
7
8 include(./sparc.pri)
8 include(./sparc.pri)
@@ -38,7 +38,7 QMAKE_CFLAGS_RELEASE =
38 QMAKE_CFLAGS_YACC =
38 QMAKE_CFLAGS_YACC =
39 QMAKE_LFLAGS_EXCEPTIONS_ON =
39 QMAKE_LFLAGS_EXCEPTIONS_ON =
40 QMAKE_LFLAGS_EXCEPTIONS_OFF =
40 QMAKE_LFLAGS_EXCEPTIONS_OFF =
41 QMAKE_LFLAGS_RELEASE =
41 QMAKE_LFLAGS_RELEASE = -Xlinker -Map=output.map
42 QMAKE_LFLAGS_CONSOLE =
42 QMAKE_LFLAGS_CONSOLE =
43 QMAKE_LFLAGS_WINDOWS =
43 QMAKE_LFLAGS_WINDOWS =
44 QMAKE_LFLAGS_DLL =
44 QMAKE_LFLAGS_DLL =
@@ -35,7 +35,11 int check_mode_value( unsigned char requ
35 int check_mode_transition( unsigned char requestedMode );
35 int check_mode_transition( unsigned char requestedMode );
36 int check_transition_date( unsigned int transitionCoarseTime );
36 int check_transition_date( unsigned int transitionCoarseTime );
37 int stop_current_mode( void );
37 int stop_current_mode( void );
38 int enter_mode( unsigned char mode , unsigned int transitionCoarseTime );
38 int enter_mode_standby( void );
39 int enter_mode_normal( unsigned int transitionCoarseTime );
40 int enter_mode_burst( unsigned int transitionCoarseTime );
41 int enter_mode_sbm1( unsigned int transitionCoarseTime );
42 int enter_mode_sbm2( unsigned int transitionCoarseTime );
39 int restart_science_tasks( unsigned char lfrRequestedMode );
43 int restart_science_tasks( unsigned char lfrRequestedMode );
40 int suspend_science_tasks();
44 int suspend_science_tasks();
41 void launch_waveform_picker( unsigned char mode , unsigned int transitionCoarseTime );
45 void launch_waveform_picker( unsigned char mode , unsigned int transitionCoarseTime );
@@ -89,7 +89,7 rtems_task spiq_task(rtems_task_argument
89 }
89 }
90 else // [3.b] the link is not in run state, go in STANDBY mode
90 else // [3.b] the link is not in run state, go in STANDBY mode
91 {
91 {
92 status = enter_mode( LFR_MODE_STANDBY, 0 );
92 status = enter_mode_standby();
93 if ( status != RTEMS_SUCCESSFUL ) {
93 if ( status != RTEMS_SUCCESSFUL ) {
94 PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status)
94 PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status)
95 }
95 }
@@ -204,7 +204,27 int action_enter_mode(ccsdsTelecommandPa
204 if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode
204 if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode
205 {
205 {
206 PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode);
206 PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode);
207 status = enter_mode( requestedMode, transitionCoarseTime );
207
208 switch(requestedMode)
209 {
210 case LFR_MODE_STANDBY:
211 status = enter_mode_standby();
212 break;
213 case LFR_MODE_NORMAL:
214 status = enter_mode_normal( transitionCoarseTime );
215 break;
216 case LFR_MODE_BURST:
217 status = enter_mode_burst( transitionCoarseTime );
218 break;
219 case LFR_MODE_SBM1:
220 status = enter_mode_sbm1( transitionCoarseTime );
221 break;
222 case LFR_MODE_SBM2:
223 status = enter_mode_sbm2( transitionCoarseTime );
224 break;
225 default:
226 break;
227 }
208 }
228 }
209
229
210 return status;
230 return status;
@@ -514,47 +534,12 int stop_current_mode( void )
514 return status;
534 return status;
515 }
535 }
516
536
517 int enter_mode( unsigned char mode, unsigned int transitionCoarseTime )
537 int enter_mode_standby()
518 {
519 /** This function is launched after a mode transition validation.
520 *
521 * @param mode is the mode in which LFR will be put.
522 *
523 * @return RTEMS directive status codes:
524 * - RTEMS_SUCCESSFUL - the mode has been entered successfully
525 * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully
526 *
527 */
528
529 rtems_status_code status;
530
531 //**********************
532 // STOP THE CURRENT MODE
533 status = stop_current_mode();
534 if (status != RTEMS_SUCCESSFUL)
535 {
538 {
536 PRINTF1("ERR *** in enter_mode *** stop_current_mode with mode = %d\n", mode)
539 int status;
537 }
538
540
539 //*************************
541 status = stop_current_mode(); // STOP THE CURRENT MODE
540 // ENTER THE REQUESTED MODE
542
541 if (status == RTEMS_SUCCESSFUL) // if the current mode has been successfully stopped
542 {
543 if ( (mode == LFR_MODE_NORMAL) || (mode == LFR_MODE_BURST)
544 || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2) )
545 {
546 #ifdef PRINT_TASK_STATISTICS
547 rtems_cpu_usage_reset();
548 #endif
549 status = restart_science_tasks( mode );
550 if (status == RTEMS_SUCCESSFUL)
551 {
552 launch_spectral_matrix( );
553 launch_waveform_picker( mode, transitionCoarseTime );
554 }
555 }
556 else if ( mode == LFR_MODE_STANDBY )
557 {
558 #ifdef PRINT_TASK_STATISTICS
543 #ifdef PRINT_TASK_STATISTICS
559 rtems_cpu_usage_report();
544 rtems_cpu_usage_report();
560 #endif
545 #endif
@@ -563,16 +548,173 int enter_mode( unsigned char mode, unsi
563 PRINTF("stack report selected\n")
548 PRINTF("stack report selected\n")
564 rtems_stack_checker_report_usage();
549 rtems_stack_checker_report_usage();
565 #endif
550 #endif
551
552 return status;
566 }
553 }
567 else
554
555 int enter_mode_normal( unsigned int transitionCoarseTime )
556 {
557 int status;
558
559 #ifdef PRINT_TASK_STATISTICS
560 rtems_cpu_usage_reset();
561 #endif
562
563 status = RTEMS_UNSATISFIED;
564
565 switch( lfrCurrentMode )
566 {
567 case LFR_MODE_STANDBY:
568 status = restart_science_tasks( LFR_MODE_NORMAL ); // restart science tasks
569 if (status == RTEMS_SUCCESSFUL) // relaunch spectral_matrix and waveform_picker modules
568 {
570 {
571 launch_spectral_matrix( );
572 launch_waveform_picker( LFR_MODE_NORMAL, transitionCoarseTime );
573 }
574 break;
575 case LFR_MODE_BURST:
576 status = stop_current_mode(); // stop the current mode
577 status = restart_science_tasks( LFR_MODE_NORMAL ); // restart the science tasks
578 if (status == RTEMS_SUCCESSFUL) // relaunch spectral_matrix and waveform_picker modules
579 {
580 launch_spectral_matrix( );
581 launch_waveform_picker( LFR_MODE_NORMAL, transitionCoarseTime );
582 }
583 break;
584 case LFR_MODE_SBM1:
585 status = LFR_SUCCESSFUL; // lfrCurrentMode will be updated after the execution of close_action
586 break;
587 case LFR_MODE_SBM2:
588 status = LFR_SUCCESSFUL; // lfrCurrentMode will be updated after the execution of close_action
589 break;
590 default:
591 break;
592 }
593
594 if (status != RTEMS_SUCCESSFUL)
595 {
596 PRINTF1("ERR *** in enter_mode_normal *** status = %d\n", status)
569 status = RTEMS_UNSATISFIED;
597 status = RTEMS_UNSATISFIED;
570 }
598 }
599
600 return status;
601 }
602
603 int enter_mode_burst( unsigned int transitionCoarseTime )
604 {
605 int status;
606
607 #ifdef PRINT_TASK_STATISTICS
608 rtems_cpu_usage_reset();
609 #endif
610
611 status = stop_current_mode(); // stop the current mode
612 status = restart_science_tasks( LFR_MODE_BURST ); // restart the science tasks
613 if (status == RTEMS_SUCCESSFUL) // relaunch spectral_matrix and waveform_picker modules
614 {
615 launch_spectral_matrix( );
616 launch_waveform_picker( LFR_MODE_BURST, transitionCoarseTime );
571 }
617 }
572
618
573 if (status != RTEMS_SUCCESSFUL)
619 if (status != RTEMS_SUCCESSFUL)
574 {
620 {
575 PRINTF1("ERR *** in enter_mode *** status = %d\n", status)
621 PRINTF1("ERR *** in enter_mode_burst *** status = %d\n", status)
622 status = RTEMS_UNSATISFIED;
623 }
624
625 return status;
626 }
627
628 int enter_mode_sbm1( unsigned int transitionCoarseTime )
629 {
630 int status;
631
632 #ifdef PRINT_TASK_STATISTICS
633 rtems_cpu_usage_reset();
634 #endif
635
636 status = RTEMS_UNSATISFIED;
637
638 switch( lfrCurrentMode )
639 {
640 case LFR_MODE_STANDBY:
641 status = restart_science_tasks( LFR_MODE_SBM1 ); // restart science tasks
642 if (status == RTEMS_SUCCESSFUL) // relaunch spectral_matrix and waveform_picker modules
643 {
644 launch_spectral_matrix( );
645 launch_waveform_picker( LFR_MODE_SBM1, transitionCoarseTime );
646 }
647 break;
648 case LFR_MODE_NORMAL: // lfrCurrentMode will be updated after the execution of close_action
649 status = LFR_SUCCESSFUL;
650 break;
651 case LFR_MODE_BURST:
652 status = stop_current_mode(); // stop the current mode
653 status = restart_science_tasks( LFR_MODE_SBM1 ); // restart the science tasks
654 if (status == RTEMS_SUCCESSFUL) // relaunch spectral_matrix and waveform_picker modules
655 {
656 launch_spectral_matrix( );
657 launch_waveform_picker( LFR_MODE_SBM1, transitionCoarseTime );
658 }
659 break;
660 case LFR_MODE_SBM2:
661 status = LFR_SUCCESSFUL; // lfrCurrentMode will be updated after the execution of close_action
662 break;
663 default:
664 break;
665 }
666
667 if (status != RTEMS_SUCCESSFUL)
668 {
669 PRINTF1("ERR *** in enter_mode_sbm1 *** status = %d\n", status)
670 status = RTEMS_UNSATISFIED;
671 }
672
673 return status;
674 }
675
676 int enter_mode_sbm2( unsigned int transitionCoarseTime )
677 {
678 int status;
679
680 #ifdef PRINT_TASK_STATISTICS
681 rtems_cpu_usage_reset();
682 #endif
683
684 status = RTEMS_UNSATISFIED;
685
686 switch( lfrCurrentMode )
687 {
688 case LFR_MODE_STANDBY:
689 status = restart_science_tasks( LFR_MODE_SBM2 ); // restart science tasks
690 if (status == RTEMS_SUCCESSFUL) // relaunch spectral_matrix and waveform_picker modules
691 {
692 launch_spectral_matrix( );
693 launch_waveform_picker( LFR_MODE_SBM2, transitionCoarseTime );
694 }
695 break;
696 case LFR_MODE_NORMAL:
697 status = LFR_SUCCESSFUL; // lfrCurrentMode will be updated after the execution of close_action
698 break;
699 case LFR_MODE_BURST:
700 status = stop_current_mode(); // stop the current mode
701 status = restart_science_tasks( LFR_MODE_SBM2 ); // restart the science tasks
702 if (status == RTEMS_SUCCESSFUL) // relaunch spectral_matrix and waveform_picker modules
703 {
704 launch_spectral_matrix( );
705 launch_waveform_picker( LFR_MODE_SBM2, transitionCoarseTime );
706 }
707 break;
708 case LFR_MODE_SBM1:
709 status = LFR_SUCCESSFUL; // lfrCurrentMode will be updated after the execution of close_action
710 break;
711 default:
712 break;
713 }
714
715 if (status != RTEMS_SUCCESSFUL)
716 {
717 PRINTF1("ERR *** in enter_mode_sbm2 *** status = %d\n", status)
576 status = RTEMS_UNSATISFIED;
718 status = RTEMS_UNSATISFIED;
577 }
719 }
578
720
@@ -1212,12 +1212,11 void set_wfp_burst_enable_register( unsi
1212 // the burst bits shall be set first, before the enable bits
1212 // the burst bits shall be set first, before the enable bits
1213 switch(mode) {
1213 switch(mode) {
1214 case(LFR_MODE_NORMAL):
1214 case(LFR_MODE_NORMAL):
1215 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1215 waveform_picker_regs->run_burst_enable = 0x60; // [0110 0000] enable f2 AND f1 burst
1216 waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1216 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0c; // [1111] enable f3 f2 f1 f0
1217 break;
1217 break;
1218 case(LFR_MODE_BURST):
1218 case(LFR_MODE_BURST):
1219 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1219 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1220 // waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1221 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0c; // [1100] enable f3 AND f2
1220 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0c; // [1100] enable f3 AND f2
1222 break;
1221 break;
1223 case(LFR_MODE_SBM1):
1222 case(LFR_MODE_SBM1):
General Comments 0
You need to be logged in to leave comments. Login now