get no_debug mode working
This commit is contained in:
parent
13c71760c8
commit
596a26323a
@ -23,12 +23,13 @@ F_CPU = 20000000
|
|||||||
TARGET = main
|
TARGET = main
|
||||||
AVRDUDE = avrdude -c usbasp -p $(DEVICE)
|
AVRDUDE = avrdude -c usbasp -p $(DEVICE)
|
||||||
SIZE = avr-size
|
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
|
ROM_CONVERT = ../../scripts/conv_rle.py
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),0)
|
ifeq ($(DEBUG),1)
|
||||||
LDFLAGS =-Wl,-u,vfprintf -lprintf_flt
|
LDFLAGS =-Wl,-u,vfprintf -lprintf_flt
|
||||||
CFLAGS =-Iusbdrv -I. -DDEBUG_LEVEL=0
|
CFLAGS =-Iusbdrv -I. -DDEBUG_LEVEL=0
|
||||||
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o \
|
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o \
|
||||||
@ -39,8 +40,9 @@ else
|
|||||||
LDFLAGS =-Wl,-u
|
LDFLAGS =-Wl,-u
|
||||||
CFLAGS =-Iusbdrv -I. -DDEBUG_LEVEL=0 -DNO_DEBUG -DNO_INFO
|
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 \
|
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 \
|
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
|
system.o util.o info.o shared_memory.o command.o irq.o \
|
||||||
|
pwm.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)
|
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
|
$(AVRDUDE) -U flash:w:main.hex:i
|
||||||
|
|
||||||
loader:
|
loader:
|
||||||
python $(ROM_CONVERT) $(LOADER)
|
python $(ROM_CONVERT) $(BOOT_ROM_SMALL)
|
||||||
|
|
||||||
|
loader_full:
|
||||||
|
python $(ROM_CONVERT) $(BOOT_ROM_FULL)
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(COMPILE) -c $< -o $@
|
$(COMPILE) -c $< -o $@
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
File: qd16boot01.smc
|
File: qd16boot01.smc
|
||||||
Time: Sat, 17 Oct 2009 16:28:09
|
Time: Sat, 17 Oct 2009 16:53:02
|
||||||
*/
|
*/
|
||||||
#ifndef __FIFO_H__
|
#ifndef __FIFO_H__
|
||||||
#define __FIFO_H__
|
#define __FIFO_H__
|
||||||
|
|||||||
@ -51,11 +51,9 @@
|
|||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_DEBUG
|
#ifndef NO_DEBUG
|
||||||
extern FILE uart_stdout;
|
extern FILE uart_stdout;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern system_t system;
|
extern system_t system;
|
||||||
|
|
||||||
uint8_t debug_level = (DEBUG | DEBUG_USB | DEBUG_CRC | DEBUG_SHM );
|
uint8_t debug_level = (DEBUG | DEBUG_USB | DEBUG_CRC | DEBUG_SHM );
|
||||||
@ -247,37 +245,25 @@ void globals_init(){
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef NO_DEBUG
|
#ifndef NO_DEBUG
|
||||||
uart_init();
|
uart_init();
|
||||||
stdout = &uart_stdout;
|
stdout = &uart_stdout;
|
||||||
#endif
|
|
||||||
banner();
|
banner();
|
||||||
|
#endif
|
||||||
shared_memory_init();
|
shared_memory_init();
|
||||||
system_init();
|
system_init();
|
||||||
sram_init();
|
sram_init();
|
||||||
|
|
||||||
#ifndef NO_DEBUG
|
|
||||||
pwm_init();
|
pwm_init();
|
||||||
#endif
|
|
||||||
irq_init();
|
irq_init();
|
||||||
|
|
||||||
boot_startup_rom(50);
|
boot_startup_rom(50);
|
||||||
|
|
||||||
globals_init();
|
globals_init();
|
||||||
|
|
||||||
#ifndef NO_DEBUG
|
|
||||||
pwm_stop();
|
pwm_stop();
|
||||||
#endif
|
|
||||||
|
|
||||||
usbInit();
|
usbInit();
|
||||||
usb_connect();
|
usb_connect();
|
||||||
sei();
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
avr_bus_active();
|
avr_bus_active();
|
||||||
info_P(PSTR("Activate AVR bus\n"));
|
info_P(PSTR("Activate AVR bus\n"));
|
||||||
//snes_lorom();
|
|
||||||
info_P(PSTR("Disable SNES WR\n"));
|
info_P(PSTR("Disable SNES WR\n"));
|
||||||
snes_wr_disable();
|
snes_wr_disable();
|
||||||
info_P(PSTR("USB poll\n"));
|
info_P(PSTR("USB poll\n"));
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#define PWM_SINE_MAX 64
|
#define PWM_SINE_MAX 64
|
||||||
#define PWM_OVERFLOW_MAX 1024
|
#define PWM_OVERFLOW_MAX 1024
|
||||||
|
|
||||||
uint8_t pwm_sine_table[] = {
|
uint8_t pwm_sine_table[] = {
|
||||||
0x7f,0x8b,0x97,0xa4,0xaf,0xbb,0xc5,0xcf,0xd9,0xe1,0xe8,0xef,0xf4,0xf8,0xfb,0xfd,
|
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,
|
0xfd,0xfd,0xfb,0xf8,0xf3,0xee,0xe7,0xe0,0xd7,0xce,0xc4,0xb9,0xae,0xa2,0x96,0x89,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user