Commit 350cb6bf authored by Damien George's avatar Damien George
Browse files

stmhal: Fix bug with pin GPIO reading.

parent ef255e47
......@@ -246,7 +246,7 @@ STATIC mp_obj_t pin_value(uint n_args, mp_obj_t *args) {
pin_obj_t *self = args[0];
if (n_args == 1) {
// get pin
return MP_OBJ_NEW_SMALL_INT((self->gpio->IDR >> self->port) & 1);
return MP_OBJ_NEW_SMALL_INT((self->gpio->IDR >> self->pin) & 1);
} else {
// set pin
if (mp_obj_is_true(args[1])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment