##// END OF EJS Templates
sy_lfr_watchdog_enabled handled...
paul -
r262:e2f22269a98c R3a
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 ad7698268954c5d3d203a3b3ad09fcdf2d536472 header/lfr_common_headers
2 fa4fff498e7a3208f9f7ba469d6e25c84fe6ad71 header/lfr_common_headers
@@ -39,6 +39,7 void timer_set_clock_divider(unsigned ch
39 rtems_isr watchdog_isr( rtems_vector_number vector );
39 rtems_isr watchdog_isr( rtems_vector_number vector );
40 void watchdog_configure(void);
40 void watchdog_configure(void);
41 void watchdog_stop(void);
41 void watchdog_stop(void);
42 void watchdog_reload(void);
42 void watchdog_start(void);
43 void watchdog_start(void);
43
44
44 // SERIAL LINK
45 // SERIAL LINK
@@ -61,6 +62,7 void get_v_e1_e2_f3( unsigned char *spac
61 void get_cpu_load( unsigned char *resource_statistics );
62 void get_cpu_load( unsigned char *resource_statistics );
62 void set_hk_lfr_sc_potential_flag( bool state );
63 void set_hk_lfr_sc_potential_flag( bool state );
63 void set_hk_lfr_mag_fields_flag( bool state );
64 void set_hk_lfr_mag_fields_flag( bool state );
65 void set_sy_lfr_watchdog_enabled( bool state );
64 void set_hk_lfr_calib_enable( bool state );
66 void set_hk_lfr_calib_enable( bool state );
65 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
67 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
66 void hk_lfr_le_me_he_update();
68 void hk_lfr_le_me_he_update();
@@ -86,6 +86,10 rtems_isr watchdog_isr( rtems_vector_num
86 rtems_status_code status_code;
86 rtems_status_code status_code;
87
87
88 status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_12 );
88 status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_12 );
89
90 PRINTF("watchdog_isr *** this is the end, exit(0)\n");
91
92 exit(0);
89 }
93 }
90
94
91 void watchdog_configure(void)
95 void watchdog_configure(void)
@@ -200,6 +204,8 rtems_task load_task(rtems_task_argument
200
204
201 watchdog_start();
205 watchdog_start();
202
206
207 set_sy_lfr_watchdog_enabled( true );
208
203 while(1){
209 while(1){
204 status = rtems_rate_monotonic_period( watchdog_period_id, WATCHDOG_PERIOD );
210 status = rtems_rate_monotonic_period( watchdog_period_id, WATCHDOG_PERIOD );
205 watchdog_reload();
211 watchdog_reload();
@@ -645,6 +651,18 void set_hk_lfr_mag_fields_flag( bool st
645 }
651 }
646 }
652 }
647
653
654 void set_sy_lfr_watchdog_enabled( bool state )
655 {
656 if (state == true)
657 {
658 housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] | 0x10; // [0001 0000]
659 }
660 else
661 {
662 housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] & 0xef; // [1110 1111]
663 }
664 }
665
648 void set_hk_lfr_calib_enable( bool state )
666 void set_hk_lfr_calib_enable( bool state )
649 {
667 {
650 if (state == true)
668 if (state == true)
@@ -349,6 +349,7 rtems_task link_task( rtems_task_argumen
349 {
349 {
350 status = rtems_task_wake_after( 10 ); // monitor the link each 100ms
350 status = rtems_task_wake_after( 10 ); // monitor the link each 100ms
351 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status
351 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status
352 watchdog_reload();
352 }
353 }
353
354
354 status = spacewire_stop_and_start_link( fdSPW );
355 status = spacewire_stop_and_start_link( fdSPW );
General Comments 0
You need to be logged in to leave comments. Login now