Example #1
0
void keyboardInit()
{
	extKIrqHandler = 0;
	kBuffer = 16;
	int x;
	/*
	 * set 5-8 lines to input with pull down,
	 * detecting rising edge
	 */
	for (x = 5; x <= 8; x++) {
		setGpioFunct(pinToGpio[x], GPINPUT);
		setPull(pinToGpio[x], GPDOWN);
		setDetect(pinToGpio[x], GPENABLE, GPRISE);
	}
	/*
	 * turn 1-4 lines high to allow interrupt
	 * to be generated
	 */
	for (x = 1; x <= 4; x++) {
		setGpioFunct(pinToGpio[x], GPOUTPUT);
		setPin(pinToGpio[x]);
		setPull(pinToGpio[x], GPDOWN);
	}
	/*
	 * sets interrupt controller
	 */
	*irqEnable2 = ((1 << 20) | (1 << 19) | (1 << 18) | (1 << 17));
	/*
	 * takes care of CPSR
	 */
	irqEnable();
	return;
}
Example #2
0
int PainterWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setDetect(); break;
        case 1: update(); break;
        case 2: setStart(); break;
        case 3: setReset(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}