Beispiel #1
0
void InputUpdate()//TODO: put on SD branch
{
	float grad = 0.0000762939453125;
	float offs = 0.0f;
	pRamVariables->TGVLeftVolts = ShortToFloatHooked(*pTGVLeftVoltage,grad,offs);
	pRamVariables->TGVRightVolts = ShortToFloatHooked(*pTGVRightVoltage,grad,offs);
	pRamVariables->TGVLeftScaled = Smooth(LeftTGVInputSmoothingFactor,Pull2DHooked(&TGVLeftScaling,pRamVariables->TGVLeftVolts), pRamVariables->TGVLeftScaled) * LeftTGVInputMultiplier + LeftTGVInputOffset;
	pRamVariables->TGVRightScaled = Smooth(RightTGVInputSmoothingFactor,Pull2DHooked(&TGVRightScaling,pRamVariables->TGVRightVolts), pRamVariables->TGVRightScaled) * RightTGVInputMultiplier + LeftTGVInputOffset;
	
	switch(pRamVariables->MapBlendingInputMode)
	{
		case MapBlendingInputModeUndefined:
		break;
		
		case MapBlendingInputModeTGVLeft:
			pRamVariables->MapBlendRatio = pRamVariables->TGVLeftScaled;
			break;
		
		case MapBlendingInputModeTGVRight:
			pRamVariables->MapBlendRatio = pRamVariables->TGVRightScaled;
			break;
		
		default:
			pRamVariables->MapBlendRatio = DefaultMapBlendRatio;
			break;
	}
	
	switch(pRamVariables->MapSwitchingInputMode)
	{
		case MapSwitchingInputModeUndefined:
		break;
		
		#ifdef pSiDrive
		case MapSwitchingInputModeSiDrive:
		{
			switch(*pSiDrive)
		
			case SiDriveSS:
			pRamVariables->MapSwitch = MapSwitch3;
			break;
			
			case SiDriveSSAlt:
			pRamVariables->MapSwitch = MapSwitch3;
			break;
			
			case SiDriveS:
			pRamVariables->MapSwitch = MapSwitch2;
			break;
		
			default:
			pRamVariables->MapSwitch = MapSwitch1;
			break;
			}
		}
		#endif
		
		case MapSwitchingInputModeTGVLeft:
			MapSwitchThresholdCheck(pRamVariables->TGVLeftVolts);
			break;
		
		case MapSwitchingInputModeTGVRight:
			MapSwitchThresholdCheck(pRamVariables->TGVRightVolts);
			break;
		
		default:
		pRamVariables->MapSwitch = DefaultMapSwitch;
		break;
	}
Beispiel #2
0
void InputUpdate()//TODO: put on SD branch
{
	float grad = 0.0000762939453125;
	float offs = 0.0f;
	pRamVariables->TGVLeftVolts = ShortToFloatHooked(*pTGVLeftVoltage,grad,offs);
	pRamVariables->TGVRightVolts = ShortToFloatHooked(*pTGVRightVoltage,grad,offs);
	pRamVariables->TGVLeftScaled = Pull2DHooked(&TGVLeftScaling,pRamVariables->TGVLeftVolts);
	pRamVariables->TGVRightScaled = Pull2DHooked(&TGVRightScaling,pRamVariables->TGVRightVolts);
	
	switch(BlendRatioInput)
	{
		case InputModeUndefined:
		break;
		
		case InputModeTGVLeft:
			pRamVariables->MapBlendRatio = pRamVariables->TGVLeftScaled;
			break;
		
		case InputModeTGVRight:
			pRamVariables->MapBlendRatio = pRamVariables->TGVRightScaled;
			break;
		
		default:
			pRamVariables->MapBlendRatio = DefaultMapBlendRatio;
			break;
	}
	
	switch(MapSwitchInput)
	{
		case InputModeUndefined:
		break;
		
		#ifdef pSiDrive
		case InputModeSiDrive:
		{
			switch(*pSiDrive)
		
			case SiDriveSS:
			pRamVariables->MapSwitch = MapSwitch3;
			break;
			
			case SiDriveSSAlt:
			pRamVariables->MapSwitch = MapSwitch3;
			break;
			
			case SiDriveS:
			pRamVariables->MapSwitch = MapSwitch2;
			break;
		
			default:
			pRamVariables->MapSwitch = MapSwitch1;
			break;
			}
		}
		#endif
		
		case InputModeTGVLeft:
			MapSwitchThresholdCheck(pRamVariables->TGVLeftVolts);
			break;
		
		case InputModeTGVRight:
			MapSwitchThresholdCheck(pRamVariables->TGVRightVolts);
			break;
		
		default:
		pRamVariables->MapSwitch = DefaultMapSwitch;
		break;
	}