Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/gpio_api.c
- Revision:
- 174:8bb9f3a33240
- Parent:
- 113:65a335a675de
- Child:
- 227:7bd0639b8911
diff -r 033f1c328f6e -r 8bb9f3a33240 targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/gpio_api.c
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/gpio_api.c Mon Apr 28 18:15:06 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/gpio_api.c Tue Apr 29 11:15:07 2014 +0100
@@ -33,7 +33,7 @@
extern uint32_t Set_GPIO_Clock(uint32_t port_idx);
-uint32_t gpio_set(PinName pin) {
+uint32_t gpio_set(PinName pin) {
if (pin == NC) return 0;
pin_function(pin, STM_PIN_DATA(GPIO_Mode_IN, 0, GPIO_PuPd_NOPULL, 0xFF));
@@ -45,11 +45,11 @@
if (pin == NC) return;
uint32_t port_index = STM_PORT(pin);
-
+
// Enable GPIO clock
uint32_t gpio_add = Set_GPIO_Clock(port_index);
GPIO_TypeDef *gpio = (GPIO_TypeDef *)gpio_add;
-
+
// Fill GPIO object structure for future use
obj->pin = pin;
obj->mask = gpio_set(pin);
@@ -65,8 +65,7 @@
void gpio_dir(gpio_t *obj, PinDirection direction) {
if (direction == PIN_OUTPUT) {
pin_function(obj->pin, STM_PIN_DATA(GPIO_Mode_OUT, GPIO_OType_PP, GPIO_PuPd_NOPULL, 0xFF));
- }
- else { // PIN_INPUT
+ } else { // PIN_INPUT
pin_function(obj->pin, STM_PIN_DATA(GPIO_Mode_IN, 0, GPIO_PuPd_NOPULL, 0xFF));
}
}
