Skip to content

Commit a0f9e55

Browse files
committed
Remove NXP MK66F18 port E
1 parent c26f80d commit a0f9e55

File tree

3 files changed

+28
-20
lines changed

3 files changed

+28
-20
lines changed

src/machine/board_teensy36.go

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ func ClockFrequency() uint32 { return 16000000 }
1111
// LED on the Teensy
1212
const LED = PC05
1313

14+
// Port E is unavailable pending resolution of
15+
// https://github.com/tinygo-org/tinygo/issues/1190
16+
1417
// digital IO
1518
const (
1619
D00 = PB16
@@ -37,7 +40,7 @@ const (
3740
D21 = PD06
3841
D22 = PC01
3942
D23 = PC02
40-
D24 = PE26
43+
// D24 = PE26
4144
D25 = PA05
4245
D26 = PA14
4346
D27 = PA15
@@ -46,8 +49,8 @@ const (
4649
D30 = PB19
4750
D31 = PB10
4851
D32 = PB11
49-
D33 = PE24
50-
D34 = PE25
52+
// D33 = PE24
53+
// D34 = PE25
5154
D35 = PC08
5255
D36 = PC09
5356
D37 = PC10
@@ -69,14 +72,14 @@ const (
6972
D53 = PD12
7073
D54 = PD15
7174
D55 = PD11
72-
D56 = PE10
73-
D57 = PE11
74-
D58 = PE00
75-
D59 = PE01
76-
D60 = PE02
77-
D61 = PE03
78-
D62 = PE04
79-
D63 = PE05
75+
// D56 = PE10
76+
// D57 = PE11
77+
// D58 = PE00
78+
// D59 = PE01
79+
// D60 = PE02
80+
// D61 = PE03
81+
// D62 = PE04
82+
// D63 = PE05
8083
)
8184

8285
var (
@@ -96,6 +99,9 @@ const (
9699
defaultUART2TX = D08
97100
defaultUART3RX = D31
98101
defaultUART3TX = D32
99-
defaultUART4RX = D34
100-
defaultUART4TX = D33
102+
103+
// Port E is unavailable
104+
defaultUART4RX = NoPin // D34
105+
defaultUART4TX = NoPin // D33
101106
)
107+

src/machine/machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type PinConfig struct {
1717
// Pin is a single pin on a chip, which may be connected to other hardware
1818
// devices. It can either be used directly as GPIO pin or it can be used in
1919
// other peripherals like ADC, I2C, etc.
20-
type Pin int16
20+
type Pin int8
2121

2222
// NoPin explicitly indicates "not a pin". Use this pin if you want to leave one
2323
// of the pins in a peripheral unconfigured (if supported by the hardware).

src/machine/machine_nxpmk66f18.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ const (
150150
PD15
151151
)
152152

153+
/*
154+
// Port E is unavailable pending resolution of
155+
// https://github.com/tinygo-org/tinygo/issues/1190
153156
const (
154157
PE00 Pin = iota + 128
155158
PE01
@@ -180,7 +183,7 @@ const (
180183
PE26
181184
PE27
182185
PE28
183-
)
186+
)*/
184187

185188
//go:inline
186189
func (p Pin) reg() (*nxp.GPIO_Type, *volatile.Register32, uint8) {
@@ -193,12 +196,11 @@ func (p Pin) reg() (*nxp.GPIO_Type, *volatile.Register32, uint8) {
193196
gpio, pcr = nxp.GPIOB, nxp.PORTB
194197
} else if p < 96 {
195198
gpio, pcr = nxp.GPIOC, nxp.PORTC
196-
} else if p < 128 {
197-
gpio, pcr = nxp.GPIOD, nxp.PORTD
198-
} else if p < 160 {
199-
gpio, pcr = nxp.GPIOE, nxp.PORTE
200199
} else {
201-
panic("invalid pin number")
200+
// } else if p < 128 {
201+
gpio, pcr = nxp.GPIOD, nxp.PORTD
202+
// } else if p < 160 {
203+
// gpio, pcr = nxp.GPIOE, nxp.PORTE
202204
}
203205

204206
return gpio, &(*[32]volatile.Register32)(unsafe.Pointer(pcr))[p%32], uint8(p % 32)

0 commit comments

Comments
 (0)