diff --git a/avr/usbload/Makefile b/avr/usbload/Makefile index 6643959..a521040 100644 --- a/avr/usbload/Makefile +++ b/avr/usbload/Makefile @@ -23,12 +23,13 @@ F_CPU = 20000000 TARGET = main AVRDUDE = avrdude -c usbasp -p $(DEVICE) SIZE = avr-size -LOADER = ../../roms/qd16boot01.smc +BOOT_ROM_SMALL = ../../roms/qd16boot01.smc +BOOT_ROM_FULL = ../../roms/qd16boot02.smc ROM_CONVERT = ../../scripts/conv_rle.py -ifeq ($(DEBUG),0) +ifeq ($(DEBUG),1) LDFLAGS =-Wl,-u,vfprintf -lprintf_flt CFLAGS =-Iusbdrv -I. -DDEBUG_LEVEL=0 OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o \ @@ -39,8 +40,9 @@ else LDFLAGS =-Wl,-u CFLAGS =-Iusbdrv -I. -DDEBUG_LEVEL=0 -DNO_DEBUG -DNO_INFO OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o usb_bulk.o \ - sram.o crc.o debug.o dump.o watchdog.o rle.c loader.o \ - system.o util.o info.o shared_memory.o command.o irq.o + sram.o crc.o debug.o dump.o rle.c loader.o \ + system.o util.o info.o shared_memory.o command.o irq.o \ + pwm.o endif COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE) @@ -78,8 +80,10 @@ flash: main.hex $(AVRDUDE) -U flash:w:main.hex:i loader: - python $(ROM_CONVERT) $(LOADER) + python $(ROM_CONVERT) $(BOOT_ROM_SMALL) +loader_full: + python $(ROM_CONVERT) $(BOOT_ROM_FULL) .c.o: $(COMPILE) -c $< -o $@ diff --git a/avr/usbload/loader.h b/avr/usbload/loader.h index 6d80c63..8bcb1f6 100644 --- a/avr/usbload/loader.h +++ b/avr/usbload/loader.h @@ -1,6 +1,6 @@ /* File: qd16boot01.smc -Time: Sat, 17 Oct 2009 16:28:09 +Time: Sat, 17 Oct 2009 16:53:02 */ #ifndef __FIFO_H__ #define __FIFO_H__ diff --git a/avr/usbload/main.c b/avr/usbload/main.c index 185b0d0..e19527f 100644 --- a/avr/usbload/main.c +++ b/avr/usbload/main.c @@ -51,11 +51,9 @@ #include "shell.h" #include "system.h" - #ifndef NO_DEBUG extern FILE uart_stdout; #endif - extern system_t system; uint8_t debug_level = (DEBUG | DEBUG_USB | DEBUG_CRC | DEBUG_SHM ); @@ -247,37 +245,25 @@ void globals_init(){ int main(void) { - #ifndef NO_DEBUG uart_init(); stdout = &uart_stdout; -#endif banner(); +#endif shared_memory_init(); system_init(); sram_init(); - -#ifndef NO_DEBUG pwm_init(); -#endif irq_init(); - boot_startup_rom(50); - globals_init(); - -#ifndef NO_DEBUG pwm_stop(); -#endif - usbInit(); usb_connect(); - sei(); while (1) { avr_bus_active(); info_P(PSTR("Activate AVR bus\n")); - //snes_lorom(); info_P(PSTR("Disable SNES WR\n")); snes_wr_disable(); info_P(PSTR("USB poll\n")); diff --git a/avr/usbload/pwm.c b/avr/usbload/pwm.c index ba1b704..024a1c4 100644 --- a/avr/usbload/pwm.c +++ b/avr/usbload/pwm.c @@ -30,6 +30,7 @@ #define PWM_SINE_MAX 64 #define PWM_OVERFLOW_MAX 1024 + uint8_t pwm_sine_table[] = { 0x7f,0x8b,0x97,0xa4,0xaf,0xbb,0xc5,0xcf,0xd9,0xe1,0xe8,0xef,0xf4,0xf8,0xfb,0xfd, 0xfd,0xfd,0xfb,0xf8,0xf3,0xee,0xe7,0xe0,0xd7,0xce,0xc4,0xb9,0xae,0xa2,0x96,0x89,