예제 #1
0
void Canvas_endDraw(void)
{
    CHECK_DRAWING(1);

    int rCol_UP = -1;
    int rCol_DOWN = -1;

    char setPosManually = originRow || originColumn;

    int y;
    for (int yi = 0; yi < height / 2; yi++)
    {
        y = yi;
        if (yOrientation)
        {
            y = (height / 2) - yi - 1;
        }

        if (setPosManually)
        {
            Console_setCursorPosition(originRow + yi, originColumn);
        }

        for (int x = 0; x < width; x++)
        {
            int newCol_UP = CANVAS_AT(x, y * 2);

            if (newCol_UP != rCol_UP)
            {
                printf(yOrientation ? SET_COL_BG : SET_COL_FG, newCol_UP);
                rCol_UP = newCol_UP;
            }

            int newCol_DOWN = CANVAS_AT(x, y * 2 + 1);

            if (newCol_DOWN != rCol_DOWN)
            {
                printf(yOrientation ? SET_COL_FG : SET_COL_BG, newCol_DOWN);
                rCol_DOWN = newCol_DOWN;
            }

            fwrite("\xE2\x96\x80", 1, 3, stdout);
        }

        if (!setPosManually)
        {
            fwrite("\n", 1, 1, stdout);
        }
    }
    Console_reset();
    Console_showCursor();

    startedDrawing = 0;
}
예제 #2
0
파일: console.c 프로젝트: kerteszsasa/AVR
//****************************************************************************************************
void Incoming_char(char c){

		Console_reset(c);
		Console_help(c);
		Console_SetMin(c);
		Console_SetMax(c);
		Console_SetFreq(c);
		
		Console_xxx(c);

	
}