1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 06:41:53 +02:00

labsw/fw/: make loop use all front panel elements; set CH1/2 opto to open-drain

This commit is contained in:
Werner Almesberger 2011-09-05 14:10:42 -03:00
parent 1717be8826
commit 149be29ac7

View File

@ -28,10 +28,18 @@ static void init_io(void)
LED_MAIN_R_MODE |= 1 << LED_MAIN_R_BIT;
LED_MAIN_G_MODE |= 1 << LED_MAIN_G_BIT;
LED_CH1_R_MODE |= 1 << LED_CH1_R_BIT;
LED_CH1_G_MODE |= 1 << LED_CH1_G_BIT;
LED_CH2_R_MODE |= 1 << LED_CH2_R_BIT;
LED_CH2_G_MODE |= 1 << LED_CH2_G_BIT;
CH1_RELAY = 0;
CH2_RELAY = 0;
CH1_RELAY_MODE |= 1 << CH1_RELAY_BIT;
CH2_RELAY_MODE |= 1 << CH2_RELAY_BIT;
/* @@@ we need this while using the boot loader of cntr */
CH1_OPT_MODE &= ~(1 << CH1_OPT_BIT);
CH2_OPT_MODE &= ~(1 << CH2_OPT_BIT);
}
@ -46,13 +54,31 @@ void main(void)
if (!BUT_MAIN) {
LED_MAIN_R = 1;
LED_MAIN_G = 0;
CH1_RELAY = 1;
CH2_RELAY = 1;
} else {
LED_MAIN_R = 0;
LED_MAIN_G = 1;
}
if (!BUT_CH1) {
LED_CH1_R = 1;
LED_CH1_G = 0;
CH1_RELAY = 1;
CH1_OPT = 0;
} else {
LED_CH1_R = 0;
LED_CH1_G = 1;
CH1_RELAY = 0;
CH1_OPT = 1;
}
if (!BUT_CH2) {
LED_CH2_R = 1;
LED_CH2_G = 0;
CH2_RELAY = 1;
CH2_OPT = 0;
} else {
LED_CH2_R = 0;
LED_CH2_G = 1;
CH2_RELAY = 0;
CH2_OPT = 1;
}
usb_poll();
}