aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-03-31 06:44:54 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-03-31 06:44:54 +0000
commitce46257ff297d19958b6303f30f69dd053fd9fa1 (patch)
tree734c6ffb5de537b7186ec4cd77c53d03f53603c7 /Projects
parentde8313cd9b7ac44b83a819ea7d4c1a00d16da7e4 (diff)
downloadlufa-ce46257ff297d19958b6303f30f69dd053fd9fa1.tar.gz
lufa-ce46257ff297d19958b6303f30f69dd053fd9fa1.tar.bz2
lufa-ce46257ff297d19958b6303f30f69dd053fd9fa1.zip
Add RelayBoard project patch from OBinou.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/RelayBoard/RelayBoard.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Projects/RelayBoard/RelayBoard.c b/Projects/RelayBoard/RelayBoard.c
index c3034178f..0936c4d7e 100644
--- a/Projects/RelayBoard/RelayBoard.c
+++ b/Projects/RelayBoard/RelayBoard.c
@@ -63,8 +63,8 @@ void SetupHardware(void)
USB_Init();
/* Initialize Relays */
- DDRC |= ALL_RELAYS;
- PORTC |= ALL_RELAYS;
+ DDRC |= ALL_RELAYS;
+ PORTC &= ~ALL_RELAYS;
}
@@ -95,13 +95,13 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
switch (USB_ControlRequest.wValue)
{
case 0x303:
- if (data[1]) PORTC |= RELAY1; else PORTC &= ~RELAY1; break;
+ if (data[1]) PORTC &= ~RELAY1; else PORTC |= RELAY1; break;
case 0x306:
- if (data[1]) PORTC |= RELAY2; else PORTC &= ~RELAY2; break;
+ if (data[1]) PORTC &= ~RELAY2; else PORTC |= RELAY2; break;
case 0x309:
- if (data[1]) PORTC |= RELAY3; else PORTC &= ~RELAY3; break;
+ if (data[1]) PORTC &= ~RELAY3; else PORTC |= RELAY3; break;
case 0x30c:
- if (data[1]) PORTC |= RELAY4; else PORTC &= ~RELAY4; break;
+ if (data[1]) PORTC &= ~RELAY4; else PORTC |= RELAY4; break;
default:
break;
}
@@ -121,13 +121,13 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
Endpoint_Write_Control_Stream_LE(serial, sizeof(serial));
break;
case 0x303:
- if (PORTC & RELAY1) data[1]=3; else data[1]=2; break;
+ if (PORTC & RELAY1) data[1] = 2; else data[1] = 3; break;
case 0x306:
- if (PORTC & RELAY2) data[1]=3; else data[1]=2; break;
+ if (PORTC & RELAY2) data[1] = 2; else data[1] = 3; break;
case 0x309:
- if (PORTC & RELAY3) data[1]=3; else data[1]=2; break;
+ if (PORTC & RELAY3) data[1] = 2; else data[1] = 3; break;
case 0x30c:
- if (PORTC & RELAY4) data[1]=3; else data[1]=2; break;
+ if (PORTC & RELAY4) data[1] = 2; else data[1] = 3; break;
default:
break;
}