File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
ports/atmel-samd/common-hal/microcontroller Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -52,12 +52,9 @@ void reset_all_pins(void) {
52
52
uint32_t pin_mask [PORT_BITS / 32 + 1 ] = PORT_OUT_IMPLEMENTED ;
53
53
54
54
// Do not full reset USB or SWD lines.
55
- pin_mask [0 ] &= ~(PORT_PA24 | PORT_PA25 | PORT_PA30 );
55
+ pin_mask [0 ] &= ~(PORT_PA24 | PORT_PA25 | PORT_PA30 | PORT_PA31 );
56
56
57
- // The SWO pin changes between the 21 and 51.
58
- #ifdef PORT_PB30H_CM4_SWO
59
- pin_mask [1 ] &= ~(PORT_PB30 );
60
- #else
57
+ #ifdef SAMD21
61
58
pin_mask [0 ] &= ~(PORT_PA31 );
62
59
#endif
63
60
@@ -71,11 +68,10 @@ void reset_all_pins(void) {
71
68
#endif
72
69
73
70
// Configure SWD
74
- gpio_set_pin_direction (PIN_PA30 , GPIO_DIRECTION_OUT );
75
71
#ifdef SAMD51
76
- gpio_set_pin_function (PIN_PB30 , MUX_PB30H_CM4_SWO );
77
- gpio_set_pin_direction ( PIN_PB30 , GPIO_DIRECTION_OUT );
78
- gpio_set_pin_function ( PIN_PB30 , MUX_PB30H_CM4_SWO );
72
+ gpio_set_pin_function (PIN_PA30 , MUX_PA30H_CM4_SWCLK );
73
+ // SWDIO will be automatically switched on PA31 when a signal is input on
74
+ // SWCLK.
79
75
#endif
80
76
#ifdef SAMD21
81
77
//gpio_set_pin_function(PIN_PA30, GPIO_PIN_FUNCTION_G);
@@ -126,7 +122,7 @@ void reset_pin(uint8_t pin) {
126
122
127
123
if (pin == PIN_PA30
128
124
#ifdef SAMD51
129
- || pin == PIN_PB30 ) {
125
+ ) {
130
126
gpio_set_pin_function (pin , GPIO_PIN_FUNCTION_H );
131
127
#endif
132
128
#ifdef SAMD21
You can’t perform that action at this time.
0 commit comments