File tree Expand file tree Collapse file tree 12 files changed +54
-202
lines changed
common-hal/microcontroller Expand file tree Collapse file tree 12 files changed +54
-202
lines changed Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
& pin_GPIO_AD_13 ,// SWDIO
34
35
& pin_GPIO_AD_12 ,// SWCLK
35
36
@@ -41,25 +42,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
41
42
& pin_GPIO_SD_08 ,
42
43
& pin_GPIO_SD_07 ,
43
44
& pin_GPIO_SD_06 ,
45
+ NULL , // Must end in NULL.
44
46
};
45
47
46
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
47
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
48
- if (pin == _reset_forbidden_pins [i ]) {
49
- return true;
50
- }
51
- }
52
- return false;
53
- }
54
-
55
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
56
- if (_reset_forbidden (pin )) {
57
- return true;
58
- }
59
-
60
- // Other reset variations would go here.
61
-
62
- return false;
63
- }
64
-
65
48
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
& pin_GPIO_AD_13 ,// SWDIO
34
35
& pin_GPIO_AD_12 ,// SWCLK
35
36
@@ -41,26 +42,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
41
42
& pin_GPIO_SD_08 ,
42
43
& pin_GPIO_SD_07 ,
43
44
& pin_GPIO_SD_06 ,
45
+ NULL , // Must end in NULL.
44
46
};
45
47
46
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
47
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
48
- if (pin == _reset_forbidden_pins [i ]) {
49
- return true;
50
- }
51
- }
52
- return false;
53
- }
54
-
55
-
56
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
57
- if (_reset_forbidden (pin )) {
58
- return true;
59
- }
60
-
61
- // Other reset variations would go here.
62
-
63
- return false;
64
- }
65
-
66
48
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
// SWD Pins
34
35
& pin_GPIO_AD_B0_06 ,// SWDIO
35
36
& pin_GPIO_AD_B0_07 ,// SWCLK
@@ -41,25 +42,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
41
42
& pin_GPIO_SD_B1_09 ,
42
43
& pin_GPIO_SD_B1_10 ,
43
44
& pin_GPIO_SD_B1_11 ,
45
+ NULL , // Must end in NULL.
44
46
};
45
47
46
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
47
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
48
- if (pin == _reset_forbidden_pins [i ]) {
49
- return true;
50
- }
51
- }
52
- return false;
53
- }
54
-
55
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
56
- if (_reset_forbidden (pin )) {
57
- return true;
58
- }
59
-
60
- // Other reset variations would go here.
61
-
62
- return false;
63
- }
64
-
65
48
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
& pin_GPIO_AD_13 , // SWDIO
34
35
& pin_GPIO_AD_12 , // SWCLK
35
36
// FLEX flash
@@ -43,25 +44,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
43
44
// USB Pins
44
45
& pin_GPIO_12 ,
45
46
& pin_GPIO_13 ,
47
+ NULL , // Must end in NULL.
46
48
};
47
49
48
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
49
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
50
- if (pin == _reset_forbidden_pins [i ]) {
51
- return true;
52
- }
53
- }
54
- return false;
55
- }
56
-
57
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
58
- if (_reset_forbidden (pin )) {
59
- return true;
60
- }
61
-
62
- // Other reset variations would go here.
63
-
64
- return false;
65
- }
66
-
67
50
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
// SWD Pins
34
35
& pin_GPIO_AD_B0_00 ,// SWDIO
35
36
& pin_GPIO_AD_B0_01 ,// SWCLK
@@ -45,25 +46,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
45
46
// USB Pins
46
47
& pin_GPIO_AD_B1_11 ,
47
48
& pin_GPIO_AD_B1_12 ,
49
+ NULL , // Must end in NULL.
48
50
};
49
51
50
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
51
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
52
- if (pin == _reset_forbidden_pins [i ]) {
53
- return true;
54
- }
55
- }
56
- return false;
57
- }
58
-
59
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
60
- if (_reset_forbidden (pin )) {
61
- return true;
62
- }
63
-
64
- // Other reset variations would go here.
65
-
66
- return false;
67
- }
68
-
69
52
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
// SWD Pins
34
35
& pin_GPIO_AD_B0_06 , // SWDIO
35
36
& pin_GPIO_AD_B0_07 , // SWCLK
@@ -51,26 +52,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
51
52
// USB Pins
52
53
& pin_GPIO_AD_B0_01 ,
53
54
& pin_GPIO_AD_B0_03 ,
55
+ NULL , // Must end in NULL.
54
56
};
55
57
56
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
57
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
58
- if (pin == _reset_forbidden_pins [i ]) {
59
- return true;
60
- }
61
- }
62
- return false;
63
- }
64
-
65
-
66
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
67
- if (_reset_forbidden (pin )) {
68
- return true;
69
- }
70
-
71
- // Other reset variations would go here.
72
-
73
- return false;
74
- }
75
-
76
58
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
// SWD Pins
34
35
& pin_GPIO_AD_13 ,// SWDIO
35
36
& pin_GPIO_AD_12 ,// SWCLK
@@ -42,25 +43,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
42
43
& pin_GPIO_SD_08 ,
43
44
& pin_GPIO_SD_07 ,
44
45
& pin_GPIO_SD_06 ,
46
+ NULL , // Must end in NULL.
45
47
};
46
48
47
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
48
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
49
- if (pin == _reset_forbidden_pins [i ]) {
50
- return true;
51
- }
52
- }
53
- return false;
54
- }
55
-
56
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
57
- if (_reset_forbidden (pin )) {
58
- return true;
59
- }
60
-
61
- // Other reset variations would go here.
62
-
63
- return false;
64
- }
65
-
66
49
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
& pin_GPIO_SD_B1_06 ,
34
35
& pin_GPIO_SD_B1_07 ,
35
36
& pin_GPIO_SD_B1_08 ,
@@ -49,25 +50,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
49
50
& pin_GPIO_AD_B0_11 ,
50
51
// Data strobe needs protection despite being grounded
51
52
& pin_GPIO_SD_B1_05 ,
53
+ NULL , // Must end in NULL.
52
54
};
53
55
54
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
55
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
56
- if (pin == _reset_forbidden_pins [i ]) {
57
- return true;
58
- }
59
- }
60
- return false;
61
- }
62
-
63
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
64
- if (_reset_forbidden (pin )) {
65
- return true;
66
- }
67
-
68
- // Other reset variations would go here.
69
-
70
- return false;
71
- }
72
-
73
56
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
// FLEX flash
34
35
& pin_GPIO_SD_B1_06 ,
35
36
& pin_GPIO_SD_B1_07 ,
@@ -50,25 +51,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
50
51
& pin_GPIO_AD_B0_11 ,
51
52
// Data strobe needs protection despite being grounded
52
53
& pin_GPIO_SD_B1_05 ,
54
+ NULL , // Must end in NULL.
53
55
};
54
56
55
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
56
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
57
- if (pin == _reset_forbidden_pins [i ]) {
58
- return true;
59
- }
60
- }
61
- return false;
62
- }
63
-
64
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
65
- if (_reset_forbidden (pin )) {
66
- return true;
67
- }
68
-
69
- // Other reset variations would go here.
70
-
71
- return false;
72
- }
73
-
74
57
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change 29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
31
31
// These pins should never ever be reset; doing so could interfere with basic operation.
32
- STATIC const mcu_pin_obj_t * _reset_forbidden_pins [] = {
32
+ // Used in common-hal/microcontroller/Pin.c
33
+ const mcu_pin_obj_t * mimxrt10xx_reset_forbidden_pins [] = {
33
34
// FLEX flash
34
35
& pin_GPIO_SD_B1_06 ,
35
36
& pin_GPIO_SD_B1_07 ,
@@ -50,25 +51,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = {
50
51
& pin_GPIO_AD_B0_11 ,
51
52
// Data strobe needs protection despite being grounded
52
53
& pin_GPIO_SD_B1_05 ,
54
+ NULL , // Must end in NULL.
53
55
};
54
56
55
- STATIC bool _reset_forbidden (const mcu_pin_obj_t * pin ) {
56
- for (size_t i = 0 ; i < MP_ARRAY_SIZE (_reset_forbidden_pins ); i ++ ) {
57
- if (pin == _reset_forbidden_pins [i ]) {
58
- return true;
59
- }
60
- }
61
- return false;
62
- }
63
-
64
- bool mimxrt10xx_board_reset_pin_number (const mcu_pin_obj_t * pin ) {
65
- if (_reset_forbidden (pin )) {
66
- return true;
67
- }
68
-
69
- // Other reset variations would go here.
70
-
71
- return false;
72
- }
73
-
74
57
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
You can’t perform that action at this time.
0 commit comments