@@ -61,6 +61,7 void set_hk_lfr_mag_fields_flag( bool st | |||
|
61 | 61 | void set_hk_lfr_calib_enable( bool state ); |
|
62 | 62 | void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ); |
|
63 | 63 | void hk_lfr_le_me_he_update(); |
|
64 | void set_hk_lfr_time_not_synchro(); | |
|
64 | 65 | |
|
65 | 66 | extern int sched_yield( void ); |
|
66 | 67 | extern void rtems_cpu_usage_reset(); |
@@ -33,7 +33,7 void spacewire_set_NP( unsigned char val | |||
|
33 | 33 | void spacewire_set_RE( unsigned char val, unsigned int regAddr ); // RMAP Enable |
|
34 | 34 | void spacewire_compute_stats_offsets( void ); |
|
35 | 35 | void spacewire_update_statistics( void ); |
|
36 |
void increase_ |
|
|
36 | void increase_unsigned_char_counter( unsigned char *counter ); | |
|
37 | 37 | |
|
38 | 38 | void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header ); |
|
39 | 39 | void init_header_swf( Header_TM_LFR_SCIENCE_SWF_t *header ); |
@@ -298,6 +298,8 rtems_task hous_task(rtems_task_argument | |||
|
298 | 298 | |
|
299 | 299 | hk_lfr_le_me_he_update(); |
|
300 | 300 | |
|
301 | set_hk_lfr_time_not_synchro(); | |
|
302 | ||
|
301 | 303 | housekeeping_packet.hk_lfr_q_sd_fifo_size_max = hk_lfr_q_sd_fifo_size_max; |
|
302 | 304 | housekeeping_packet.hk_lfr_q_rv_fifo_size_max = hk_lfr_q_rv_fifo_size_max; |
|
303 | 305 | housekeeping_packet.hk_lfr_q_p0_fifo_size_max = hk_lfr_q_p0_fifo_size_max; |
@@ -679,6 +681,11 void hk_lfr_le_me_he_update() | |||
|
679 | 681 | + housekeeping_packet.hk_lfr_dpu_spw_write_sync |
|
680 | 682 | + housekeeping_packet.hk_lfr_dpu_spw_rx_ahb |
|
681 | 683 | + housekeeping_packet.hk_lfr_dpu_spw_tx_ahb |
|
684 | + housekeeping_packet.hk_lfr_timecode_erroneous | |
|
685 | + housekeeping_packet.hk_lfr_timecode_missing | |
|
686 | + housekeeping_packet.hk_lfr_timecode_invalid | |
|
687 | + housekeeping_packet.hk_lfr_time_timecode_it | |
|
688 | + housekeeping_packet.hk_lfr_time_not_synchro | |
|
682 | 689 | + housekeeping_packet.hk_lfr_time_timecode_ctr; |
|
683 | 690 | |
|
684 | 691 | //update the medium severity error counter |
@@ -703,3 +710,33 void hk_lfr_le_me_he_update() | |||
|
703 | 710 | housekeeping_packet.hk_lfr_he_cnt[1] = (unsigned char) (hk_lfr_he_cnt & 0x00ff); |
|
704 | 711 | |
|
705 | 712 | } |
|
713 | ||
|
714 | void set_hk_lfr_time_not_synchro() | |
|
715 | { | |
|
716 | static unsigned char synchroLost = 0; | |
|
717 | int synchronizationBit; | |
|
718 | ||
|
719 | // get the synchronization bit | |
|
720 | synchronizationBit = (time_management_regs->coarse_time & 0x80000000) >> 31; // 1000 0000 0000 0000 | |
|
721 | ||
|
722 | switch (synchronizationBit) | |
|
723 | { | |
|
724 | case 0: | |
|
725 | if (synchroLost == 1) | |
|
726 | { | |
|
727 | synchroLost = 0; | |
|
728 | } | |
|
729 | break; | |
|
730 | case 1: | |
|
731 | if (synchroLost == 0 ) | |
|
732 | { | |
|
733 | synchroLost = 1; | |
|
734 | increase_unsigned_char_counter(&housekeeping_packet.hk_lfr_time_not_synchro); | |
|
735 | } | |
|
736 | break; | |
|
737 | default: | |
|
738 | PRINTF1("in hk_lfr_time_not_synchro *** unexpected value for synchronizationBit = %d\n", synchronizationBit); | |
|
739 | break; | |
|
740 | } | |
|
741 | ||
|
742 | } |
@@ -707,10 +707,13 rtems_timer_service_routine timecode_tim | |||
|
707 | 707 | |
|
708 | 708 | unsigned int check_timecode_and_previous_timecode_coherency(unsigned char currentTimecodeCtr) |
|
709 | 709 | { |
|
710 | static unsigned char firstTickout = 1; | |
|
710 | 711 | unsigned char ret; |
|
711 | 712 | |
|
712 | 713 | ret = LFR_DEFAULT; |
|
713 | 714 | |
|
715 | if (firstTickout == 0) | |
|
716 | { | |
|
714 | 717 | if (currentTimecodeCtr == 0) |
|
715 | 718 | { |
|
716 | 719 | if (previousTimecodeCtr == 63) |
@@ -733,6 +736,12 unsigned int check_timecode_and_previous | |||
|
733 | 736 | ret = LFR_DEFAULT; |
|
734 | 737 | } |
|
735 | 738 | } |
|
739 | } | |
|
740 | else | |
|
741 | { | |
|
742 | firstTickout = 0; | |
|
743 | ret = LFR_SUCCESSFUL; | |
|
744 | } | |
|
736 | 745 | |
|
737 | 746 | return ret; |
|
738 | 747 | } |
@@ -778,7 +787,7 void timecode_irq_handler( void *pDev, v | |||
|
778 | 787 | // MISSING and INVALID are handled by the timecode_timer_routine service routine |
|
779 | 788 | if (check_timecode_and_previous_timecode_coherency( incomingTimecode ) == LFR_DEFAULT) |
|
780 | 789 | { |
|
781 |
// this is unexpected but a tickout |
|
|
790 | // this is unexpected but a tickout could have been raised despite of the timecode being erroneous | |
|
782 | 791 | increase_unsigned_char_counter( &housekeeping_packet.hk_lfr_timecode_erroneous ); |
|
783 | 792 | } |
|
784 | 793 |
General Comments 0
You need to be logged in to leave comments.
Login now