aboutsummaryrefslogtreecommitdiff
path: root/system-clock/src/spin.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2018-01-16 00:23:35 -0700
committerJosh Rahm <joshuarahm@gmail.com>2018-01-16 00:23:35 -0700
commitedec50e6a918359190f8ca34b2148e3a3c637e40 (patch)
tree39641126769cbf8bfc29bdca503ab23a3801e206 /system-clock/src/spin.c
parentb679becb9d09b6e74bf1412e98132504f8467c2b (diff)
downloadstm32l4-edec50e6a918359190f8ca34b2148e3a3c637e40.tar.gz
stm32l4-edec50e6a918359190f8ca34b2148e3a3c637e40.tar.bz2
stm32l4-edec50e6a918359190f8ca34b2148e3a3c637e40.zip
Format all files and add a clang-format file.
Diffstat (limited to 'system-clock/src/spin.c')
-rw-r--r--system-clock/src/spin.c10
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;