avr: add atmega1284 chip support
Not tested on actual hardware, only on simavr. The main motivation for adding this chip is to be able to run simulated tests using a much larger memory space (16kB RAM, 128kB flash) without jumping to the XMega devices that may not be as well supported by LLVM.
Этот коммит содержится в:
		
							родитель
							
								
									66afcb3b39
								
							
						
					
					
						коммит
						5089d1a5a7
					
				
					 5 изменённых файлов: 41 добавлений и 1 удалений
				
			
		
							
								
								
									
										2
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -287,6 +287,8 @@ smoketest:
 | 
				
			||||||
	$(TINYGO) build -size short -o test.hex -target=pca10056-s140v7     examples/blinky1
 | 
						$(TINYGO) build -size short -o test.hex -target=pca10056-s140v7     examples/blinky1
 | 
				
			||||||
	@$(MD5SUM) test.hex
 | 
						@$(MD5SUM) test.hex
 | 
				
			||||||
ifneq ($(AVR), 0)
 | 
					ifneq ($(AVR), 0)
 | 
				
			||||||
 | 
						$(TINYGO) build -size short -o test.hex -target=atmega1284p         examples/serial
 | 
				
			||||||
 | 
						@$(MD5SUM) test.hex
 | 
				
			||||||
	$(TINYGO) build -size short -o test.hex -target=arduino             examples/blinky1
 | 
						$(TINYGO) build -size short -o test.hex -target=arduino             examples/blinky1
 | 
				
			||||||
	@$(MD5SUM) test.hex
 | 
						@$(MD5SUM) test.hex
 | 
				
			||||||
	$(TINYGO) build -size short -o test.hex -target=arduino-nano        examples/blinky1
 | 
						$(TINYGO) build -size short -o test.hex -target=arduino-nano        examples/blinky1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -234,7 +234,7 @@ func (uart UART) Configure(config UARTConfig) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Register the UART interrupt.
 | 
						// Register the UART interrupt.
 | 
				
			||||||
	interrupt.New(avr.IRQ_USART_RX, func(intr interrupt.Interrupt) {
 | 
						interrupt.New(irq_USART0_RX, func(intr interrupt.Interrupt) {
 | 
				
			||||||
		// Read register to clear it.
 | 
							// Read register to clear it.
 | 
				
			||||||
		data := avr.UDR0.Get()
 | 
							data := avr.UDR0.Get()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								src/machine/machine_atmega1284p.go
									
										
									
									
									
										Обычный файл
									
								
							
							
						
						
									
										12
									
								
								src/machine/machine_atmega1284p.go
									
										
									
									
									
										Обычный файл
									
								
							| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					// +build avr,atmega1284p
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package machine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "device/avr"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const irq_USART0_RX = avr.IRQ_USART0_RX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Return the current CPU frequency in hertz.
 | 
				
			||||||
 | 
					func CPUFrequency() uint32 {
 | 
				
			||||||
 | 
						return 20000000
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										7
									
								
								src/machine/machine_atmega328p.go
									
										
									
									
									
										Обычный файл
									
								
							
							
						
						
									
										7
									
								
								src/machine/machine_atmega328p.go
									
										
									
									
									
										Обычный файл
									
								
							| 
						 | 
					@ -0,0 +1,7 @@
 | 
				
			||||||
 | 
					// +build avr,atmega328p
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package machine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "device/avr"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const irq_USART0_RX = avr.IRQ_USART_RX
 | 
				
			||||||
							
								
								
									
										19
									
								
								targets/atmega1284p.json
									
										
									
									
									
										Обычный файл
									
								
							
							
						
						
									
										19
									
								
								targets/atmega1284p.json
									
										
									
									
									
										Обычный файл
									
								
							| 
						 | 
					@ -0,0 +1,19 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    "inherits": ["avr"],
 | 
				
			||||||
 | 
					    "llvm-target": "avr-atmel-none",
 | 
				
			||||||
 | 
					    "cpu": "atmega1284p",
 | 
				
			||||||
 | 
					    "build-tags": ["atmega1284p", "atmega"],
 | 
				
			||||||
 | 
					    "cflags": [
 | 
				
			||||||
 | 
					        "-mmcu=atmega1284p"
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    "ldflags": [
 | 
				
			||||||
 | 
					        "-mmcu=avr51",
 | 
				
			||||||
 | 
					        "-Wl,--defsym=_bootloader_size=0",
 | 
				
			||||||
 | 
					        "-Wl,--defsym=_stack_size=512"
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    "linkerscript": "src/device/avr/atmega1284p.ld",
 | 
				
			||||||
 | 
					    "extra-files": [
 | 
				
			||||||
 | 
					        "targets/avr.S",
 | 
				
			||||||
 | 
					        "src/device/avr/atmega1284p.s"
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Загрузка…
	
	Создание таблицы
		
		Сослаться в новой задаче