int main(void) { halInit(); chSysInit(); gdispInit(); tpInit(&TOUCHPADD1); tpCalibrate(); gdispClear(Black); while (TRUE) { gdispDrawPixel(tpReadX(), tpReadY(), Green); } }
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); }