X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=board%2Fkaro%2Ftx28%2Ftx28.c;h=f1fca4a17a229438ccc9ed2de77161049c3605b5;hp=4f524b4ad5771e6bc78784a670e288d3cbc93f6a;hb=22b815e25c06ab2f1920e9e1c531fd8fc36f442f;hpb=6b28b9656c84a94cd415681ce21d2d70edb04ff3 diff --git a/board/karo/tx28/tx28.c b/board/karo/tx28/tx28.c index 4f524b4ad5..f1fca4a17a 100644 --- a/board/karo/tx28/tx28.c +++ b/board/karo/tx28/tx28.c @@ -362,14 +362,18 @@ enum { LED_STATE_INIT = -1, LED_STATE_OFF, LED_STATE_ON, + LED_STATE_DISABLED, }; +static int led_state = LED_STATE_DISABLED; + void show_activity(int arg) { - static int led_state = LED_STATE_INIT; static ulong last; - if (led_state == LED_STATE_INIT) { + if (led_state == LED_STATE_DISABLED) { + return; + } else if (led_state == LED_STATE_INIT) { last = get_timer(0); gpio_set_value(TX28_LED_GPIO, 1); led_state = LED_STATE_ON; @@ -378,10 +382,11 @@ void show_activity(int arg) last = get_timer(0); if (led_state == LED_STATE_ON) { gpio_set_value(TX28_LED_GPIO, 0); + led_state = LED_STATE_OFF; } else { gpio_set_value(TX28_LED_GPIO, 1); + led_state = LED_STATE_ON; } - led_state = 1 - led_state; } } } @@ -819,6 +824,7 @@ static void stk5_board_init(void) static void stk5v3_board_init(void) { + led_state = LED_STATE_INIT; stk5_board_init(); }