##// END OF EJS Templates
a wrong date implies the generation of a TM_LFR_TC_EXE_NOT_EXECUTABLE...
paul -
r254:aca3cbff85cc R3a
parent child
Show More
@@ -1,2 +1,2
1 1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 084fd0db5e4139a1096789935e32ef498192f395 header/lfr_common_headers
2 80d727bb9d808ae67c801c4c6101811d68b94af6 header/lfr_common_headers
@@ -22,7 +22,7 extern rtems_id timecode_timer_id;
22 22 rtems_task spiq_task( rtems_task_argument argument );
23 23 rtems_task recv_task( rtems_task_argument unused );
24 24 rtems_task send_task( rtems_task_argument argument );
25 rtems_task wtdg_task( rtems_task_argument argument );
25 rtems_task link_task( rtems_task_argument argument );
26 26
27 27 int spacewire_open_link( void );
28 28 int spacewire_start_link( int fd );
@@ -39,7 +39,7 void update_last_valid_transition_date(
39 39 int check_transition_date( unsigned int transitionCoarseTime );
40 40 int stop_spectral_matrices( void );
41 41 int stop_current_mode( void );
42 int enter_mode_standby( void );
42 int enter_mode_standby(void );
43 43 int enter_mode_normal( unsigned int transitionCoarseTime );
44 44 int enter_mode_burst( unsigned int transitionCoarseTime );
45 45 int enter_mode_sbm1( unsigned int transitionCoarseTime );
@@ -54,7 +54,7 void set_sm_irq_onNewMatrix( unsigned ch
54 54 void set_sm_irq_onError( unsigned char value );
55 55
56 56 // other functions
57 void updateLFRCurrentMode();
57 void updateLFRCurrentMode(unsigned char requestedMode);
58 58 void set_lfr_soft_reset( unsigned char value );
59 59 void reset_lfr( void );
60 60 // CALIBRATION
@@ -35,7 +35,7
35 35 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
36 36 #define CONFIGURE_MAXIMUM_DRIVERS 16
37 37 #define CONFIGURE_MAXIMUM_PERIODS 5
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // [spiq] [wtdg] [spacewire_reset_link]
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // [spiq] [link] [spacewire_reset_link]
39 39 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
40 40 #ifdef PRINT_STACK_REPORT
41 41 #define CONFIGURE_STACK_CHECKER_ENABLED
@@ -172,7 +172,7 rtems_task Init( rtems_task_argument ign
172 172 // configure calibration
173 173 configureCalibration( false ); // true means interleaved mode, false is for normal mode
174 174
175 updateLFRCurrentMode();
175 updateLFRCurrentMode( LFR_MODE_STANDBY );
176 176
177 177 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
178 178
@@ -327,7 +327,7 void create_names( void ) // create all
327 327 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
328 328 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
329 329 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
330 Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' );
330 Task_name[TASKID_LINK] = rtems_build_name( 'L', 'I', 'N', 'K' );
331 331 Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' );
332 332 Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' );
333 333 Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' );
@@ -379,12 +379,12 int create_all_tasks( void ) // create a
379 379 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SEND]
380 380 );
381 381 }
382 if (status == RTEMS_SUCCESSFUL) // WTDG
382 if (status == RTEMS_SUCCESSFUL) // LINK
383 383 {
384 384 status = rtems_task_create(
385 Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE,
385 Task_name[TASKID_LINK], TASK_PRIORITY_LINK, RTEMS_MINIMUM_STACK_SIZE,
386 386 RTEMS_DEFAULT_MODES,
387 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG]
387 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_LINK]
388 388 );
389 389 }
390 390 if (status == RTEMS_SUCCESSFUL) // ACTN
@@ -571,11 +571,11 int start_all_tasks( void ) // start all
571 571 BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n")
572 572 }
573 573
574 if (status == RTEMS_SUCCESSFUL) // WTDG
574 if (status == RTEMS_SUCCESSFUL) // LINK
575 575 {
576 status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 );
576 status = rtems_task_start( Task_id[TASKID_LINK], link_task, 1 );
577 577 if (status!=RTEMS_SUCCESSFUL) {
578 BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n")
578 BOOT_PRINTF("in INIT *** Error starting TASK_LINK\n")
579 579 }
580 580 }
581 581
@@ -97,8 +97,11 rtems_task spiq_task(rtems_task_argument
97 97 {
98 98 PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status)
99 99 }
100 // wake the WTDG task up to wait for the link recovery
101 status = rtems_event_send ( Task_id[TASKID_WTDG], RTEMS_EVENT_0 );
100 {
101 updateLFRCurrentMode( LFR_MODE_STANDBY );
102 }
103 // wake the LINK task up to wait for the link recovery
104 status = rtems_event_send ( Task_id[TASKID_LINK], RTEMS_EVENT_0 );
102 105 status = rtems_task_suspend( RTEMS_SELF );
103 106 }
104 107 }
@@ -327,20 +330,20 rtems_task send_task( rtems_task_argumen
327 330 }
328 331 }
329 332
330 rtems_task wtdg_task( rtems_task_argument argument )
333 rtems_task link_task( rtems_task_argument argument )
331 334 {
332 335 rtems_event_set event_out;
333 336 rtems_status_code status;
334 337 int linkStatus;
335 338
336 BOOT_PRINTF("in WTDG ***\n")
339 BOOT_PRINTF("in LINK ***\n")
337 340
338 341 while(1)
339 342 {
340 343 // wait for an RTEMS_EVENT
341 344 rtems_event_receive( RTEMS_EVENT_0,
342 345 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
343 PRINTF("in WTDG *** wait for the link\n")
346 PRINTF("in LINK *** wait for the link\n")
344 347 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status
345 348 while( linkStatus != 5) // wait for the link
346 349 {
@@ -352,11 +355,11 rtems_task wtdg_task( rtems_task_argumen
352 355
353 356 if (status != RTEMS_SUCCESSFUL)
354 357 {
355 PRINTF1("in WTDG *** ERR link not started %d\n", status)
358 PRINTF1("in LINK *** ERR link not started %d\n", status)
356 359 }
357 360 else
358 361 {
359 PRINTF("in WTDG *** OK link started\n")
362 PRINTF("in LINK *** OK link started\n")
360 363 }
361 364
362 365 // restart the SPIQ task
@@ -195,10 +195,8 int action_enter_mode(ccsdsTelecommandPa
195 195 status = check_transition_date( transitionCoarseTime );
196 196 if (status != LFR_SUCCESSFUL)
197 197 {
198 PRINTF("ERR *** in action_enter_mode *** check_transition_date\n")
199 send_tm_lfr_tc_exe_inconsistent( TC, queue_id,
200 BYTE_POS_CP_LFR_ENTER_MODE_TIME,
201 bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME + 3 ] );
198 PRINTF("ERR *** in action_enter_mode *** check_transition_date\n");
199 send_tm_lfr_tc_exe_not_executable(TC, queue_id );
202 200 }
203 201 }
204 202
@@ -588,7 +586,7 int stop_current_mode( void )
588 586 return status;
589 587 }
590 588
591 int enter_mode_standby()
589 int enter_mode_standby( void )
592 590 {
593 591 /** This function is used to put LFR in the STANDBY mode.
594 592 *
@@ -1546,8 +1544,7 void close_action(ccsdsTelecommandPacket
1546 1544 //**********************************
1547 1545 // UPDATE THE LFRMODE LOCAL VARIABLE
1548 1546 requestedMode = TC->dataAndCRC[1];
1549 housekeeping_packet.lfr_status_word[0] = (unsigned char) ((requestedMode << 4) + 0x0d);
1550 updateLFRCurrentMode();
1547 updateLFRCurrentMode( requestedMode );
1551 1548 }
1552 1549 }
1553 1550 else if (result == LFR_EXE_ERROR)
@@ -1574,15 +1571,17 rtems_isr commutation_isr2( rtems_vector
1574 1571
1575 1572 //****************
1576 1573 // OTHER FUNCTIONS
1577 void updateLFRCurrentMode()
1574 void updateLFRCurrentMode( unsigned char requestedMode )
1578 1575 {
1579 1576 /** This function updates the value of the global variable lfrCurrentMode.
1580 1577 *
1581 1578 * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running.
1582 1579 *
1583 1580 */
1581
1584 1582 // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure
1585 lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
1583 housekeeping_packet.lfr_status_word[0] = (unsigned char) ((requestedMode << 4) + 0x0d);
1584 lfrCurrentMode = requestedMode;
1586 1585 }
1587 1586
1588 1587 void set_lfr_soft_reset( unsigned char value )
General Comments 0
You need to be logged in to leave comments. Login now