コード例 #1
0
ファイル: triac.c プロジェクト: Mole23/freewpc
void triac_update (void)
{
	U8 latch;

	/* Refresh the triac latch by turning on all 'normal'
	 * outputs, masked by anything allocated by a lamp effect. */
	latch = triac_output;
	latch &= ~gi_leff_alloc;
	latch |= gi_leff_output;
	pinio_write_gi (latch);
}
コード例 #2
0
ファイル: error.c プロジェクト: CardonaPinball/freewpc
/**
 * Entry point for errors that are nonrecoverable.
 * error_code is one of the values in include/system/errno.h.
 */
__noreturn__
void fatal (errcode_t error_code)
{
	new_fatal_error = TRUE;
#ifdef __m6809__
	set_stack_pointer (6133);
#endif

	/* Don't allow any more interrupts, since they might be the
	source of the error.  Since FIRQ is disabled, we can only
	do mono display at this point.   Also note that idle
	cannot run anymore, because task scheduling can't proceed
	without the system clock moving. */
	periodic_ok = 0;
	disable_interrupts ();

	/* Reset hardware outputs */
#ifdef CONFIG_GI
	pinio_write_gi (0);
#endif

	/* TODO - this whole function needs porting to Whitestar */
	/* Maybe just call platform_init again? */
#ifdef CONFIG_PLATFORM_WPC
	if (WPC_HAS_CAP (WPC_CAP_FLIPTRONIC))
		wpc_write_flippers (0);
#endif
#ifdef CONFIG_TICKET
	pinio_write_ticket (0);
#endif
	pinio_disable_flippers ();
	pinio_write_solenoid_set (0, 0);
	pinio_write_solenoid_set (1, 0);
	pinio_write_solenoid_set (2, 0);
	pinio_write_solenoid_set (3, 0);
#ifdef MACHINE_SOL_EXTBOARD1
	pinio_write_solenoid_set (5, 0);
#endif

	/* Audit the error. */
	audit_increment (&system_audits.fatal_errors);
	audit_assign (&system_audits.lockup1_addr, error_code);
	audit_assign (&system_audits.lockup1_pid_lef, task_getgid ());
	log_event (SEV_ERROR, MOD_SYSTEM, EV_SYSTEM_FATAL, error_code);

	/* Dump all debugging information */
#ifdef DEBUGGER
	dbprintf ("Fatal error %d\n", error_code);
	db_dump_all ();
#endif

	/* In native mode, exit whenever a fatal occurs.  If the
	   simulator is compiled in, let it clean up first. */
#ifdef CONFIG_SIM
	sim_exit (error_code);
#else
#ifdef CONFIG_NATIVE
	native_exit ();
	exit (error_code);
#endif
#endif

	/* Defining STOP_ON_ERROR is helpful during debugging a problem.
	Having the machine reset makes it hard to debug after the fact. */
#ifdef STOP_ON_ERROR
	while (1);
#endif

	/* Restart the system */
	warm_reboot ();
}