This commit is contained in:
Pavol Rusnak 2011-04-27 04:04:40 +02:00
parent cb8ea5c0e5
commit 8ea47f27fc
2 changed files with 14 additions and 14 deletions

View file

@ -101,18 +101,18 @@ void SetOutReport (uint8_t dst[], uint32_t length)
}
void SwitchesSetup(uint8_t states) {
LPC_GPIO2->MASKED_ACCESS[1<<8] |= ((( states && 0x01) >> 0)<<8);
LPC_GPIO2->MASKED_ACCESS[1<<8] &= ((((states && 0x01) >> 0)<<8) | ~(1<<8));
LPC_GPIO2->MASKED_ACCESS[1<<9] |= ((( states && 0x02) >> 1)<<9);
LPC_GPIO2->MASKED_ACCESS[1<<9] &= ((((states && 0x02) >> 1)<<9) | ~(1<<9));
LPC_GPIO2->MASKED_ACCESS[1<<10] |= ((( states && 0x04) >> 2)<<10);
LPC_GPIO2->MASKED_ACCESS[1<<10] &= ((((states && 0x04) >> 2)<<10) | ~(1<<10));
LPC_GPIO2->MASKED_ACCESS[1<<11] |= ((( states && 0x08) >> 3)<<11);
LPC_GPIO2->MASKED_ACCESS[1<<11] &= ((((states && 0x08) >> 3)<<11) | ~(1<<11));
LPC_GPIO3->MASKED_ACCESS[1<<0] |= ((( states && 0x10) >> 4)<<0);
LPC_GPIO3->MASKED_ACCESS[1<<0] &= ((((states && 0x10) >> 4)<<0) | ~(1<<0));
LPC_GPIO3->MASKED_ACCESS[1<<1] |= ((( states && 0x20) >> 5)<<1);
LPC_GPIO3->MASKED_ACCESS[1<<1] &= ((((states && 0x20) >> 5)<<1) | ~(1<<1));
LPC_GPIO2->MASKED_ACCESS[1<<8] |= ((( states & 0x01) >> 0)<<8);
LPC_GPIO2->MASKED_ACCESS[1<<8] &= ((((states & 0x01) >> 0)<<8) | ~(1<<8));
LPC_GPIO2->MASKED_ACCESS[1<<9] |= ((( states & 0x02) >> 1)<<9);
LPC_GPIO2->MASKED_ACCESS[1<<9] &= ((((states & 0x02) >> 1)<<9) | ~(1<<9));
LPC_GPIO2->MASKED_ACCESS[1<<10] |= ((( states & 0x04) >> 2)<<10);
LPC_GPIO2->MASKED_ACCESS[1<<10] &= ((((states & 0x04) >> 2)<<10) | ~(1<<10));
LPC_GPIO2->MASKED_ACCESS[1<<11] |= ((( states & 0x08) >> 3)<<11);
LPC_GPIO2->MASKED_ACCESS[1<<11] &= ((((states & 0x08) >> 3)<<11) | ~(1<<11));
LPC_GPIO3->MASKED_ACCESS[1<<0] |= ((( states & 0x10) >> 4)<<0);
LPC_GPIO3->MASKED_ACCESS[1<<0] &= ((((states & 0x10) >> 4)<<0) | ~(1<<0));
LPC_GPIO3->MASKED_ACCESS[1<<1] |= ((( states & 0x20) >> 5)<<1);
LPC_GPIO3->MASKED_ACCESS[1<<1] &= ((((states & 0x20) >> 5)<<1) | ~(1<<1));
}
void PinInit() {

View file

@ -27,9 +27,9 @@ class ModuleDebugWidget(QWidget):
QObject.connect(self.ui.pushPin3, SIGNAL("clicked(bool)"), self.on_pins_changed)
# real device:
self.dev = Device()
# self.dev = Device()
# fake device:
# self.dev = Device(True)
self.dev = Device(True)
self.timer = QTimer()
QObject.connect(self.timer, SIGNAL("timeout()"), self.read_inputs)