Skip to content

Commit

Permalink
[fix][lpc21] uart_tunnel: only toggle leds if they are available on t…
Browse files Browse the repository at this point in the history
…hat board
  • Loading branch information
flixr committed Sep 4, 2012
1 parent 66ccfac commit 60e6313
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf/airframes/ENAC/fixed-wing/weasel.xml
Expand Up @@ -49,6 +49,7 @@

<firmware name="setup">
<target name="setup_actuators" board="umarim_1.0"/>
<target name="tunnel" board="umarim_1.0"/>
</firmware>

<!-- commands section -->
Expand Down
6 changes: 6 additions & 0 deletions sw/airborne/arch/lpc21/uart_tunnel.c
Expand Up @@ -16,7 +16,9 @@ int main (int argc, char** argv) {
int tx_shadow=1, rx_shadow=1;
mcu_init();
led_init();
#if USE_LED_1
LED_ON(1);
#endif

/* TXD0 and TXD1 output */
SetBit(IO0DIR, TXD0_PIN);
Expand All @@ -36,7 +38,9 @@ int main (int argc, char** argv) {
SetBit(IO0CLR, TXD1_PIN);
}
tx_shadow = tx;
#if USE_LED_2
LED_TOGGLE(2);
#endif
}
rx = bit_is_set(IO0PIN, RXD1_PIN);
if (rx != rx_shadow) {
Expand All @@ -46,7 +50,9 @@ int main (int argc, char** argv) {
SetBit(IO0CLR, TXD0_PIN);
}
rx_shadow = rx;
#if USE_LED_3
LED_TOGGLE(3);
#endif
}
}
return 0;
Expand Down

0 comments on commit 60e6313

Please sign in to comment.