Forráskód Böngészése

change counter down io to bootloader enable

optixx 14 éve
szülő
commit
d67158f523
4 módosított fájl, 212 hozzáadás és 374 törlés
  1. 1 1
      avr/bootloader/avr.mk
  2. 4 5
      avr/usbload/sram.c
  3. 17 13
      avr/usbload/sram.h
  4. 190 355
      quickdev16.tmproj

+ 1 - 1
avr/bootloader/avr.mk

@@ -67,7 +67,7 @@ clean:
 
 .PHONY: all clean interactive-isp interactive-serial launch-bootloader
 
-flash: 
+flash: bootloader.hex
 	$(AVRDUDE) $(AVRDUDE_FLAGS) -c $(ISP_PROG) -U flash:w:$<
 
 flash-eeprom-%: %.eep.hex

+ 4 - 5
avr/usbload/sram.c

@@ -48,18 +48,17 @@ void system_init(void)
                 | (1 << AVR_ADDR_SCK_PIN)	    
                 | (1 << AVR_ADDR_SER_PIN)	    
                 | (1 << AVR_ADDR_LOAD_PIN)	    
-                | (1 << AVR_ADDR_DOWN_PIN)	    
-                | (1 << AVR_ADDR_UP_PIN));
+                | (1 << AVR_ADDR_UP_PIN));	    
     
-    DDRC &=     ~ (1 << SNES_WR_PIN);	    
+    DDRC &=     ~ ((1 << SNES_WR_PIN)	    
+                | (1 << AVR_BTLDR_EN_PIN));
  
     PORTC &=    ~((1 << AVR_ADDR_LATCH_PIN)	    
                 | (1 << AVR_ADDR_SCK_PIN)
                 | (1 << SNES_WR_PIN));
  
     
-    PORTC |=    ( (1 << AVR_ADDR_DOWN_PIN)	    
-                | (1 << AVR_ADDR_UP_PIN)
+    PORTC |=    ( (1 << AVR_ADDR_UP_PIN)
                 | (1 << AVR_ADDR_LOAD_PIN));    
                 
                 //| (1 << SNES_WR_PIN));

+ 17 - 13
avr/usbload/sram.h

@@ -40,14 +40,6 @@
 
 #define avr_data_out()          (AVR_DATA_DIR = 0xff)
 
-#define LED_PORT	            PORTC
-#define LED_DIR		            DDRC
-#define LED_PIN		            PC7
-
-#define led_on()	            ((LED_PORT &=~ (1 << LED_PIN)),\
-                                (LED_DIR &=~ (1 << LED_PIN)))
-#define led_off()	            ((LED_PORT &=~ (1 << LED_PIN)),\
-                                (LED_DIR |= (1 << LED_PIN)))
 
 /* ---------------------------- PORT B ---------------------------- */
 
@@ -129,12 +121,14 @@
 #define counter_load()	        ((AVR_ADDR_LOAD_PORT &= ~(1 << AVR_ADDR_LOAD_PIN)),\
                                 (AVR_ADDR_LOAD_PORT |= (1 << AVR_ADDR_LOAD_PIN)))
 
-#define AVR_ADDR_DOWN_PORT	    PORTC
-#define AVR_ADDR_DOWN_DIR	    DDRC
-#define AVR_ADDR_DOWN_PIN	    PC1
+#define AVR_BTLDR_EN_PORT	    PORTC
+#define AVR_BTLDR_EN_DIR	    DDRC
+#define AVR_BTLDR_EN_PIN	    PC1
+
+#define btldr_down()	        ((AVR_BTLDR_EN_PORT &= ~(1 << AVR_BTLDR_EN_PIN)),\
+                                (AVR_BTLDR_EN_PORT |= (1 << AVR_BTLDR_EN_PIN)))
+
 
-#define counter_down()	        ((AVR_ADDR_DOWN_PORT &= ~(1 << AVR_ADDR_DOWN_PIN)),\
-                                (AVR_ADDR_DOWN_PORT |= (1 << AVR_ADDR_DOWN_PIN)))
 
 #define AVR_ADDR_UP_PORT	    PORTC
 #define AVR_ADDR_UP_DIR	        DDRC
@@ -147,6 +141,16 @@
 #define SNES_WR_DIR	            DDRC
 #define SNES_WR_PIN	            PC3
 
+#define LED_PORT	            PORTC
+#define LED_DIR		            DDRC
+#define LED_PIN		            PC7
+
+#define led_on()	            ((LED_PORT &=~ (1 << LED_PIN)),\
+                                (LED_DIR &=~ (1 << LED_PIN)))
+#define led_off()	            ((LED_PORT &=~ (1 << LED_PIN)),\
+                                (LED_DIR |= (1 << LED_PIN)))
+
+
 /* ---------------------------- PORT D ---------------------------- */
 
 #define AVR_SNES_PORT	        PORTD

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 190 - 355
quickdev16.tmproj


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott