@@ -10,6 +10,17 | |||
|
10 | 10 | #include "fsw_spacewire.h" |
|
11 | 11 | #include "lfr_cpu_usage_report.h" |
|
12 | 12 | |
|
13 | enum lfr_reset_cause_t{ | |
|
14 | UNKNOWN_CAUSE, | |
|
15 | POWER_ON, | |
|
16 | TC_RESET, | |
|
17 | WATCHDOG, | |
|
18 | ERROR_RESET, | |
|
19 | UNEXP_RESET | |
|
20 | }; | |
|
21 | ||
|
22 | #define LFR_RESET_CAUSE_UNKNOWN_CAUSE 0 | |
|
23 | ||
|
13 | 24 | rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic |
|
14 | 25 | rtems_id HK_id; // id of the HK rate monotonic period |
|
15 | 26 | |
@@ -40,7 +51,7 void get_cpu_load( unsigned char *resour | |||
|
40 | 51 | void set_hk_lfr_sc_potential_flag( bool state ); |
|
41 | 52 | void set_hk_lfr_mag_fields_flag( bool state ); |
|
42 | 53 | void set_hk_lfr_calib_enable( bool state ); |
|
43 | ||
|
54 | void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ); | |
|
44 | 55 | |
|
45 | 56 | extern int sched_yield( void ); |
|
46 | 57 | extern void rtems_cpu_usage_reset(); |
@@ -189,6 +189,8 rtems_task hous_task(rtems_task_argument | |||
|
189 | 189 | status = rtems_rate_monotonic_cancel(HK_id); |
|
190 | 190 | DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state) |
|
191 | 191 | |
|
192 | set_hk_lfr_reset_cause( POWER_ON ); | |
|
193 | ||
|
192 | 194 | while(1){ // launch the rate monotonic task |
|
193 | 195 | status = rtems_rate_monotonic_period( HK_id, HK_PERIOD ); |
|
194 | 196 | if ( status != RTEMS_SUCCESSFUL ) { |
@@ -562,3 +564,8 void set_hk_lfr_calib_enable( bool state | |||
|
562 | 564 | } |
|
563 | 565 | } |
|
564 | 566 | |
|
567 | void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ) | |
|
568 | { | |
|
569 | housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] | |
|
570 | | (lfr_reset_cause & 0x07 ); // [0000 0111] | |
|
571 | } |
General Comments 0
You need to be logged in to leave comments.
Login now