Ejemplo n.º 1
0
void display_bios_status(int data, int max_data)
{
    static U8 first_flag = 1;

    if (first_flag)
    {
        display_clear(0);
        display_goto_xy(0, 0);
        display_string(VERSION);
        display_goto_xy(0, 1);
        display_string("================");
    }

    display_goto_xy(0, 2);
    display_string("BATT:");
    display_unsigned(battery_voltage()/100, 0);

    if (first_flag)
    {
        display_goto_xy(0, 3);
        display_string("UPLOAD: READY   ");
        first_flag = 0;
    }
    else
    {
        if (data >= UPLOAD_IN_PROGRESS)
        {
            display_goto_xy(0, 3);
            display_string("UPLOAD: PROGRESS");
            display_progress_bar(4, data, max_data);
        }
        else if (data == UPLOAD_FAILED)
        {
            display_goto_xy(0, 3);
            display_string("UPLOAD: FAILED  ");
        }
        else if (data == UPLOAD_FINISHED)
        {
            display_goto_xy(0, 3);
            display_string("UPLOAD: FINISHED");
            /* clear progress bar */
            display_progress_bar(4, 0, 100);
        }
    }
    display_update();
}
	/**
	 * Main constructor
	 *
	 * @param max the expected number of tasks to perform
	 * @param display_progress whether to display a progress bar in the console
	 */
	InterruptableProgressMonitor(unsigned long max = 1,  bool display_progress = true)  {
		reset(max, display_progress);
		display_progress_bar();
	}