Ignore:
Timestamp:
Aug 4, 2026, 1:53:58 PM (25 hours ago)
Author:
f.jahn
Message:

Delta Sigma ADC auf 10Channel geändert.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fw_g473rct/SES/src/fast_current.c

    r26 r73  
    3232
    3333//      --- GLOBALE FUNKTIONEN - bitte in Header dokumentieren------------------------
    34 void CurrentOffsetCal(uint32_t newVal)
     34void CurrentOffsetCal(int32_t newVal)
    3535{
    3636  sys_data.s.parameter.batteryCurrentOffsetFast = newVal-FAST_CURRENT_ADC_OFFSET;
    3737}
    3838
    39 void CurrentGainCal(uint32_t newVal)
     39void CurrentGainCal(int32_t newVal)
    4040{
    4141  double correction;
    4242  double valWithoutGainCorrection;
    4343
    44   valWithoutGainCorrection = ((int32_t) newVal - FAST_CURRENT_ADC_OFFSET - sys_data.s.parameter.batteryCurrentOffsetFast) * VREF ;
     44  valWithoutGainCorrection = ( newVal - FAST_CURRENT_ADC_OFFSET - sys_data.s.parameter.batteryCurrentOffsetFast) * VREF ;
    4545  valWithoutGainCorrection = valWithoutGainCorrection / FAST_CURRENT_ADC_RESOLUTION;
    4646  valWithoutGainCorrection = valWithoutGainCorrection / FAST_CURRENT_I_SENSE_GAIN ;
     
    5151
    5252}
    53 void FAST_CURRENT_Exec(uint32_t newVal )
     53void FAST_CURRENT_Exec(int32_t newVal )
    5454{
    5555 
    5656  //Umrechung auf Strom
    5757  double temp_current;
    58   temp_current = ((int32_t) newVal - FAST_CURRENT_ADC_OFFSET - sys_data.s.parameter.batteryCurrentOffsetFast) * VREF ;
     58  temp_current = ( newVal - FAST_CURRENT_ADC_OFFSET - sys_data.s.parameter.batteryCurrentOffsetFast) * VREF ;
    5959  temp_current = temp_current / FAST_CURRENT_ADC_RESOLUTION;
    6060  temp_current = temp_current / FAST_CURRENT_I_SENSE_GAIN ;
Note: See TracChangeset for help on using the changeset viewer.