File tree 1 file changed +0
-16
lines changed
1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,9 @@ void pinMode(uint8_t pin, PinMode mode)
41
41
42
42
if (mode == OUTPUT ){
43
43
44
- /* Save state */
45
- uint8_t status = SREG ;
46
- cli ();
47
-
48
44
/* Configure direction as output */
49
45
port -> DIRSET = bit_mask ;
50
46
51
- /* Restore state */
52
- SREG = status ;
53
-
54
47
} else { /* mode == INPUT or INPUT_PULLUP */
55
48
56
49
uint8_t bit_pos = digitalPinToBitPosition (pin );
@@ -151,15 +144,10 @@ void digitalWrite(uint8_t pin, PinStatus val)
151
144
152
145
/* Get port */
153
146
PORT_t * port = digitalPinToPortStruct (pin );
154
- if (port == NULL ) return ;
155
147
156
148
/* Output direction */
157
149
if (port -> DIR & bit_mask ){
158
150
159
- /* Save system status and disable interrupts */
160
- uint8_t status = SREG ;
161
- cli ();
162
-
163
151
/* Set output to value */
164
152
if (val == LOW ) { /* If LOW */
165
153
port -> OUTCLR = bit_mask ;
@@ -171,9 +159,6 @@ void digitalWrite(uint8_t pin, PinStatus val)
171
159
port -> OUTSET = bit_mask ;
172
160
}
173
161
174
- /* Restore system status */
175
- SREG = status ;
176
-
177
162
/* Input direction */
178
163
} else {
179
164
/* Old implementation has side effect when pin set as input -
@@ -218,7 +203,6 @@ PinStatus digitalRead(uint8_t pin)
218
203
219
204
/* Get port and check valid port */
220
205
PORT_t * port = digitalPinToPortStruct (pin );
221
- if (port == NULL ) return LOW ;
222
206
223
207
/* Read pin value from PORTx.IN register */
224
208
if (port -> IN & bit_mask ){
You can’t perform that action at this time.
0 commit comments