void current_Init ( void   )

This function reads the ADC current value to set up the according module variable mg_u16Value. Furthermore the ring array will be initialized.

See also:
mg_u16Value
mg_au16Data
mg_u16Sum
mg_u8Idx
Returns:
void

Definition at line 120 of file current.c.

References ADC_CURRENT, adc_Read(), AVG_COUNT, mg_au16AvgData, mg_au16Data, mg_u16Sum, mg_u16Value, mg_u8AvgIdx, mg_u8SumIdx, and SUM_COUNT.

Referenced by init_InitModules().

{
  mg_u16Value = adc_Read(ADC_CURRENT);
  
  for(UINT8 i=0U; i<SUM_COUNT; i++)
  {
    mg_au16Data[i] = 0U;
  }
  
  for(UINT8 i=0U; i<AVG_COUNT; i++)
  {
    mg_au16AvgData[i] = 0U;
  }

  mg_u16Sum   = 0U;
  mg_u8SumIdx = 0U;
  mg_u8AvgIdx = 0U;
}

Here is the call graph for this function:

Here is the caller graph for this function: