Exemple #1
0
int main (void)
{
	uint8_t no = 0;
//	wait(10);
	setMU2PutFunc(uart0Put);
	setMU2GetFunc(uart0Get);
	initUART(
		UART0,
		StopBitIs1Bit|NonParity,
		ReceiverEnable|TransmiterEnable|ReceiveCompleteInteruptEnable,
		UARTBAUD(19200)
	);
	initLED();
	initSwitch();
	
	initRCRx();
	
	no = Switch() & 0x03;
	
	mu2Command("EI",EI[no]);
	mu2Command("DI",DI[no]);
	mu2Command("GI",GI[no]);
	mu2Command("CH",CH[no]);

	sei();
	userMain();
	
	return 0;
}
int main(int argc, char* argv[]){

	System::initSystem();

	int result = userMain(argc, argv);

	System::restoreSystem();

	return result;
}
Exemple #3
0
int main(int argc, char *argv[])
{
  kiInit(&argc, &argv);
  kiStart();

  if (kiIsUserDomain())
    userMain(argc, argv);
  
  kiStop();
  kiFinalize();
  return 0;
}
void jumpToUser(u32 usrAddr) {
    typedef void (*funcPtr)(void);
    // The start of the bootloader references the user application location
    u32 appStart = usrAddr;
    funcPtr userMain;

    systemReset(); // resets clocks and periphs, not core regs

    // Offset by 4 where Wiring app starts. Add 1 because it will be a thumb instruction.
    userMain = (funcPtr)(*(vu32 *)(appStart + 4));

    // set the users stack ptr
    __set_MSP(*(vu32 *)appStart);

    // Go!
    userMain();
}
Exemple #5
0
int main() {
	userMain();
}
Exemple #6
0
void UMain::run() {
	ret = userMain(argc, argv);
}