changed variables from static to extern for use in other functions
This commit is contained in:
		@ -2,7 +2,10 @@
 | 
			
		||||
#include "stm32f3xx_hal.h"
 | 
			
		||||
 | 
			
		||||
StateHandle state;
 | 
			
		||||
static uint32_t timestamp;
 | 
			
		||||
int16_t RELAY_BAT_SIDE_VOLTAGE;
 | 
			
		||||
int16_t RELAY_ESC_SIDE_VOLTAGE;
 | 
			
		||||
int16_t CURRENT_MEASUREMENT;
 | 
			
		||||
uint32_t timestamp;
 | 
			
		||||
 | 
			
		||||
void sm_init(){
 | 
			
		||||
  state.current_state = STATE_INACTIVE;
 | 
			
		||||
@ -11,9 +14,9 @@ void sm_init(){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sm_update(){
 | 
			
		||||
  RELAY_BAT_SIDE_VOLTAGE = module.auxVoltages[0] * 11.989;
 | 
			
		||||
  RELAY_ESC_SIDE_VOLTAGE = module.auxVoltages[1] * 11.989;
 | 
			
		||||
  CURRENT_MEASUREMENT = module.auxVoltages[2] ;
 | 
			
		||||
  RELAY_BAT_SIDE_VOLTAGE = module.auxVoltages[0] * 12.42;     // the calculation says the factor is 11.989. 12.42 yields the better result
 | 
			
		||||
  RELAY_ESC_SIDE_VOLTAGE = module.auxVoltages[1] * 12.42;
 | 
			
		||||
  CURRENT_MEASUREMENT = module.auxVoltages[2] / 2.2;
 | 
			
		||||
  
 | 
			
		||||
  switch (state.current_state) {
 | 
			
		||||
    case STATE_INACTIVE:
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user