cpldjtagprog: blink all LEDs on success. This helps with factory test.

This commit is contained in:
Michael Ossmann
2013-03-23 17:47:04 -06:00
parent ddad4873b2
commit 4793030848

View File

@ -34,7 +34,6 @@ int main(void)
{ {
int i; int i;
int error; int error;
int LED;
pin_setup(); pin_setup();
@ -46,26 +45,22 @@ int main(void)
/* program test bitstream to CPLD */ /* program test bitstream to CPLD */
error = cpld_jtag_program(sgpio_if_xsvf_len, &sgpio_if_xsvf[0]); error = cpld_jtag_program(sgpio_if_xsvf_len, &sgpio_if_xsvf[0]);
if(error == 0)
{
/* blink only LED1 (Green) on success */
LED = PIN_LED1;
}else
{
/* blink LED3 (Red) on error */
LED = PIN_LED3;
}
gpio_clear(PORT_LED1_3, ALL_LEDS); /* All LEDs off */ gpio_clear(PORT_LED1_3, ALL_LEDS); /* All LEDs off */
while (1) if (error == 0) {
{ /* blink LED1, LED2, and LED3 on success */
gpio_set(PORT_LED1_3, LED); /* LEDs on */ while (1) {
for (i = 0; i < WAIT_LOOP_DELAY; i++) /* Wait a bit. */ gpio_set(PORT_LED1_3, ALL_LEDS); /* LEDs on */
__asm__("nop"); for (i = 0; i < WAIT_LOOP_DELAY; i++) /* Wait a bit. */
gpio_clear(PORT_LED1_3, LED); /* LED off */ __asm__("nop");
for (i = 0; i < WAIT_LOOP_DELAY; i++) /* Wait a bit. */ gpio_clear(PORT_LED1_3, ALL_LEDS); /* LEDs off */
__asm__("nop"); for (i = 0; i < WAIT_LOOP_DELAY; i++) /* Wait a bit. */
__asm__("nop");
}
} else {
/* LED3 (Red) steady on error */
gpio_set(PORT_LED1_3, PIN_LED3); /* LEDs on */
while (1);
} }
return 0; return 0;