File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 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)
145145 /* Get port */
146146 PORT_t * port = digitalPinToPortStruct (pin );
147147
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 ;
154151
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+ }
161158
162159 /* Input direction */
163- } else {
160+ if ( port -> DIR & bit_mask ) {
164161 /* Old implementation has side effect when pin set as input -
165162 pull up is enabled if this function is called.
166163 Should we purposely implement this side effect?
You can’t perform that action at this time.
0 commit comments