From f7454eb0736ffeed6d361a49ab6edf159c692493 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Wed, 1 Jan 2025 11:58:40 +0100 Subject: [PATCH] Remove `BIT` macro --- src/gpio.h | 1 - src/main.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gpio.h b/src/gpio.h index dbe3e33..3bc669e 100644 --- a/src/gpio.h +++ b/src/gpio.h @@ -21,7 +21,6 @@ struct gpio { #define GPIO_PORT_OFFSET (0x400U) #define GPIO(port) ((struct gpio*)(uintptr_t)(GPIO_BASE_ADDR + (GPIO_PORT_OFFSET * port))) -#define BIT(x) (1 << x) // Create a 16bit number from a port and pin #define PIN(port, num) ((((port) - 'A') << 8) | num) // get the lower byte from a PIN diff --git a/src/main.c b/src/main.c index 2479373..8c0edc1 100644 --- a/src/main.c +++ b/src/main.c @@ -79,7 +79,7 @@ int main(void) { (void) tim4_start(); uint16_t led = PIN('C', 13); // Blue LED - RCC->AHB1ENR |= BIT(PINPORT(led)); // Enable GPIO clock for LED + RCC->AHB1ENR |= (1 << PINPORT(led)); // Enable GPIO clock for LED gpio_set_mode(led, GPIO_MODE_OUTPUT); // Set blue LED to output mode uint16_t counter = TIM4->CNT;