File tree 1 file changed +10
-13
lines changed
1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -145,22 +145,19 @@ void digitalWrite(uint8_t pin, PinStatus val)
145
145
/* Get port */
146
146
PORT_t * port = digitalPinToPortStruct (pin );
147
147
148
- /* Output direction */
149
- if (port -> DIR & bit_mask ){
150
-
151
- /* Set output to value */
152
- if (val == LOW ) { /* If LOW */
153
- port -> OUTCLR = bit_mask ;
148
+ /* Set output to value */
149
+ if (val == LOW ) { /* If LOW */
150
+ port -> OUTCLR = bit_mask ;
154
151
155
- } else if (val == CHANGE ) { /* If TOGGLE */
156
- port -> OUTTGL = bit_mask ;
157
- /* If HIGH OR > TOGGLE */
158
- } else {
159
- port -> OUTSET = bit_mask ;
160
- }
152
+ } else if (val == CHANGE ) { /* If TOGGLE */
153
+ port -> OUTTGL = bit_mask ;
154
+ /* If HIGH OR > TOGGLE */
155
+ } else {
156
+ port -> OUTSET = bit_mask ;
157
+ }
161
158
162
159
/* Input direction */
163
- } else {
160
+ if ( port -> DIR & bit_mask ) {
164
161
/* Old implementation has side effect when pin set as input -
165
162
pull up is enabled if this function is called.
166
163
Should we purposely implement this side effect?
You can’t perform that action at this time.
0 commit comments