add system module

This commit is contained in:
optixx 2009-09-23 22:24:08 +02:00
parent 859dcadbac
commit ab3f7704f0
7 changed files with 73 additions and 6 deletions

View File

@ -33,13 +33,13 @@ ifeq ($(DEBUG),1)
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o \
main.o usb_bulk.o uart.o fifo.o sram.o crc.o debug.o \
dump.o timer.o watchdog.o rle.c loader.o info.o shared_memory.o \
pwm.o util.o shell.o irq.o command.o testing.o
system.o pwm.o util.o shell.o irq.o command.o testing.o
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 \
uart.o fifo.o sram.o crc.o debug.o dump.o timer.o watchdog.o rle.c loader.o \
pwm.o util.o shell.o info.o shared_memory.o command.o irq.o
system.o pwm.o util.o shell.o info.o shared_memory.o command.o irq.o
endif
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)

View File

@ -249,7 +249,7 @@ int main(void)
stdout = &uart_stdout;
banner();
system_init();
sram_init();
pwm_init();
shared_memory_init();
snes_reset_hi();

View File

@ -97,4 +97,4 @@ void pwm_init(void) {
TCCR2B = 1;
TIMSK2 |= (1<<OCIE2A);
sei();
}
}

View File

@ -34,7 +34,7 @@
uint32_t addr_current = 0;
uint32_t addr_stash = 0;
void system_init(void)
void sram_init(void)
{
/*-------------------------------------------------*/

View File

@ -196,7 +196,7 @@
void system_init(void);
void sram_init(void);
void sreg_set(uint32_t addr);
uint8_t sram_read(uint32_t addr);

39
avr/usbload/system.c Normal file
View File

@ -0,0 +1,39 @@
/*
* =====================================================================================
*
* ________ .__ __ ________ ____ ________
* \_____ \ __ __|__| ____ | | __\______ \ _______ _/_ |/ _____/
* / / \ \| | \ |/ ___\| |/ / | | \_/ __ \ \/ /| / __ \
* / \_/. \ | / \ \___| < | ` \ ___/\ / | \ |__\ \
* \_____\ \_/____/|__|\___ >__|_ \/_______ /\___ >\_/ |___|\_____ /
* \__> \/ \/ \/ \/ \/
*
* www.optixx.org
*
*
* Version: 1.0
* Created: 07/21/2009 03:32:16 PM
* Author: david@optixx.org
*
* =====================================================================================
*/
#include <stdlib.h>
#include <stdint.h>
#include <avr/io.h>
#include <util/delay.h> /* for _delay_ms() */
#include "config.h"
#include "sram.h"
#include "system.h"
#include "uart.h"
#include "debug.h"
#include "info.h"
void system_init(void)
{
}

28
avr/usbload/system.h Normal file
View File

@ -0,0 +1,28 @@
/*
* =====================================================================================
*
* ________ .__ __ ________ ____ ________
* \_____ \ __ __|__| ____ | | __\______ \ _______ _/_ |/ _____/
* / / \ \| | \ |/ ___\| |/ / | | \_/ __ \ \/ /| / __ \
* / \_/. \ | / \ \___| < | ` \ ___/\ / | \ |__\ \
* \_____\ \_/____/|__|\___ >__|_ \/_______ /\___ >\_/ |___|\_____ /
* \__> \/ \/ \/ \/ \/
*
* www.optixx.org
*
*
* Version: 1.0
* Created: 07/21/2009 03:32:16 PM
* Author: david@optixx.org
*
* =====================================================================================
*/
#ifndef __SYSTEM_H__
#define __SYSTEM_H__
void system_init(void);
#endif