/*
 * @brief:  system state update 
 *
 * @param:  None
 * @retval: None
 */
void system_state_refresh(void)
{
    _key_scan();
    if(key_struct.medium_press_flag == true)
    {
        _shutdown();
    }
    if(key_struct.long_press_flag == true)
    {
        _reboot();
    }
}
void
WiFlyDevice::begin()
{
   if( _uart == NULL )
   {
      _uart = new SpiUartDevice;
      _uart->begin();
   }

   _reboot(); // Reboot to get device into known state
   // //requireFlowControl();
   _set_configuration();
}
Beispiel #3
0
 void osh_load()
 {	u8b message = 0;
	while((message=osh_prompt())!=0)
	{	if(message==kill_opos)
		{	clear(color(BLACK,WHITE));
			print("Terminating system ",1,1);
			print("Breaking to main()..",1,2);
			break;			
		}
		else if(message==reboot_opos)
		{	clear(color(BLACK,WHITE));
			print("Terminating system ",1,1);
			print("Rebooting..",1,2);
			_reboot();	
		}
		else if(message==100)
		{	osh_putmsg("Not A Valid OSH-Command. Type `help'.");

		}
	}
 }
Beispiel #4
0
DWORD _drv_action(int action, int version)
{
	static wchar_t restart_confirm[ ] = 
						L"You must restart your computer before the new settings will take effect.\n\n"
						L"Do you want to restart your computer now?";
	DWORD status = ERROR_INVALID_FUNCTION;

	switch (action) 
	{
		case DA_INSTAL: 
		{
			if ( dc_is_driver_installed() ) 
			{
				if ( __msg_q( HWND_DESKTOP, restart_confirm ) )
				{
					_reboot( );
				}
				status = NO_ERROR;
			} else
			{
				if ( __msg_q( HWND_DESKTOP, L"Install DiskCryptor driver?" ) )
				{
					if ( (status = dc_install_driver()) == NO_ERROR )
					{
						if ( __msg_q( HWND_DESKTOP, restart_confirm ) )
						{
							_reboot( );					
						}						
					}
				} else {
					status = NO_ERROR;
				}
			}
		}
		break;
		case DA_REMOVE: 
		{
			if ( dc_is_driver_installed() ) 
			{
				if ( (status = dc_remove_driver()) == NO_ERROR )
				{
					if ( __msg_q( HWND_DESKTOP, restart_confirm ) )
					{
						_reboot( );
					}
				}
			}
		}
		break;
		case DA_UPDATE: 
		{
			wchar_t up_atom[MAX_PATH];

			_snwprintf(up_atom, countof(up_atom), L"DC_UPD_%d", version);

			if (GlobalFindAtom(up_atom) != 0)
			{
				if ( __msg_q( HWND_DESKTOP, restart_confirm ) ) _reboot( );
				status = NO_ERROR;
				break;
			}

			if ( dc_is_driver_installed() == FALSE )
			{
				status = ERROR_PRODUCT_UNINSTALLED;
				break;
			}

			if ( __msg_q( HWND_DESKTOP, L"Update DiskCryptor?" ) )
			{
				if ( (status = dc_update_driver()) == NO_ERROR && (status = _dc_upd_bootloader()) == NO_ERROR )
				{
					if ( __msg_q( HWND_DESKTOP, restart_confirm ) ) _reboot();
				}
			}
		}
		break;
	}
	return status;

}
int reboot(int flag)
{
	return _reboot(0xfee1dead, 0x28121969, flag, NULL);
}