URL
https://opencores.org/ocsvn/openmsp430/openmsp430/trunk
Subversion Repositories openmsp430
Compare Revisions
- This comparison shows the changes necessary to convert path
/openmsp430/trunk/core/sim/rtl_sim/src-c/dhrystone_4mcu
- from Rev 211 to Rev 202
- ↔ Reverse comparison
Rev 211 → Rev 202
/mylib/cprintf.h
File deleted
/mylib/copydata.c
File deleted
/mylib/cprintf.c
File deleted
/omsp_func.h
40,8 → 40,7
//---------------------------------------------------------- |
// SPECIAL FUNCTION REGISTERS |
//---------------------------------------------------------- |
#define IE1_set_wdtie() __asm__ __volatile__ ("bis.b #0x01, &0x0000") |
//#define IE1 (*(volatile unsigned char *) 0x0000) |
#define IE1 (*(volatile unsigned char *) 0x0000) |
#define IFG1 (*(volatile unsigned char *) 0x0002) |
|
#define CPU_ID_LO (*(volatile unsigned char *) 0x0004) |
122,6 → 121,4
// FUNCTIONS |
//============================================================================= |
|
// Replace printf statements with custom one |
#include "mylib/cprintf.h" |
#define printf cprintf |
//int putchar (int txdata); |
/linker.msp430-elf.x
237,7 → 237,7
/* DWARF 2 */ |
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
.debug_abbrev 0 : { *(.debug_abbrev) } |
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } |
.debug_line 0 : { *(.debug_line) } |
.debug_frame 0 : { *(.debug_frame) } |
.debug_str 0 : { *(.debug_str) } |
.debug_loc 0 : { *(.debug_loc) } |
/copydata.c
0,0 → 1,15
#include <stdint.h> |
#include <string.h> |
|
extern char __datastart; |
extern char __romdatastart; |
extern char __romdatacopysize; |
static void* const datastart=&__datastart; |
static void* const romdatastart=&__romdatastart; |
static uint16_t const romdatacopysize=(uint16_t)&__romdatacopysize; |
|
__attribute__((constructor)) void __data_move() { |
if (datastart!=romdatastart) { |
memmove(datastart,romdatastart,romdatacopysize); |
} |
} |
/makefile
1,12 → 1,11
# makfile configuration |
NAME = dhrystone_4mcu |
OBJECTS = dhry21a.o dhry21b.o omsp_func.o mylib/copydata.o mylib/cprintf.o |
OBJECTS = dhry21a.o dhry21b.o omsp_func.o copydata.o |
|
# Compiler performance option (-Os / -O2 / -O3) |
PORT_CFLAGS = -O2 |
|
# Choose GCC toolchain prefix ('msp430' for MSPGCC / 'msp430-elf' for GCC RedHat/TI) |
MSPGCC_PFX = msp430-elf |
ifndef MSPGCC_PFX |
MSPGCC_PFX = msp430 |
endif |
25,12 → 24,11
CC = ${MSPGCC_PFX}-gcc |
OBJCOPY = ${MSPGCC_PFX}-objcopy |
OBJDUMP = ${MSPGCC_PFX}-objdump |
OBJSIZE = ${MSPGCC_PFX}-size |
|
.PHONY: all FORCE clean download dist |
|
#all should be the first target. it's built when make is runwithout args |
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${NAME}.size |
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst |
|
#configure the next line if you want to use the serial download |
download: download-uart |
45,14 → 43,11
${NAME}.lst: ${NAME}.elf |
${OBJDUMP} -dSt $^ >$@ |
|
${NAME}.size: ${NAME}.elf |
${OBJSIZE} $^ >$@ |
|
download-uart: all |
openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf |
|
clean: |
rm -f ${NAME} ${NAME}.a43 ${NAME}.lst ${NAME}.elf ${NAME}.size *.o mylib/*.o |
rm -f ${NAME} ${NAME}.a43 ${NAME}.lst ${NAME}.elf *.o |
|
#backup archive |
dist: |
65,5 → 60,4
dhry_21a.o: dhry_21a.c |
dhry_21b.o: dhry_21b.c |
omsp_func.o: omsp_func.c |
mylib/copydata.o: mylib/copydata.c |
mylib/cprintf.o: mylib/cprintf.c |
copydata.o: copydata.c |
/omsp_func.c
39,8 → 39,7
// putChar function // |
// (Send a byte to the Port-1) // |
//--------------------------------------------------// |
//int putchar (int txdata) { |
int tty_putc (int txdata) { |
int putchar (int txdata) { |
|
// Write the output character to the Port-1 |
P1OUT = txdata; |