Fixed GPIO read operation

pull/27/head
Toyomasa Watarai 2013-08-14 22:43:03 +09:00
parent b632d8db46
commit 9f2a930f31
1 changed files with 1 additions and 1 deletions

View File

@ -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;