@@ -61,6 +61,7 void set_hk_lfr_mag_fields_flag( bool st | |||||
61 | void set_hk_lfr_calib_enable( bool state ); |
|
61 | void set_hk_lfr_calib_enable( bool state ); | |
62 | void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ); |
|
62 | void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ); | |
63 | void hk_lfr_le_me_he_update(); |
|
63 | void hk_lfr_le_me_he_update(); | |
|
64 | void set_hk_lfr_time_not_synchro(); | |||
64 |
|
65 | |||
65 | extern int sched_yield( void ); |
|
66 | extern int sched_yield( void ); | |
66 | extern void rtems_cpu_usage_reset(); |
|
67 | extern void rtems_cpu_usage_reset(); |
@@ -33,7 +33,7 void spacewire_set_NP( unsigned char val | |||||
33 | void spacewire_set_RE( unsigned char val, unsigned int regAddr ); // RMAP Enable |
|
33 | void spacewire_set_RE( unsigned char val, unsigned int regAddr ); // RMAP Enable | |
34 | void spacewire_compute_stats_offsets( void ); |
|
34 | void spacewire_compute_stats_offsets( void ); | |
35 | void spacewire_update_statistics( void ); |
|
35 | void spacewire_update_statistics( void ); | |
36 |
void increase_ |
|
36 | void increase_unsigned_char_counter( unsigned char *counter ); | |
37 |
|
37 | |||
38 | void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header ); |
|
38 | void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header ); | |
39 | void init_header_swf( Header_TM_LFR_SCIENCE_SWF_t *header ); |
|
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 | hk_lfr_le_me_he_update(); |
|
299 | hk_lfr_le_me_he_update(); | |
300 |
|
300 | |||
|
301 | set_hk_lfr_time_not_synchro(); | |||
|
302 | ||||
301 | housekeeping_packet.hk_lfr_q_sd_fifo_size_max = hk_lfr_q_sd_fifo_size_max; |
|
303 | housekeeping_packet.hk_lfr_q_sd_fifo_size_max = hk_lfr_q_sd_fifo_size_max; | |
302 | housekeeping_packet.hk_lfr_q_rv_fifo_size_max = hk_lfr_q_rv_fifo_size_max; |
|
304 | housekeeping_packet.hk_lfr_q_rv_fifo_size_max = hk_lfr_q_rv_fifo_size_max; | |
303 | housekeeping_packet.hk_lfr_q_p0_fifo_size_max = hk_lfr_q_p0_fifo_size_max; |
|
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 | + housekeeping_packet.hk_lfr_dpu_spw_write_sync |
|
681 | + housekeeping_packet.hk_lfr_dpu_spw_write_sync | |
680 | + housekeeping_packet.hk_lfr_dpu_spw_rx_ahb |
|
682 | + housekeeping_packet.hk_lfr_dpu_spw_rx_ahb | |
681 | + housekeeping_packet.hk_lfr_dpu_spw_tx_ahb |
|
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 | + housekeeping_packet.hk_lfr_time_timecode_ctr; |
|
689 | + housekeeping_packet.hk_lfr_time_timecode_ctr; | |
683 |
|
690 | |||
684 | //update the medium severity error counter |
|
691 | //update the medium severity error counter | |
@@ -703,3 +710,33 void hk_lfr_le_me_he_update() | |||||
703 | housekeeping_packet.hk_lfr_he_cnt[1] = (unsigned char) (hk_lfr_he_cnt & 0x00ff); |
|
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,31 +707,40 rtems_timer_service_routine timecode_tim | |||||
707 |
|
707 | |||
708 | unsigned int check_timecode_and_previous_timecode_coherency(unsigned char currentTimecodeCtr) |
|
708 | unsigned int check_timecode_and_previous_timecode_coherency(unsigned char currentTimecodeCtr) | |
709 | { |
|
709 | { | |
|
710 | static unsigned char firstTickout = 1; | |||
710 | unsigned char ret; |
|
711 | unsigned char ret; | |
711 |
|
712 | |||
712 | ret = LFR_DEFAULT; |
|
713 | ret = LFR_DEFAULT; | |
713 |
|
714 | |||
714 |
if ( |
|
715 | if (firstTickout == 0) | |
715 | { |
|
716 | { | |
716 |
if ( |
|
717 | if (currentTimecodeCtr == 0) | |
717 | { |
|
718 | { | |
718 | ret = LFR_SUCCESSFUL; |
|
719 | if (previousTimecodeCtr == 63) | |
|
720 | { | |||
|
721 | ret = LFR_SUCCESSFUL; | |||
|
722 | } | |||
|
723 | else | |||
|
724 | { | |||
|
725 | ret = LFR_DEFAULT; | |||
|
726 | } | |||
719 | } |
|
727 | } | |
720 | else |
|
728 | else | |
721 | { |
|
729 | { | |
722 | ret = LFR_DEFAULT; |
|
730 | if (currentTimecodeCtr == (previousTimecodeCtr +1)) | |
|
731 | { | |||
|
732 | ret = LFR_SUCCESSFUL; | |||
|
733 | } | |||
|
734 | else | |||
|
735 | { | |||
|
736 | ret = LFR_DEFAULT; | |||
|
737 | } | |||
723 | } |
|
738 | } | |
724 | } |
|
739 | } | |
725 | else |
|
740 | else | |
726 | { |
|
741 | { | |
727 | if (currentTimecodeCtr == (previousTimecodeCtr +1)) |
|
742 | firstTickout = 0; | |
728 | { |
|
743 | ret = LFR_SUCCESSFUL; | |
729 | ret = LFR_SUCCESSFUL; |
|
|||
730 | } |
|
|||
731 | else |
|
|||
732 | { |
|
|||
733 | ret = LFR_DEFAULT; |
|
|||
734 | } |
|
|||
735 | } |
|
744 | } | |
736 |
|
745 | |||
737 | return ret; |
|
746 | return ret; | |
@@ -778,7 +787,7 void timecode_irq_handler( void *pDev, v | |||||
778 | // MISSING and INVALID are handled by the timecode_timer_routine service routine |
|
787 | // MISSING and INVALID are handled by the timecode_timer_routine service routine | |
779 | if (check_timecode_and_previous_timecode_coherency( incomingTimecode ) == LFR_DEFAULT) |
|
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 | increase_unsigned_char_counter( &housekeeping_packet.hk_lfr_timecode_erroneous ); |
|
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