コード例 #1
0
ファイル: adder_ade32.cpp プロジェクト: killbug2004/adder
ADDERAPI unsigned long x86_put_instruction( void *python_ptr, x86_instruction *op )
{
	if ( !isInitialized ) {
		init_x86();
	}
	try {
		return ade32_asm( (BYTE*)python_ptr, (disasm_struct*)op );
	} catch (...) {
		return 0;
	}
}
コード例 #2
0
ファイル: main.c プロジェクト: Balu1991/Wifly_Light
void main(void)
{
#else
int g_start_gl = 1;
int main(int argc, const char** argv)
{
	if ((argc > 1) && (argv[1][0] == 'h'))
		g_start_gl = 0;
#endif
	/* softReset() on x86 will jump here! */
	softResetJumpDestination();

	InitAll();

	while(1)
	{
		Timer_StartStopwatch(eMAIN);
#ifndef __CC8E__
		// give opengl thread a chance to run
		usleep(10);
#endif /* #ifndef __CC8E__ */



			do_and_measure(Platform_CheckInputs);

			do_and_measure(Error_Throw);

			do_and_measure(CommandIO_GetCommands);

		if(g_UpdateLedStrip > 0) {
			do_and_measure(Ledstrip_UpdateLed);
			Timer1Enable();
			g_UpdateLedStrip = 0;
		}
		Timer_StopStopwatch(eMAIN);

			do_and_measure(ScriptCtrl_Run);

		if(g_UpdateLed > 0) {
			do_and_measure(Ledstrip_DoFade);

			Timer5InterruptLock();
			g_UpdateLed = 0;
			Timer5InterruptUnlock();

		}
	}
}
//*********************** UNTERPROGRAMME **********************************************

void InitAll()
{
	clearRAM();
	Trace_Init();
	Platform_OsciInit();
	Platform_IOInit();
	RingBuf_Init(&g_RingBuf);
	UART_Init();
	Timer_Init();
	Ledstrip_Init();
	CommandIO_Init();
	Rtc_Init();
	ScriptCtrl_Init();
	ExtEeprom_Init();
	
#ifndef __CC8E__
	init_x86(g_start_gl);
#endif /* #ifndef CC8E */

	Platform_AllowInterrupts();

	/* Startup Wait-Time 2s
	 * to protect Wifly-Modul from errors*/
	gScriptBuf.waitValue = 20;
	CommandIO_CreateResponse(&g_ResponseBuf, FW_STARTED, OK);
	CommandIO_SendResponse(&g_ResponseBuf);
	Trace_String(" Init Done ");
	Platform_DisableBootloaderAutostart();
}