Skip to content

Commit 57e0225

Browse files
committed
STM32: gpio: factorize gpio_api.c and gpio_object.h
Let's make the code more common for gpios. The only difference between STM32 families is that BRR register may not be available. In case BRR is not available, we use the 16 left bits of BSRR instead. We could always use BSRR, but BRR saves one left-shift operation, so let's use it when available. By default we will consider using BRR, except for platforms that define GPIO_IP_WITHOUT_BRR.
1 parent 7a36614 commit 57e0225

File tree

21 files changed

+17
-1223
lines changed

21 files changed

+17
-1223
lines changed

targets/TARGET_STM/TARGET_STM32F0/gpio_object.h

Lines changed: 0 additions & 75 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F1/gpio_api.c

Lines changed: 0 additions & 79 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F1/gpio_object.h

Lines changed: 0 additions & 75 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F2/gpio_api.c

Lines changed: 0 additions & 76 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F2/gpio_object.h

Lines changed: 0 additions & 75 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F2/objects.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ struct can_s {
139139
int index;
140140
};
141141

142+
#define GPIO_IP_WITHOUT_BRR
142143
#include "gpio_object.h"
143144

144145
#ifdef __cplusplus

0 commit comments

Comments
 (0)