Esempio n. 1
0
void task_powerdown_stop()
{
	//Reinit all devices
	DEBUG("Restarting all devices\n");

	uart_stop();
	Setup();

	task_timer_setup();
	DEBUG("Restoring full speed uart\n");

	powerdown_lock.Unlock();
}
Esempio n. 2
0
void task_init()
{
	task_timer_setup();
	USB_CONNECTED_IRQ_ON;

	powerdown_lock.Unlock();

	//if ftest is not done
	if (!cfg_factory_passed())
		task_set(TASK_ACTIVE);

	//if is USB connected go directly to USB task
	if ((usb_state = USB_CONNECTED))
		task_set(TASK_USB);

	wdt_init(wdt_2s);
}
Esempio n. 3
0
void buttons_step()
{
    if (config.gui.disp_flags & CFG_DISP_FLIP)
    {
        button_handle(2, GpioRead(SWITCH1));
        button_handle(0, GpioRead(SWITCH3));
    }
    else
    {
        button_handle(0, GpioRead(SWITCH1));
        button_handle(2, GpioRead(SWITCH3));
    }
    button_handle(1, GpioRead(SWITCH2));

    if (buttons_state[0] > BS_IDLE || buttons_state[1] > BS_IDLE || buttons_state[2] > BS_IDLE)
        button_lock.Lock();
    else
        button_lock.Unlock();
}