Example #1
0
void db_dump_all (void)
{
	VOIDCALL (task_dump);
	VOIDCALL (dump_game);
	VOIDCALL (dump_deffs);
	switch_queue_dump ();
	VOIDCALL (sol_req_dump);
	VOIDCALL (triac_dump);
	SECTION_VOIDCALL (__common__, device_debug_all);
}
Example #2
0
void db_dump_all (void)
{
	VOIDCALL (task_dump);
	VOIDCALL (dump_game);
	VOIDCALL (dump_deffs);
	switch_queue_dump ();
#ifdef CONFIG_TRIAC
	VOIDCALL (triac_dump);
#endif
	SECTION_VOIDCALL (__common__, device_debug_all);
}
Example #3
0
/**
 * Handle the start button.  There should be only one callset entry for
 * this, because only one of the cases should be handled at any time.
 * Modules that want to hook the start button should declare a
 * start_button_handler and modify the logic here.
 */
CALLSET_ENTRY (start_button, sw_start_button)
{
	/* if (free_timer_test (TMR_IGNORE_START_BUTTON))
	{
	}
	else */ if (deff_get_active () == DEFF_SYSTEM_RESET)
	{
	}
	else if (switch_stress_enable && in_live_game && valid_playfield)
	{
		switch_stress_drain ();
	}
	else if (initials_enter_timer)
	{
		SECTION_VOIDCALL (__common__, initials_start_button_handler);
	}
#ifdef CONFIG_ENTER_PIN
	else if (pin_enter_timer)
	{
		SECTION_VOIDCALL (__common__, pin_start_button_handler);
	}
#endif
#ifdef CONFIG_TEST
	else if (in_test)
	{
		SECTION_VOIDCALL (__test__, test_mode_start_button_handler);
	}
#endif
	else
	{
		VOIDCALL (game_start_button_handler);
	}
}
Example #4
0
CALLSET_ENTRY (plunger, sw_shooter)
{
    /* TODO - none of this logic works if the shooter switch is broken.
     * Need to invoke this on a timer after any trough kick.
     */
#ifdef INCLUDE_AUTOPLUNGER
    if (valid_playfield
            && !tournament_mode_enabled
            && !global_flag_test (GLOBAL_FLAG_COIN_DOOR_OPENED))
    {
        /* Autolaunch balls right away during a game if they land
        in the autoplunger lane. */
        /* TODO - after locking a ball, adding a new ball to the
        plunger while valid_playfield is TRUE: this will launch
        prematurely.  We need a permanent, system-defined global
        flag that says whether a trough serve should be autoplunged
        or not.  TZ is already doing this privately... */
        VOIDCALL (plunger_sw_launch_button);
    }
    else if (config_timed_plunger == ON)
    {
        /* If timed plunger is enabled, then start a timer
        to autoplunge the ball regardless of button press */
        task_create_gid1 (GID_TIMED_PLUNGER_MONITOR, timed_plunger_monitor);
    }
#endif
    shooter_update ();
}
Example #5
0
File: init.c Project: hydra/freewpc
/** Initialize the FreeWPC program. */
__noreturn__ void freewpc_init (void)
{
    extern __common__ void system_reset (void);

    /* Initialize the platform specifics first */
    VOIDCALL (platform_init);

    /* Reset the blanking and watchdog circuitry.
     * Eventually, the watchdog will be tickled every 1ms
     * by the IRQ; until interrupts are enabled, we will
     * have to do this periodically ourselves. */
    pinio_watchdog_reset ();

    /* Set init complete flag to false.  When everything is
     * ready, we'll change this to a 1. */
    sys_init_complete = 0;
    periodic_ok = 0;
    sys_init_pending_tasks = 0;

    /* Initialize all of the other kernel subsystems,
     * starting with the hardware-centric ones and moving on
     * to software features. */

    /* Initialize the real-time scheduler.  The periodic functions
    are scheduled at compile-time  using the 'gensched' utility. */
    VOIDCALL (tick_init);

    /* Initialize the hardware.
     * After each init call, tickle the watchdog (IRQ isn't enabled yet)
     * to prevent it from expiring and resetting the CPU.
     * We don't use a callset here because there are some ordering
     * dependencies -- some modules must be initialized before others --
     * and gencallset doesn't allow us to express those conditions.
     */
#ifdef DEBUGGER
    db_init ();
    bpt_init ();
    pinio_watchdog_reset ();
#endif
    ac_init ();
    pinio_watchdog_reset ();
    sol_init ();
    pinio_watchdog_reset ();
#ifdef CONFIG_GI
    gi_init ();
    pinio_watchdog_reset ();
#endif
    display_init ();
    pinio_watchdog_reset ();
    switch_init ();
    pinio_watchdog_reset ();
    flipper_init ();
    pinio_watchdog_reset ();
    lamp_init ();
    pinio_watchdog_reset ();
    device_init ();
    pinio_watchdog_reset ();
    free_timer_init ();
    pinio_watchdog_reset ();
    sound_init ();
    pinio_watchdog_reset ();
#if (MACHINE_PIC == 1)
    pic_init ();
    pinio_watchdog_reset ();
#endif

    /* task_init is somewhat special in that it transforms the system
     * from a single task into a multitasking one.  After this, tasks
     * can be spawned if need be.  A task is created for the current
     * thread of execution, too. */
    task_init ();
    pinio_watchdog_reset ();

#ifdef CONFIG_NATIVE
    /* Notify the simulator when the core OS is up and running. */
    sim_init ();
#endif

    /* Initialize the sound board early in a background
     * thread, since it involves polling for data back from it,
     * which may take unknown (or even infinite) time. */
    sys_init_pending_tasks++;
    task_create_gid (GID_SOUND_INIT, sound_board_init);

    /* Enable interrupts (IRQs and FIRQs).  Do this as soon as possible,
     * but not before all of the hardware modules are done. */
    enable_interrupts ();

    /* Initialize everything else.  Some of these are given explicitly
    to force a particular order, since callsets do not guarantee the
    order of invocation.  For most things the order doesn't matter. */
    deff_init ();
    leff_init ();
    test_init ();
    adj_init ();
    log_init ();
    callset_invoke (init);

    /* Check all adjustments and make sure that their checksums are valid.
    If problems are found, those adjustments will be made sane again. */
    csum_area_check_all ();

    /* Enable periodic processing. */
    periodic_ok = 1;
    task_sleep (TIME_16MS);

    /* The system is initialized from a hardware perspective.
     * Now, perform additional final initializations. */
    system_reset ();

    /* The system can run itself now, this task is done! */
    task_exit ();
}
Example #6
0
void timed_plunger_monitor (void)
{
    task_sleep_sec (7);
    VOIDCALL (plunger_sw_launch_button);
    task_exit ();
}