//Jump to DFU bootloader
static int _F2_Handler (void)
{
	printf_P(PSTR("Jumping to bootloader. A manual reset will be required\nPress 'y' to continue..."));
	
	if(WaitForAnyKey() == 'y')
	{
		printf_P(PSTR("Jump\n"));
		DelayMS(100);
		Jump_To_Bootloader();
	}
	
	printf_P(PSTR("Canceled\n"));
	return 0;
}
Beispiel #2
0
/// <summary>
/// Run the given test.
/// </summary>
/// <param name="str">The string to validate.</param>
/// <param name="expectedString">The expected contents of that string.</param>
/// <param name="expectedLength">The expected length of that string.</param>
/// <param name="message">A message to display to the user to explain why the test failed.</param>
int RunTestInternal(const char *name, const char *file, int line, TestFuncInternal testFuncInternal)
{
	UInt64 startTicks, endTicks;

	if (!QuietMode) {
		// First, print the name of the test we're about to run.
		if (strlen(name) > 58) {
			printf("  %.15s...%.40s: ", name, name + strlen(name) - 40);
		}
		else {
			printf("  %s: ", name);
		}

		// Flush it to the output, which ensures that it gets seen even if this test fails.
		fflush(stdout);
	}

	// Set a marker so we can get back to this if-statement if the test fails.
	if (setjmp(TestJmpBuf)) {

		if (QuietMode)
			printf("%s: ", name);

		// Test failed, so print the message, and return that it failed.
		PrintTestFailure(TestFailureMessage,
			TestFailureFile != NULL ? TestFailureFile : file,
			TestFailureFile != NULL ? TestFailureLine : line);

		if (InteractiveMode) {
			printf("Press any key to continue testing...");
			fflush(stdout);
			WaitForAnyKey();
			printf("\n");
		}

		return 0;
	}

	// Run the test, with timing metrics.
	startTicks = Smile_GetTicks();
	testFuncInternal();
	endTicks = Smile_GetTicks();

	// Test succeeded, so print "OK", and return that it succeeded.
	if (!QuietMode)
		PrintTestSuccess(endTicks - startTicks);

	return 1;
}
Beispiel #3
0
void Boot (void)
	{
	printd ("---------------------------------------------------------------------------\n");
	
	if (pln.bootMode == PLN_BOOT_REAL)
		printd ("       You are in REAL NAND mode: Press any key NOW for boot options\n");
	if (pln.bootMode == PLN_BOOT_NEEK)
		printd ("         You are in UNEEK mode: Press any key NOW for boot options\n");
	if (pln.bootMode == PLN_BOOT_SM)
		printd ("      You are in System Menu' mode: Press any key NOW for boot options\n");
	if (pln.bootMode == PLN_BOOT_HBC)
		printd ("     You are in HomeBrewChannel mode: Press any key NOW for boot options\n");

	if (keypressed || WaitForAnyKey ())
		{
		ChooseNewMode ();
		}
		
	printd ("\n");

	SavePLN ();
	
	WPAD_Shutdown();
	PAD_Reset(0xf0000000);

	//if (IsNandFolder ("usb:/") && pln.bootMode == PLN_BOOT_NEEK)
	if (pln.bootMode == PLN_BOOT_NEEK)
		{
		printd ("Booting neek...");
		Fat_Unmount ();
		green_fix ();
		IOS_ReloadIOS (254); 
		}

	if (pln.bootMode == PLN_BOOT_REAL)
		{
		bool found = FALSE;
		
		if (pl_sd)
			{
			if (!found) found = LoadExecFile (POSTLOADER_SD, "priibooter");
			if (!found) found = LoadExecFile (POSTLOADER_SDAPP, "priibooter");
			}
		if (pl_usb)
			{
			if (!found) found = LoadExecFile (POSTLOADER_USB, "priibooter");
			if (!found) found = LoadExecFile (POSTLOADER_USBAPP, "priibooter");
			}

		if (!found) BootToMenu ();
				
		Fat_Unmount ();
		green_fix ();
		BootExecFile ();
		}
		
	if (pln.bootMode == PLN_BOOT_SM)
		{
		green_fix ();
		BootToMenu ();
		}
		
	exit (0); // This isn't really needed...
	}