diff --git a/firmware/src/edubrm.c b/firmware/src/edubrm.c index 2f6cfe7..b41e133 100644 --- a/firmware/src/edubrm.c +++ b/firmware/src/edubrm.c @@ -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() { diff --git a/software/modules/ModuleDebug.py b/software/modules/ModuleDebug.py index d892fc8..d601986 100644 --- a/software/modules/ModuleDebug.py +++ b/software/modules/ModuleDebug.py @@ -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)