Ignore:
Timestamp:
Sep 7, 2025, 3:51:43 PM (7 weeks ago)
Author:
f.jahn
Message:

RTC implementiert

File:
1 edited

Legend:

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

    r24 r25  
    1717
    1818//      --- LOKALE DEFINES - bitte hier dokumentieren --------------------------------
    19 
    20 #define I_SENSE_GAIN    40.0
    21 #define ADC_OFFSET                                                        32768
    22 #define ADC_RESOLUTION                                            32768 //65536/2 da im differential mode
    23 
    24 
    25   #if (DEVICETYPE == 500)
    26     #define SHUNT_RESISTOR      0.000125       
    27   #elif (DEVICETYPE == 250)
    28     #define SHUNT_RESISTOR      0.000250       
    29   #elif (DEVICETYPE == 125)
    30     #define SHUNT_RESISTOR      0.000500       
    31   #else
    32   #error No valid device type
    33   #endif
    34                
    3519
    3620
     
    5539  //Umrechung auf Strom
    5640  double temp_current;
    57   temp_current = ((int32_t) newVal - ADC_OFFSET) * VREF ;
    58   temp_current = temp_current / ADC_RESOLUTION;
    59   temp_current = temp_current / I_SENSE_GAIN ;
    60   temp_current = temp_current / SHUNT_RESISTOR ;
     41  temp_current = ((int32_t) newVal - FAST_CURRENT_ADC_OFFSET) * VREF ;
     42  temp_current = temp_current / FAST_CURRENT_ADC_RESOLUTION;
     43  temp_current = temp_current / FAST_CURRENT_I_SENSE_GAIN ;
     44  temp_current = temp_current / FAST_CURRENT_SHUNT_RESISTOR ;
    6145  sys_data.s.values.fast_current = temp_current * (sys_data.s.parameter.batteryCurrentGainCorrectionFaktor / 1000000.0);
    6246 
Note: See TracChangeset for help on using the changeset viewer.