File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
TARGET_ARM_FM/TARGET_FVP_MPS2 Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ uint32_t gpio_set(PinName pin)
27
27
// with the object created for the pin
28
28
void gpio_init (gpio_t * obj , PinName pin )
29
29
{
30
+ obj -> pin = pin ;
30
31
if (pin == NC ) {
31
32
return ;
32
33
} else {
33
34
int pin_value = 0 ;
34
- obj -> pin = pin ;
35
35
if (pin <= 15 ) {
36
36
pin_value = pin ;
37
37
} else if (pin >= 16 && pin <= 31 ) {
Original file line number Diff line number Diff line change @@ -101,6 +101,13 @@ void gpio_init(gpio_t *obj, PinName pin)
101
101
{
102
102
struct arm_gpio_dev_t * gpio_dev ;
103
103
104
+ if (pin == NC ) {
105
+ obj -> pin_number = NC ;
106
+ obj -> gpio_dev = NULL ;
107
+ obj -> mps2_io_dev = NULL ;
108
+ return ;
109
+ }
110
+
104
111
if (pin >= EXP0 && pin <= EXP51 ) {
105
112
/* GPIO pins */
106
113
switch (GPIO_DEV_NUMBER (pin )) {
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ uint32_t gpio_set(PinName pin) {
25
25
// this links the board control bits for each pin
26
26
// with the object created for the pin
27
27
void gpio_init (gpio_t * obj , PinName pin ) {
28
+ obj -> pin = pin ;
28
29
if (pin == NC ){ return ;}
29
30
else {
30
31
int pin_value = 0 ;
31
- obj -> pin = pin ;
32
32
if (pin <=15 ){
33
33
pin_value = pin ;
34
34
}else if (pin >= 16 && pin <= 31 ){
You can’t perform that action at this time.
0 commit comments