Exemplo n.º 1
0
static void showTouches_Click(GL_PageControls_TypeDef* pThis)
{
    // Get calibrated touched location
    uint16_t x, y;
    TS_GetTouchEventCoords(&x, &y);
    s_haveTouch = 1;

    // Count if same location
    if ((abs(s_lastTouchX - x) < SAME_LOCATION_THRESHOLD)
            && (abs(s_lastTouchY - y) < SAME_LOCATION_THRESHOLD)) {
        s_sameLocationCounter++;
    } else {
        s_sameLocationCounter = 0;
    }
    if (s_sameLocationCounter >= MAX_SAME_LOCATION_COUNT) {
        s_sameLocationCounter = 0;
        s_haveTouch = 0;
        Screen_ShowMainScreen();
        return;
    }

    // Copy over values:
    s_lastTouchX = x;
    s_lastTouchY = y;

    // Draw it
    showTouches_Draw(pThis, 1);
}
Exemplo n.º 2
0
/**
 * Callbacks
 */
static void modeButton_Click(GL_PageControls_TypeDef* pThis)
{
	uint16_t userMode = pThis->ID - ID_MODEBTN_START;
	assert(userMode >= 0 && userMode <= USERMODE_NUM_MODES);

	Mode_SetCurrentMode(userMode);
	Screen_ShowMainScreen();
}
Exemplo n.º 3
0
void Screen_Done() {

	Options_WriteToEEPROM();
	Screen_ShowMainScreen();
	Screen_SetScreenMode(MAIN);
}