Changeset 73 for trunk/fw_g473rct/SES/src/fast_current.c
- Timestamp:
- Aug 4, 2026, 1:53:58 PM (25 hours ago)
- File:
-
- 1 edited
-
trunk/fw_g473rct/SES/src/fast_current.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fw_g473rct/SES/src/fast_current.c
r26 r73 32 32 33 33 // --- GLOBALE FUNKTIONEN - bitte in Header dokumentieren------------------------ 34 void CurrentOffsetCal( uint32_t newVal)34 void CurrentOffsetCal(int32_t newVal) 35 35 { 36 36 sys_data.s.parameter.batteryCurrentOffsetFast = newVal-FAST_CURRENT_ADC_OFFSET; 37 37 } 38 38 39 void CurrentGainCal( uint32_t newVal)39 void CurrentGainCal(int32_t newVal) 40 40 { 41 41 double correction; 42 42 double valWithoutGainCorrection; 43 43 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 ; 45 45 valWithoutGainCorrection = valWithoutGainCorrection / FAST_CURRENT_ADC_RESOLUTION; 46 46 valWithoutGainCorrection = valWithoutGainCorrection / FAST_CURRENT_I_SENSE_GAIN ; … … 51 51 52 52 } 53 void FAST_CURRENT_Exec( uint32_t newVal )53 void FAST_CURRENT_Exec(int32_t newVal ) 54 54 { 55 55 56 56 //Umrechung auf Strom 57 57 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 ; 59 59 temp_current = temp_current / FAST_CURRENT_ADC_RESOLUTION; 60 60 temp_current = temp_current / FAST_CURRENT_I_SENSE_GAIN ;
Note:
See TracChangeset
for help on using the changeset viewer.
