示例#1
0
void Configura::on_Ok_clicked()
{
    writeConfigData() ;
    this->setVisible( false );

    emit sig_NewConfigFile() ;
}
示例#2
0
void OpenOBC::sleep()
{
	DEBUG("writing config file...\r\n");
	lcd->printf("write config file...");
	writeConfigData();
	ui->sleep();
	if(!doSleep)
		return;
	printf("sleeping...\r\n");
	lcd->printf("sleeping...");
	*lcdBiasEn = false;
	*lcdReset = false;
	*lcdLight = false;
	*clockLight = false;
	*keypadLight = false;
	*klWake = false;
	*vrefEn = false;
	accel->disable();

	fclose(stdout);

	NVIC_DisableIRQ(EINT3_IRQn);
	GPIO_IntDisable(0, 0xffffffff, 0);
	GPIO_IntDisable(0, 0xffffffff, 1);
	GPIO_IntDisable(2, 0xffffffff, 0);
	GPIO_IntDisable(2, 0xffffffff, 1);

	/*---------- Disable and disconnect the main PLL0 before enter into Deep-Sleep
	 * or Power-Down mode <according to errata.lpc1768-16.March.2010> ------------
	 */
	LPC_SC->PLL0CON &= ~(1<<1); /* Disconnect the main PLL (PLL0) */
	LPC_SC->PLL0FEED = 0xAA; /* Feed */
	LPC_SC->PLL0FEED = 0x55; /* Feed */
	while ((LPC_SC->PLL0STAT & (1<<25)) != 0x00); /* Wait for main PLL (PLL0) to disconnect */
	LPC_SC->PLL0CON &= ~(1<<0); /* Turn off the main PLL (PLL0) */
	LPC_SC->PLL0FEED = 0xAA; /* Feed */
	LPC_SC->PLL0FEED = 0x55; /* Feed */
	while ((LPC_SC->PLL0STAT & (1<<24)) != 0x00); /* Wait for main PLL (PLL0) to shut down */
	
	/*------------Then enter into PowerDown mode ----------------------------------*/
// 	CLKPWR_Sleep();
// 	CLKPWR_DeepSleep();
	CLKPWR_PowerDown();
// 	CLKPWR_DeepPowerDown();

}