LCOV - code coverage report
Current view: top level - src/mitigations - reaction_wheel_filtering.c (source / functions) Hit Total Coverage
Test: trace.info Lines: 13 13 100.0 %
Date: 2023-02-20 11:47:13 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*------------------------------------------------------------------------------
       2             : --  Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
       3             : --  This file is a part of the LFR FSW
       4             : --  Copyright (C) 2021, Plasma Physics Laboratory - CNRS
       5             : --
       6             : --  This program is free software; you can redistribute it and/or modify
       7             : --  it under the terms of the GNU General Public License as published by
       8             : --  the Free Software Foundation; either version 2 of the License, or
       9             : --  (at your option) any later version.
      10             : --
      11             : --  This program is distributed in the hope that it will be useful,
      12             : --  but WITHOUT ANY WARRANTY; without even the implied warranty of
      13             : --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14             : --  GNU General Public License for more details.
      15             : --
      16             : --  You should have received a copy of the GNU General Public License
      17             : --  along with this program; if not, write to the Free Software
      18             : --  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
      19             : -------------------------------------------------------------------------------*/
      20             : /*--                  Author : Alexis Jeandet
      21             : --                   Contact : Alexis Jeandet
      22             : --                      Mail : alexis.jeandet@lpp.polytechnique.fr
      23             : ----------------------------------------------------------------------------*/
      24             : #include "mitigations/reaction_wheel_filtering.h"
      25             : #include "lfr_common_headers/fsw_params.h"
      26             : 
      27             : #include "fsw_globals.h"
      28             : #include "fsw_debug.h"
      29             : 
      30       50680 : int getFBinMask(int index, unsigned char channel)
      31             : {
      32             :     unsigned int indexInChar;
      33             :     unsigned int indexInTheChar;
      34             :     int fbin;
      35             :     const unsigned char* sy_lfr_fbins_fx_word1;
      36             : 
      37       50680 :     sy_lfr_fbins_fx_word1 = parameter_dump_packet.sy_lfr_fbins_f0_word1;
      38             : 
      39       50680 :     switch (channel)
      40             :     {
      41             :         case CHANNELF0:
      42       31856 :             sy_lfr_fbins_fx_word1 = fbins_masks.merged_fbins_mask_f0;
      43       31856 :             break;
      44             :         case CHANNELF1:
      45       15080 :             sy_lfr_fbins_fx_word1 = fbins_masks.merged_fbins_mask_f1;
      46       15080 :             break;
      47             :         case CHANNELF2:
      48        3744 :             sy_lfr_fbins_fx_word1 = fbins_masks.merged_fbins_mask_f2;
      49        3744 :             break;
      50             :         default:
      51             :             LFR_PRINTF("ERR *** in getFBinMask, wrong frequency channel");
      52             :     }
      53             : 
      54       50680 :     indexInChar = index >> SHIFT_3_BITS;
      55       50680 :     indexInTheChar = index - (indexInChar * BITS_PER_BYTE);
      56             : 
      57       50680 :     fbin = (int)((sy_lfr_fbins_fx_word1[BYTES_PER_MASK - 1 - indexInChar] >> indexInTheChar) & 1);
      58             : 
      59       50680 :     return fbin;
      60             : }

Generated by: LCOV version 1.14