File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
ports/raspberrypi/common-hal/microcontroller Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 28
28
29
29
#include "common-hal/microcontroller/__init__.h"
30
30
#include "shared-bindings/microcontroller/Pin.h"
31
- #include "bindings/cyw43/__init__.h"
32
31
33
32
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
34
33
35
34
#if CIRCUITPY_CYW43
35
+ #include "bindings/cyw43/__init__.h"
36
36
#include "pico/cyw43_arch.h"
37
- #endif
38
-
39
- STATIC uint32_t never_reset_pins ;
40
37
41
38
bool cyw_ever_init ;
42
39
static uint32_t cyw_pin_claimed ;
43
40
41
+ void reset_pin_number_cyw (uint8_t pin_no ) {
42
+ cyw_pin_claimed &= ~(1 << pin_no );
43
+ }
44
+ #endif
45
+
46
+ STATIC uint32_t never_reset_pins ;
47
+
44
48
void reset_all_pins (void ) {
45
49
for (size_t i = 0 ; i < TOTAL_GPIO_COUNT ; i ++ ) {
46
50
if ((never_reset_pins & (1 << i )) != 0 ) {
@@ -82,10 +86,6 @@ void reset_pin_number(uint8_t pin_number) {
82
86
hw_set_bits (& padsbank0_hw -> io [pin_number ], PADS_BANK0_GPIO0_OD_BITS );
83
87
}
84
88
85
- void reset_pin_number_cyw (uint8_t pin_no ) {
86
- cyw_pin_claimed &= ~(1 << pin_no );
87
- }
88
-
89
89
void common_hal_never_reset_pin (const mcu_pin_obj_t * pin ) {
90
90
never_reset_pin_number (pin -> number );
91
91
}
Original file line number Diff line number Diff line change 34
34
35
35
#include "peripherals/pins.h"
36
36
37
- extern bool cyw_ever_init ;
38
-
39
37
void reset_all_pins (void );
40
38
// reset_pin_number takes the pin number instead of the pointer so that objects don't
41
39
// need to store a full pointer.
42
40
void reset_pin_number (uint8_t pin_number );
43
- void reset_pin_number_cyw (uint8_t pin_number );
44
41
void never_reset_pin_number (uint8_t pin_number );
45
42
void claim_pin (const mcu_pin_obj_t * pin );
46
43
bool pin_number_is_free (uint8_t pin_number );
47
44
45
+ #if CIRCUITPY_CYW43
46
+ extern bool cyw_ever_init ;
47
+ void reset_pin_number_cyw (uint8_t pin_number );
48
+ #endif
49
+
48
50
#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_MICROCONTROLLER_PIN_H
You can’t perform that action at this time.
0 commit comments