Skip to content
Snippets Groups Projects
Commit 350cb6bf authored by Damien George's avatar Damien George
Browse files

stmhal: Fix bug with pin GPIO reading.

parent ef255e47
Branches
Tags
No related merge requests found
...@@ -246,7 +246,7 @@ STATIC mp_obj_t pin_value(uint n_args, mp_obj_t *args) { ...@@ -246,7 +246,7 @@ STATIC mp_obj_t pin_value(uint n_args, mp_obj_t *args) {
pin_obj_t *self = args[0]; pin_obj_t *self = args[0];
if (n_args == 1) { if (n_args == 1) {
// get pin // 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 { } else {
// set pin // set pin
if (mp_obj_is_true(args[1])) { if (mp_obj_is_true(args[1])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment