Skip to content
Snippets Groups Projects
Commit 583ece21 authored by Daniel Friesel's avatar Daniel Friesel
Browse files

MSP430FR5969: Disable pull-ups when configuring pin as input w/o pull-up

parent 52f23fad
No related branches found
No related tags found
No related merge requests found
...@@ -66,14 +66,19 @@ class GPIO { ...@@ -66,14 +66,19 @@ class GPIO {
inline void input(unsigned char const pin) { inline void input(unsigned char const pin) {
if (pin < p2_0) { if (pin < p2_0) {
P1DIR &= ~(1 << pin); P1DIR &= ~(1 << pin);
P1REN &= ~(1 << pin);
} else if (pin < p3_0) { } else if (pin < p3_0) {
P2DIR &= ~(1 << (pin - p2_0)); P2DIR &= ~(1 << (pin - p2_0));
P2REN &= ~(1 << (pin - p2_0));
} else if (pin < p4_0) { } else if (pin < p4_0) {
P3DIR &= ~(1 << (pin - p3_0)); P3DIR &= ~(1 << (pin - p3_0));
P3REN &= ~(1 << (pin - p3_0));
} else if (pin < pj_0) { } else if (pin < pj_0) {
P4DIR &= ~(1 << (pin - p4_0)); P4DIR &= ~(1 << (pin - p4_0));
P4REN &= ~(1 << (pin - p4_0));
} else if (pin < PIN_INVALID) { } else if (pin < PIN_INVALID) {
PJDIR &= ~(1 << (pin - pj_0)); PJDIR &= ~(1 << (pin - pj_0));
PJREN &= ~(1 << (pin - pj_0));
} }
} }
inline void input(unsigned char const pin, unsigned char const pull) { inline void input(unsigned char const pin, unsigned char const pull) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment