mbed-src updated for BMD-200 evaluation board. Just pin numbers are updated.
Dependents: mbed_blinky-bmd-200 bmd-200_accel_demo firstRig
Fork of mbed-src by
Replacement for the "mbed" or "mbed-src" library when using the BMD-200 Evaluation kit. This library only remaps the pin names (i.e. LED1 points to p0.01 instead of p0.18, etc) as used by the BMD-200 Evaluation board (select the nRF51822_mkit platform). All other code is untouched.
Diff: common/gpio.c
- Revision:
- 160:6870f452afa4
- Parent:
- 127:ce7cebc0511f
- Child:
- 221:8276e3a4886f
--- a/common/gpio.c Mon Apr 14 10:30:07 2014 +0100 +++ b/common/gpio.c Mon Apr 14 11:30:06 2014 +0100 @@ -18,16 +18,20 @@ static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode) { gpio_init(gpio, pin); - gpio_dir(gpio, PIN_INPUT); - gpio_mode(gpio, mode); + if (pin != NC) { + gpio_dir(gpio, PIN_INPUT); + gpio_mode(gpio, mode); + } } static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value) { gpio_init(gpio, pin); - gpio_write(gpio, value); - gpio_dir(gpio, PIN_OUTPUT); - gpio_mode(gpio, mode); + if (pin != NC) { + gpio_write(gpio, value); + gpio_dir(gpio, PIN_OUTPUT); + gpio_mode(gpio, mode); + } } void gpio_init_in(gpio_t* gpio, PinName pin) { @@ -49,7 +53,8 @@ void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value) { if (direction == PIN_INPUT) { _gpio_init_in(gpio, pin, mode); - gpio_write(gpio, value); // we prepare the value in case it is switched later + if (pin != NC) + gpio_write(gpio, value); // we prepare the value in case it is switched later } else { _gpio_init_out(gpio, pin, mode, value); }