aboutsummaryrefslogtreecommitdiff
path: root/stmhal
diff options
context:
space:
mode:
authorDamien George2014-04-21 20:18:06 +0100
committerDamien George2014-04-21 20:18:06 +0100
commit350cb6bf20caf22c7a2a5e9267f00d50d11acbdf (patch)
tree330252566e03eca4bc7ab7ed0d345f1d8323d71e /stmhal
parentef255e47c197b52c4d629f2a0709af187e97d540 (diff)
stmhal: Fix bug with pin GPIO reading.
Diffstat (limited to 'stmhal')
-rw-r--r--stmhal/pin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stmhal/pin.c b/stmhal/pin.c
index 3a1a0a2de..f6c79d5d2 100644
--- a/stmhal/pin.c
+++ b/stmhal/pin.c
@@ -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])) {