コード例 #1
0
ファイル: main.c プロジェクト: petrm/ChibiOS-GFX
int main(void) {
	halInit();
	chSysInit();

	gdispInit();

	tpInit(&TOUCHPADD1);
	tpCalibrate();

	gdispClear(Black);	

	while (TRUE) {
		gdispDrawPixel(tpReadX(), tpReadY(), Green);
	}
}
コード例 #2
0
ファイル: tp.c プロジェクト: cnc-club/linuxcnc
int tpCreate(TP_STRUCT * tp, int _queueSize, TC_STRUCT * tcSpace)
{
    if (0 == tp) {
	return -1;
    }

    if (_queueSize <= 0) {
	tp->queueSize = TP_DEFAULT_QUEUE_SIZE;
    } else {
	tp->queueSize = _queueSize;
    }

    /* create the queue */
    if (-1 == tcqCreate(&tp->queue, tp->queueSize, tcSpace)) {
	return -1;
    }

    /* init the rest of our data */
    return tpInit(tp);
}