File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,16 +290,14 @@ STATIC void pin_obj_configure (const pin_obj_t *self) {
290290 default :
291291 break ;
292292 }
293-
293+ // configure the direction
294+ MAP_GPIODirModeSet (self -> port , self -> bit , direction );
294295 // set the pin value
295296 if (self -> value ) {
296297 MAP_GPIOPinWrite (self -> port , self -> bit , self -> bit );
297298 } else {
298299 MAP_GPIOPinWrite (self -> port , self -> bit , 0 );
299300 }
300-
301- // configure the direction
302- MAP_GPIODirModeSet (self -> port , self -> bit , direction );
303301 }
304302 // now set the alternate function
305303 MAP_PinModeSet (self -> pin_num , self -> af );
Original file line number Diff line number Diff line change 1- """ This test need a set of pins which can be set as inputs and have no external
2- pull up or pull down connected.
1+ """
2+ This test need a set of pins which can be set as inputs and have no external
3+ pull up or pull down connected.
4+ GP12 and GP17 must be connected together
35"""
46from machine import Pin
57import os
1416else :
1517 raise Exception ('Board not supported!' )
1618
19+ # test initial value
20+ p = Pin ('GP12' , Pin .IN )
21+ Pin ('GP17' , Pin .OUT , value = 1 )
22+ print (p () == 1 )
23+ Pin ('GP17' , Pin .OUT , value = 0 )
24+ print (p () == 0 )
25+
1726def test_noinit ():
1827 for p in pin_map :
1928 pin = Pin (p )
Original file line number Diff line number Diff line change 1+ True
2+ True
131
241
351
You can’t perform that action at this time.
0 commit comments