don't really care for constants default tip
authorDarron Broad <darron@kewl.org>
Thu, 19 Mar 2015 20:33:44 +0000
changeset 4 343d36d8191d
parent 3 f66e5c3fc87f
don't really care for constants
miniblink.c
--- a/miniblink.c	Thu Mar 19 20:32:02 2015 +0000
+++ b/miniblink.c	Thu Mar 19 20:33:44 2015 +0000
@@ -72,9 +72,6 @@
 	gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO13);
 }
 
-#define BIT1  (1 << 1)
-#define BIT13 (1 << 13)
-
 int main(void)
 {
 	clock_setup();
@@ -83,9 +80,9 @@
 
 	/* Blink the LED (PB1) on the board and toggle PC13 (14). */
 	while (1) {
-		GPIOB_ODR ^= BIT1;
+		GPIOB_ODR ^= (1 << 1);
 
-		GPIOC_ODR ^= BIT13;
+		GPIOC_ODR ^= (1 << 13);
 
 		delay_ms(50);	/* 10 Hz */
 	}