diff options
Diffstat (limited to 'system-clock/src/spin.c')
-rw-r--r-- | system-clock/src/spin.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/system-clock/src/spin.c b/system-clock/src/spin.c index f17f678..fbd16b6 100644 --- a/system-clock/src/spin.c +++ b/system-clock/src/spin.c @@ -1,13 +1,12 @@ #include "spin.h" -#include "gpio.h" #include "delay.h" +#include "gpio.h" #define SHORT_DELAY 200000 -#define LONG_DELAY (SHORT_DELAY * 2) +#define LONG_DELAY (SHORT_DELAY * 2) static void flash_bit( - uint32_t base, - gpio_output_pin_t out_pin, + uint32_t base, gpio_output_pin_t out_pin, uint8_t bit /* 0 => 0, non-zero => 1 */) { pin_on(out_pin); @@ -26,7 +25,7 @@ void spin(uint32_t base, uint8_t c) __IO gpio_port_t* port_b = enable_gpio(GPIO_PORT_B); gpio_output_pin_t pin3 = set_gpio_pin_output(port_b, PIN_3); - for(;;) { + for (;;) { code = c; flash_bit(base, pin3, code & 0x80); code <<= 1; @@ -36,7 +35,6 @@ void spin(uint32_t base, uint8_t c) code <<= 1; flash_bit(base, pin3, code & 0x80); - code <<= 1; flash_bit(base, pin3, code & 0x80); code <<= 1; |