We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1883e3e + da33244 commit 97a90b7Copy full SHA for 97a90b7
hardware/msp430/cores/msp430/wiring_digital.c
@@ -79,9 +79,17 @@ void digitalWrite(uint8_t pin, uint8_t val)
79
uint8_t bit = digitalPinToBitMask(pin);
80
uint8_t port = digitalPinToPort(pin);
81
volatile uint16_t *out;
82
+ volatile uint16_t *sel;
83
84
if (port == NOT_A_PORT) return;
85
86
+ /*
87
+ * Clear bit in PxSEL register to select GPIO function. Other functions like analogWrite(...)
88
+ * will set this bit so need to clear it.
89
+ */
90
+ sel = portSelRegister(port); /* get the port function select register address */
91
+ *sel &= ~bit; /* clear bit in pin function select register */
92
+
93
out = portOutputRegister(port);
94
95
if (val == LOW) {
0 commit comments