Skip to content

Commit

Permalink
Fixed GPIO read operation
Browse files Browse the repository at this point in the history
  • Loading branch information
toyowata committed Aug 14, 2013
1 parent b632d8d commit 9f2a930
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9f2a930

Please sign in to comment.