Пример #1
0
/** Realtime update of the first set of flasher outputs */
void sol_update_rtt_0 (void)
{
	pinio_write_solenoid_set (0, *sol_get_read_reg (0));
	sol_update_set (2);
#ifdef CONFIG_PLATFORM_WPC
	if (WPC_HAS_CAP (WPC_CAP_FLIPTRONIC))
		sol_update_fliptronic_powered ();
#endif
}
Пример #2
0
/** Realtime update of the second set of flasher outputs */
void sol_update_rtt_1 (void)
{
	pinio_write_solenoid_set (1, *sol_get_read_reg (8));
	sol_update_set (3);
#ifdef MACHINE_SOL_EXTBOARD1
	sol_update_set (5);
#endif

	/* Rotate the duty mask for the next iteration. */
	/* TODO - the assembly code generated here is not ideal.
	It could be done in two instructions, by shifting and then
	adding the carry.  Need a way from gcc to request this. */
	sol_duty_mask <<= 1;
	if (sol_duty_mask == 0)
		sol_duty_mask = 1;
}
Пример #3
0
/** Update a set of 8 solenoids that share the same output register.
 * base_id is the solenoid number for the first solenoid in the set.
 * asic_addr is the hardware register to be written with all 8 values
 * at once. */
extern inline void platform_sol_update_timed (const U8 set)
{
	register U8 out __areg__ = *sol_get_read_reg (set * CHAR_BIT);

	/* Update each of the 8 solenoids in the bank, updating timers
	and calculating whether or not each should be on or off. */
	platform_sol_timer_contribute (set * CHAR_BIT + 0, out);
	platform_sol_timer_contribute (set * CHAR_BIT + 1, out);
	platform_sol_timer_contribute (set * CHAR_BIT + 2, out);
	platform_sol_timer_contribute (set * CHAR_BIT + 3, out);
	platform_sol_timer_contribute (set * CHAR_BIT + 4, out);
	platform_sol_timer_contribute (set * CHAR_BIT + 5, out);
	platform_sol_timer_contribute (set * CHAR_BIT + 6, out);
	platform_sol_timer_contribute (set * CHAR_BIT + 7, out);

	/* Write the final output to the hardware */
	pinio_write_solenoid_set (set, out);
}
Пример #4
0
/**
 * 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 ();
}
Пример #5
0
extern inline void platform_sol_update_direct (const U8 sol_set)
{
	pinio_write_solenoid_set (sol_set, *sol_get_read_reg (sol_set));
}