aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-11-04 04:36:35 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-11-04 04:36:35 +0000
commit5043a7d03cc415665a32dbd4735f959d86bd700a (patch)
tree1c795d4eb1a14ab8ddde254937a64d109e7a2960
parent99fd2635994d586816fe1b64e773ef23d60dc20c (diff)
beautify code, no functional changes
-rw-r--r--firmware/firmware.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/firmware/firmware.c b/firmware/firmware.c
index 610c2d5..e5f785a 100644
--- a/firmware/firmware.c
+++ b/firmware/firmware.c
@@ -24,10 +24,11 @@
#include <avr/wdt.h>
#include <util/setbaud.h> /* depends on BAUD & F_CPU env vars */
-#define TIMEOUT (F_CPU >> 4) /* ~ 1 sec */
-#define PUTCH(c) do { \
- loop_until_bit_is_set(UCSR0A, UDRE0); UDR0 = (c); \
+#define TIMEOUT (F_CPU >> 4) /* ~1 sec */
+#define PUTCH(c) do { \
+ loop_until_bit_is_set(UCSR0A, UDRE0); UDR0 = (c); \
} while (0)
+#define GOTO(x) ((void(*)(void))(x))()
union {
uint16_t word;
@@ -52,11 +53,11 @@ main(void)
UCSR0B = _BV(RXEN0) | _BV(TXEN0);
UBRR0H = UBRRH_VALUE;
UBRR0L = UBRRL_VALUE;
- #if USE_2X
+#if USE_2X
UCSR0A |= _BV(U2X0);
- #else
+#else
UCSR0A &= ~_BV(U2X0);
- #endif
+#endif
PUTCH('+'); /* say hallo */
for (;;) {
@@ -108,7 +109,7 @@ main(void)
reboot:
boot_rww_enable();
- ((void(*)(void))0)();
+ GOTO(0);
/* NOTREACHED */
return 0;