Beispiel #1
0
void
MultiApp::preTransfer(Real /*dt*/, Real target_time)
{
  // First, see if any Apps need to be Reset
  if (!_reset_happened && target_time + 1e-14 >= _reset_time)
  {
    _reset_happened = true;
    for (unsigned int i=0; i<_reset_apps.size(); i++)
      resetApp(_reset_apps[i]);
  }

  // Now move any apps that should be moved
  if (!_move_happened && target_time + 1e-14 >= _move_time)
  {
    _move_happened = true;
    for (unsigned int i=0; i<_move_apps.size(); i++)
      moveApp(_move_apps[i], _move_positions[i]);
  }
}
void Hacklace_AppEngine::enterPowerDown()
{
	resetApp();										// terminate current app
	printChar(SAD_SMILEY);  _delay_ms(500);
	clearDisplay();
	while ((PIN(BTN_PORT) & BUTTON1) == 0) {}		// wait for button to be released
	_delay_ms(20);									// wait until bouncing has decayed
	powerDown();									// ---------- sleeping ----------
	while ((PIN(BTN_PORT) & BUTTON1) == 0) {}		// wait for button to be released
	_delay_ms(20);									// wait until bouncing has decayed
	
	printChar(HAPPY_SMILEY);
	if (PIN(BTN_PORT) & BUTTON2) {					// button2 not pressed
		_delay_ms(500);
		nextApp();									// start app
	} else {										// button2 pressed
		while ((PIN(BTN_PORT) & BUTTON2) == 0) {}	// wait for button to be released
		_delay_ms(20);								// wait until bouncing has decayed
		clearDisplay();
		app = (Hacklace_App*) DownloadApp_ptr;
		app->setup(EE_START_ADDR);					// enter download mode
	}
}