BOOL CCompressionOptionsPage::OnSetActive() 
{
	if (Prog_Info.b_init_compressionpage == 0)
	{
		MyStaticInit();
		My_Init();
		Prog_Info.b_init_compressionpage = 1;
	}
	else
	{
		My_Init();
	}
	
	return CPropertyPage::OnSetActive();
}
Esempio n. 2
0
File: main.c Progetto: nemo1992/9DOF
int main(void)
{
  My_Init();
  Init_Timer();
  Init_I2C();
  Init_Sensors();
  SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
  GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1);
    /////////////////////////////////
  SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
  		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
  		GPIOPinConfigure(GPIO_PA0_U0RX);
  		GPIOPinConfigure(GPIO_PA1_U0TX);
  		GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
  		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); //enable GPIO port for LED
  		GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2); //enable pin for LED PF2
  		UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
  				(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
  		IntMasterEnable(); //enable processor interrupts
  		IntEnable(INT_UART0); //enable the UART interrupt
  		UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT); //only enable RX and TX interrupts
/////////////////////////////////
  Kalman_Sim_initialize();

  while(1)
  {
    Read_Accelerometer();
    Calculate_Acc();
    Read_Compass();
    Compass_Heading();
    Calculate_Compass();
    Read_Gyro();
    Calculate_Gyro();

    fgyro[0]    = sen_data.gyro_x;
    fgyro[1]	= sen_data.gyro_y;
    fgyro[2]	= sen_data.gyro_z;

    facc[0]     = sen_data.accel_x;
    facc[1]	= sen_data.accel_y;
    facc[2]	= sen_data.accel_z;

    fmag[0]     = sen_data.magnetom_x;
    fmag[1]	= sen_data.magnetom_y;
    fmag[2]	= sen_data.magnetom_z;


    Kalman_Sim_step();

    data[0]=Out1[0];
    data[1]=Out1[1];
    data[2]=Out1[2];



      Timer_CyRun();

  }
}
Esempio n. 3
0
BOOL CAdvancedDivX_Settings::OnInitDialog()
{
    CDialog::OnInitDialog();

    My_Init();

    return TRUE;
}
Esempio n. 4
0
BOOL CVideoOptionsPage::OnSetActive() 
{
	if (Prog_Info.b_init_videooptionspage == 0)
	{
		My_Static_Init();
		Prog_Info.b_init_videooptionspage = 1;
	}

	My_Init();

	return CPropertyPage::OnSetActive();
}