mirror of https://github.com/ARMmbed/mbed-os.git
Fixed GPIO read operation
parent
b632d8db46
commit
9f2a930f31
|
@ -37,7 +37,7 @@ void gpio_init(gpio_t *obj, PinName pin, PinDirection direction) {
|
|||
obj->pin = pin;
|
||||
LPC_GPIO_TypeDef *port_reg = ((LPC_GPIO_TypeDef *) (LPC_GPIO0_BASE + (((pin & 0xF000) >> PORT_SHIFT) * 0x10000)));
|
||||
|
||||
obj->reg_mask_read = &port_reg->MASKED_ACCESS[gpio_set(pin) + 1];
|
||||
obj->reg_mask_read = &port_reg->MASKED_ACCESS[1 << gpio_set(pin)];
|
||||
obj->reg_dir = &port_reg->DIR;
|
||||
obj->reg_write = &port_reg->DATA;
|
||||
|
||||
|
|
Loading…
Reference in New Issue