OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /minsoc/tags/release-0.9/sw/eth
    from Rev 39 to Rev 42
    Reverse comparison

Rev 39 → Rev 42

/eth.c
0,0 → 1,62
#include "../support/support.h"
#include "../support/board.h"
 
#include "../support/spr_defs.h"
 
#include "../drivers/uart.h"
#include "../drivers/eth.h"
 
 
extern int eth_rx_len;
extern int eth_rx_done, eth_tx_done;
extern unsigned char * eth_rx_data;
extern unsigned char * eth_tx_data;
 
void eth_receive()
{
int i;
uart_print_str("Length: \n");
uart_print_long(eth_rx_len);
uart_print_str("\n");
uart_print_str("Data: \n");
for ( i = 0; i < eth_rx_len; i++ )
{
uart_print_short(eth_rx_data[i]);
uart_print_str("\n");
}
eth_recv_ack();
}
 
int main()
{
unsigned long lalala;
uart_init();
 
int_init();
eth_init();
int_add(UART_IRQ, &uart_interrupt);
int_add(ETH_IRQ, &eth_interrupt);
/* We can't use printf because in this simple example
we don't link C library. */
uart_print_str("Hello World.\n\r");
 
eth_tx_data[0] = 0xFF;
eth_tx_data[1] = 0x2B;
eth_tx_data[2] = 0x40;
eth_tx_data[3] = 0x50;
 
eth_send(4);
 
while(1)
{
if (eth_rx_done)
{
eth_receive();
}
}
report(0xdeaddead);
or32_exit(0);
}
 
eth.c Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: Makefile =================================================================== --- Makefile (nonexistent) +++ Makefile (revision 42) @@ -0,0 +1,24 @@ +cases = eth-nocache eth-icdc +common = ../support/libsupport.a ../support/except.o +drivers = ../drivers/libdrivers.a + +all: $(cases) + +eth-nocache: eth.o ../support/reset-nocache.o $(common) $(drivers) + $(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) $(GCC_LIB_OPTS) -T ../support/orp.ld $? -o $@.or32 + $(OR32_TOOL_PREFIX)-objcopy -O binary $@.or32 $@.bin + ../utils/bin2hex $@.bin 1 -size_word > $@$(FLASH_MEM_HEX_FILE_SUFFIX).hex + ../utils/bin2vmem $@.bin > $@.vmem + + +eth-icdc: eth.o ../support/reset-icdc.o $(common) $(drivers) + $(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) $(GCC_LIB_OPTS) -T ../support/orp.ld $? -o $@.or32 + $(OR32_TOOL_PREFIX)-objcopy -O binary $@.or32 $@.bin + ../utils/bin2hex $@.bin 1 -size_word > $@$(FLASH_MEM_HEX_FILE_SUFFIX).hex + ../utils/bin2vmem $@.bin > $@.vmem + + +eth.o: eth.c + $(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) $? -c -o $@ + +include ../support/Makefile.inc
Makefile Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.