machine/arduino-nano33: fix UART1 and UART2
UART2 was configured with the wrong SERCOM for the used pins (PB22 and PB23). However, after changing the SERCOM from 3 to 5 that led to a conflict with UART1 (used for the on-board WiFi). But the used pins are also usable from SERCOM 3, so in the end I switched SERCOM5 and SERCOM3 around. With this change, I was able to get examples/echo working.
Этот коммит содержится в:
		
							родитель
							
								
									ab7dc45288
								
							
						
					
					
						коммит
						d37bbadb54
					
				
					 1 изменённых файлов: 6 добавлений и 6 удалений
				
			
		| 
						 | 
				
			
			@ -8,12 +8,12 @@ import "device/sam"
 | 
			
		|||
var (
 | 
			
		||||
	UART1 = UART{
 | 
			
		||||
		Buffer: NewRingBuffer(),
 | 
			
		||||
		Bus:    sam.SERCOM5_USART,
 | 
			
		||||
		SERCOM: 5,
 | 
			
		||||
		Bus:    sam.SERCOM3_USART,
 | 
			
		||||
		SERCOM: 3,
 | 
			
		||||
	}
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
//go:export SERCOM5_IRQHandler
 | 
			
		||||
//go:export SERCOM3_IRQHandler
 | 
			
		||||
func handleUART1() {
 | 
			
		||||
	defaultUART1Handler()
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -22,12 +22,12 @@ func handleUART1() {
 | 
			
		|||
var (
 | 
			
		||||
	UART2 = UART{
 | 
			
		||||
		Buffer: NewRingBuffer(),
 | 
			
		||||
		Bus:    sam.SERCOM3_USART,
 | 
			
		||||
		SERCOM: 3,
 | 
			
		||||
		Bus:    sam.SERCOM5_USART,
 | 
			
		||||
		SERCOM: 5,
 | 
			
		||||
	}
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
//go:export SERCOM3_IRQHandler
 | 
			
		||||
//go:export SERCOM5_IRQHandler
 | 
			
		||||
func handleUART2() {
 | 
			
		||||
	// should reset IRQ
 | 
			
		||||
	UART2.Receive(byte((UART2.Bus.DATA.Get() & 0xFF)))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Загрузка…
	
	Создание таблицы
		
		Сослаться в новой задаче