sorted sources per functionality in different subdirs
This commit is contained in:
92
Makefile
92
Makefile
@@ -1,5 +1,4 @@
|
|||||||
#
|
# # Makefile for Firebee BaS
|
||||||
# Makefile for Firebee BaS
|
|
||||||
#
|
#
|
||||||
# This Makefile is meant for cross compiling the BaS with Vincent Riviere's cross compilers.
|
# This Makefile is meant for cross compiling the BaS with Vincent Riviere's cross compilers.
|
||||||
# If you want to compile native on an Atari (you will need at least GCC 4.6.3), set
|
# If you want to compile native on an Atari (you will need at least GCC 4.6.3), set
|
||||||
@@ -40,11 +39,12 @@ CFLAGS=-mcpu=5474 \
|
|||||||
-fleading-underscore \
|
-fleading-underscore \
|
||||||
-Wa,--register-prefix-optional
|
-Wa,--register-prefix-optional
|
||||||
|
|
||||||
SRCDIR=sources
|
|
||||||
TRGTDIRS= ./firebee ./m5484lite
|
TRGTDIRS= ./firebee ./m5484lite
|
||||||
OBJDIRS=$(patsubst %, %/objs,$(TRGTDIRS))
|
OBJDIRS=$(patsubst %, %/objs,$(TRGTDIRS))
|
||||||
TOOLDIR=util
|
TOOLDIR=util
|
||||||
|
|
||||||
|
VPATH=dma:exe:flash:fs:if:kbd:pci:spi:sys:usb:util:xhdi
|
||||||
|
|
||||||
# Linker control file. The final $(LDCFILE) is intermediate only (preprocessed version of $(LDCSRC)
|
# Linker control file. The final $(LDCFILE) is intermediate only (preprocessed version of $(LDCSRC)
|
||||||
LDCFILE=bas.lk
|
LDCFILE=bas.lk
|
||||||
LDRFILE=ram.lk
|
LDRFILE=ram.lk
|
||||||
@@ -59,53 +59,53 @@ RAM_EXEC=ram.$(EXE)
|
|||||||
BASFLASH_EXEC=basflash.$(EXE)
|
BASFLASH_EXEC=basflash.$(EXE)
|
||||||
|
|
||||||
CSRCS= \
|
CSRCS= \
|
||||||
$(SRCDIR)/sysinit.c \
|
sysinit.c \
|
||||||
$(SRCDIR)/init_fpga.c \
|
init_fpga.c \
|
||||||
$(SRCDIR)/mmu.c \
|
mmu.c \
|
||||||
$(SRCDIR)/fault_vectors.c \
|
fault_vectors.c \
|
||||||
$(SRCDIR)/interrupts.c \
|
interrupts.c \
|
||||||
$(SRCDIR)/bas_printf.c \
|
bas_printf.c \
|
||||||
$(SRCDIR)/bas_string.c \
|
bas_string.c \
|
||||||
$(SRCDIR)/BaS.c \
|
BaS.c \
|
||||||
$(SRCDIR)/cache.c \
|
cache.c \
|
||||||
$(SRCDIR)/mmc.c \
|
mmc.c \
|
||||||
$(SRCDIR)/unicode.c \
|
unicode.c \
|
||||||
$(SRCDIR)/ff.c \
|
ff.c \
|
||||||
$(SRCDIR)/sd_card.c \
|
sd_card.c \
|
||||||
$(SRCDIR)/wait.c \
|
wait.c \
|
||||||
$(SRCDIR)/s19reader.c \
|
s19reader.c \
|
||||||
$(SRCDIR)/flash.c \
|
flash.c \
|
||||||
$(SRCDIR)/dma.c \
|
dma.c \
|
||||||
$(SRCDIR)/xhdi_sd.c \
|
xhdi_sd.c \
|
||||||
$(SRCDIR)/xhdi_interface.c \
|
xhdi_interface.c \
|
||||||
$(SRCDIR)/pci.c \
|
pci.c \
|
||||||
$(SRCDIR)/dspi.c \
|
dspi.c \
|
||||||
$(SRCDIR)/driver_vec.c \
|
driver_vec.c \
|
||||||
$(SRCDIR)/MCD_dmaApi.c \
|
MCD_dmaApi.c \
|
||||||
$(SRCDIR)/MCD_tasks.c \
|
MCD_tasks.c \
|
||||||
$(SRCDIR)/MCD_tasksInit.c \
|
MCD_tasksInit.c \
|
||||||
\
|
\
|
||||||
$(SRCDIR)/usb.c \
|
usb.c \
|
||||||
$(SRCDIR)/usb_mem.c \
|
usb_mem.c \
|
||||||
$(SRCDIR)/ohci-hcd.c \
|
ohci-hcd.c \
|
||||||
$(SRCDIR)/ehci-hcd.c \
|
ehci-hcd.c \
|
||||||
$(SRCDIR)/usb_mouse.c \
|
usb_mouse.c \
|
||||||
\
|
\
|
||||||
$(SRCDIR)/ikbd.c \
|
ikbd.c \
|
||||||
\
|
\
|
||||||
$(SRCDIR)/basflash.c \
|
basflash.c \
|
||||||
$(SRCDIR)/basflash_start.c
|
basflash_start.c
|
||||||
|
|
||||||
ASRCS= \
|
ASRCS= \
|
||||||
$(SRCDIR)/startcf.S \
|
startcf.S \
|
||||||
$(SRCDIR)/printf_helper.S \
|
printf_helper.S \
|
||||||
$(SRCDIR)/exceptions.S \
|
exceptions.S \
|
||||||
$(SRCDIR)/supervisor.S \
|
supervisor.S \
|
||||||
$(SRCDIR)/illegal_instruction.S \
|
illegal_instruction.S \
|
||||||
$(SRCDIR)/xhdi_vec.S
|
xhdi_vec.S
|
||||||
|
|
||||||
COBJS=$(patsubst $(SRCDIR)/%.o,%.o,$(patsubst %.c,%.o,$(CSRCS)))
|
COBJS=$(patsubst %.c,%.o,$(CSRCS))
|
||||||
AOBJS=$(patsubst $(SRCDIR)/%.o,%.o,$(patsubst %.S,%.o,$(ASRCS)))
|
AOBJS=$(patsubst %.S,%.o,$(ASRCS))
|
||||||
|
|
||||||
OBJS=$(COBJS) $(AOBJS)
|
OBJS=$(COBJS) $(AOBJS)
|
||||||
LIBBAS=libbas.a
|
LIBBAS=libbas.a
|
||||||
@@ -145,10 +145,10 @@ ifeq (firebee,$(1))
|
|||||||
else
|
else
|
||||||
MACHINE=MACHINE_M5484LITE
|
MACHINE=MACHINE_M5484LITE
|
||||||
endif
|
endif
|
||||||
$(1)/objs/%.o:$(SRCDIR)/%.c
|
$(1)/objs/%.o:%.c
|
||||||
$(CC) $$(CFLAGS) -D$$(MACHINE) $(INCLUDE) -c $$< -o $$@
|
$(CC) $$(CFLAGS) -D$$(MACHINE) $(INCLUDE) -c $$< -o $$@
|
||||||
|
|
||||||
$(1)/objs/%.o:$(SRCDIR)/%.S
|
$(1)/objs/%.o:%.S
|
||||||
$(CC) $$(CFLAGS) -Wa,--bitwise-or -D$$(MACHINE) $(INCLUDE) -c $$< -o $$@
|
$(CC) $$(CFLAGS) -Wa,--bitwise-or -D$$(MACHINE) $(INCLUDE) -c $$< -o $$@
|
||||||
endef
|
endef
|
||||||
$(foreach DIR,$(TRGTDIRS),$(eval $(call CC_TEMPLATE,$(DIR))))
|
$(foreach DIR,$(TRGTDIRS),$(eval $(call CC_TEMPLATE,$(DIR))))
|
||||||
|
|||||||
@@ -789,10 +789,10 @@ void init_pci(void)
|
|||||||
xprintf("initializing PCI bridge:\r\n");
|
xprintf("initializing PCI bridge:\r\n");
|
||||||
|
|
||||||
(void) res; /* for now */
|
(void) res; /* for now */
|
||||||
res = register_interrupt_handler(5, INT_SOURCE_PCIARB, 5, 1, pci_arb_interrupt);
|
res = register_interrupt_handler(0, INT_SOURCE_PCIARB, 5, 5, pci_arb_interrupt);
|
||||||
debug_printf("registered interrupt handler for PCI arbiter: %s\r\n",
|
debug_printf("registered interrupt handler for PCI arbiter: %s\r\n",
|
||||||
(res < 0 ? "failed" : "succeeded"));
|
(res < 0 ? "failed" : "succeeded"));
|
||||||
register_interrupt_handler(5, INT_SOURCE_XLBPCI, 5, 0, xlb_pci_interrupt);
|
register_interrupt_handler(0, INT_SOURCE_XLBPCI, 5, 5, xlb_pci_interrupt);
|
||||||
debug_printf("registered interrupt handler for XLB PCI: %s\r\n",
|
debug_printf("registered interrupt handler for XLB PCI: %s\r\n",
|
||||||
(res < 0 ? "failed" : "succeeded"));
|
(res < 0 ? "failed" : "succeeded"));
|
||||||
|
|
||||||
100
sources/main.c
100
sources/main.c
@@ -1,100 +0,0 @@
|
|||||||
/*----------------------------------------------------------------------*/
|
|
||||||
/* FatFs sample project for generic microcontrollers (C)ChaN, 2012 */
|
|
||||||
/*----------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "ff.h"
|
|
||||||
|
|
||||||
|
|
||||||
FATFS Fatfs; /* File system object */
|
|
||||||
FIL Fil; /* File object */
|
|
||||||
uint8_t Buff[128]; /* File read buffer */
|
|
||||||
|
|
||||||
|
|
||||||
void die ( /* Stop with dying message */
|
|
||||||
FRESULT rc /* FatFs return value */
|
|
||||||
)
|
|
||||||
{
|
|
||||||
xprintf("Failed with rc=%u.\n", rc);
|
|
||||||
for (;;) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
|
||||||
/* Program Main */
|
|
||||||
/*-----------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
int main (void)
|
|
||||||
{
|
|
||||||
FRESULT rc; /* Result code */
|
|
||||||
DIR dir; /* Directory object */
|
|
||||||
FILINFO fno; /* File information object */
|
|
||||||
uint32_t bw, br, i;
|
|
||||||
|
|
||||||
|
|
||||||
f_mount(0, &Fatfs); /* Register volume work area (never fails) */
|
|
||||||
|
|
||||||
xprintf("\nOpen an existing file (message.txt).\n");
|
|
||||||
rc = f_open(&Fil, "MESSAGE.TXT", FA_READ);
|
|
||||||
if (rc) die(rc);
|
|
||||||
|
|
||||||
xprintf("\nType the file content.\n");
|
|
||||||
for (;;) {
|
|
||||||
rc = f_read(&Fil, Buff, sizeof Buff, &br); /* Read a chunk of file */
|
|
||||||
if (rc || !br) break; /* Error or end of file */
|
|
||||||
for (i = 0; i < br; i++) /* Type the data */
|
|
||||||
putchar(Buff[i]);
|
|
||||||
}
|
|
||||||
if (rc) die(rc);
|
|
||||||
|
|
||||||
xprintf("\nClose the file.\n");
|
|
||||||
rc = f_close(&Fil);
|
|
||||||
if (rc) die(rc);
|
|
||||||
|
|
||||||
xprintf("\nCreate a new file (hello.txt).\n");
|
|
||||||
rc = f_open(&Fil, "HELLO.TXT", FA_WRITE | FA_CREATE_ALWAYS);
|
|
||||||
if (rc) die(rc);
|
|
||||||
|
|
||||||
xprintf("\nWrite a text data. (Hello world!)\n");
|
|
||||||
rc = f_write(&Fil, "Hello world!\r\n", 14, &bw);
|
|
||||||
if (rc) die(rc);
|
|
||||||
xprintf("%u bytes written.\n", bw);
|
|
||||||
|
|
||||||
xprintf("\nClose the file.\n");
|
|
||||||
rc = f_close(&Fil);
|
|
||||||
if (rc) die(rc);
|
|
||||||
|
|
||||||
xprintf("\nOpen root directory.\n");
|
|
||||||
rc = f_opendir(&dir, "");
|
|
||||||
if (rc) die(rc);
|
|
||||||
|
|
||||||
xprintf("\nDirectory listing...\n");
|
|
||||||
for (;;) {
|
|
||||||
rc = f_readdir(&dir, &fno); /* Read a directory item */
|
|
||||||
if (rc || !fno.fname[0]) break; /* Error or end of dir */
|
|
||||||
if (fno.fattrib & AM_DIR)
|
|
||||||
xprintf(" <dir> %s\n", fno.fname);
|
|
||||||
else
|
|
||||||
xprintf("%8lu %s\n", fno.fsize, fno.fname);
|
|
||||||
}
|
|
||||||
if (rc) die(rc);
|
|
||||||
|
|
||||||
xprintf("\nTest completed.\n");
|
|
||||||
for (;;) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------*/
|
|
||||||
/* User Provided Timer Function for FatFs module */
|
|
||||||
/*---------------------------------------------------------*/
|
|
||||||
|
|
||||||
uint32_t get_fattime (void)
|
|
||||||
{
|
|
||||||
return ((uint32_t)(2012 - 1980) << 25) /* Year = 2012 */
|
|
||||||
| ((uint32_t)1 << 21) /* Month = 1 */
|
|
||||||
| ((uint32_t)1 << 16) /* Day_m = 1*/
|
|
||||||
| ((uint32_t)0 << 11) /* Hour = 0 */
|
|
||||||
| ((uint32_t)0 << 5) /* Min = 0 */
|
|
||||||
| ((uint32_t)0 >> 1); /* Sec = 0 */
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user