Add firmware template
This commit is contained in:
		
							parent
							
								
									eb968ec16f
								
							
						
					
					
						commit
						61a1ae5dc8
					
				
							
								
								
									
										4
									
								
								firmware/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								firmware/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					*.o
 | 
				
			||||||
 | 
					*.hex
 | 
				
			||||||
 | 
					*.obj
 | 
				
			||||||
 | 
					*.hex
 | 
				
			||||||
							
								
								
									
										20
									
								
								firmware/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								firmware/Makefile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					MCU=atmega88
 | 
				
			||||||
 | 
					CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000
 | 
				
			||||||
 | 
					LDFLAGS=-Wl,-gc-sections -Wl,-relax
 | 
				
			||||||
 | 
					CC=avr-gcc
 | 
				
			||||||
 | 
					TARGET=main
 | 
				
			||||||
 | 
					OBJECT_FILES=main.o
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					all: $(TARGET).hex
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clean:
 | 
				
			||||||
 | 
						rm -f *.o *.hex *.obj *.hex
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%.hex: %.obj
 | 
				
			||||||
 | 
						avr-objcopy -R .eeprom -O ihex $< $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%.obj: $(OBJECT_FILES)
 | 
				
			||||||
 | 
						$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					program: $(TARGET).hex
 | 
				
			||||||
 | 
						avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex
 | 
				
			||||||
							
								
								
									
										6
									
								
								firmware/main.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								firmware/main.c
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					#include <avr/io.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user