diff options
Diffstat (limited to 'src/kernel/gpio.c')
-rw-r--r-- | src/kernel/gpio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/kernel/gpio.c b/src/kernel/gpio.c index 0932e51..33423b9 100644 --- a/src/kernel/gpio.c +++ b/src/kernel/gpio.c @@ -27,7 +27,7 @@ static GPIO_TypeDef *gpio_ports[8] = { void gpio_svc(uint32_t *args) { - GPIO_TypeDef *port = gpio_ports[args[1] / 16]; + GPIO_TypeDef *port = gpio_ports[args[1] >> 4]; uint32_t pin = args[1] & 0xF; switch (args[0]) { @@ -46,6 +46,9 @@ void gpio_svc(uint32_t *args) case 4: gpio_dout(port, pin, args[2]); break; + case 5: + *((int *)args[2]) = gpio_din(port, pin); + break; } } |