summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2012-10-13 17:23:25 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2012-10-13 17:23:25 +0200
commita233603254fad2736243bd9857ce52d3defbfd7b (patch)
tree210f4c5f39845fc51e4e4b4b86e5692de506fa24
parenta5fe4e9378ec4f7787a989e3b31ed1729a631905 (diff)
GPIO speed setting is only valid for F4.
-rw-r--r--gpio/pin.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gpio/pin.h b/gpio/pin.h
index aede480..c85de7f 100644
--- a/gpio/pin.h
+++ b/gpio/pin.h
@@ -86,7 +86,9 @@ class Pin {
}
void set_speed(Speed s) {
+ #if defined(STM32F4)
g.OSPEEDR = (g.OSPEEDR & ~(3 << (n * 2))) | s << (n * 2);
+ #endif
}
void on() {