/*
 * test program for gpio library (switch and led)
 * author hugo
 */
#include <bsplib.h>

void main(void)
{   
    /* system init */
    switch1_init();
    switch2_init();
    led2_init();
    led3_init();
    led4_init();
    led5_init();
    
    /* test application */
    while (1) {
        
        /* test delays and led D2*/
        led2_on();
        delay_200ms();
        led2_off();
        delay_200ms();
        
        /* test switchs and leds */
        if (switch2_read()) {
            led2_on();
            led3_on();        
        } else {
            led2_off();
            led3_off();        
        }
         
        if (switch1_read()) {
            led4_on();
            led5_on();        
        } else {
            led4_off();
            led5_off();        
        }   
    }  
}
