summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-24 14:58:20 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-24 14:58:20 +0100
commit572721143ae46d9a1b9a3b4119fdca481b963a20 (patch)
treeb0083c3d393dca18c160657c5be34ab5097d0043 /src
parent3e69313f789834c6e83bec187fc7cb7d4dbfe919 (diff)
Add "make cat" target (includes cycle to ms conversion)
Diffstat (limited to 'src')
-rw-r--r--src/app/countertest/main.cc18
-rw-r--r--src/arch/msp430fr5994lp/Makefile.inc7
2 files changed, 14 insertions, 11 deletions
diff --git a/src/app/countertest/main.cc b/src/app/countertest/main.cc
index cf3a136..e0a7394 100644
--- a/src/app/countertest/main.cc
+++ b/src/app/countertest/main.cc
@@ -12,47 +12,47 @@ void loop(void)
{
counter.start();
counter.stop();
- kout << "nop: " << counter.value << "/" << counter.overflow << endl;
+ kout << "nop: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_us(10);
counter.stop();
- kout << "10us: " << counter.value << "/" << counter.overflow << endl;
+ kout << "10us: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_us(20);
counter.stop();
- kout << "20us: " << counter.value << "/" << counter.overflow << endl;
+ kout << "20us: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_ms(1);
counter.stop();
- kout << "1ms: " << counter.value << "/" << counter.overflow << endl;
+ kout << "1ms: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_ms(2);
counter.stop();
- kout << "2ms: " << counter.value << "/" << counter.overflow << endl;
+ kout << "2ms: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_ms(4);
counter.stop();
- kout << "4ms: " << counter.value << "/" << counter.overflow << endl;
+ kout << "4ms: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_ms(8);
counter.stop();
- kout << "8ms: " << counter.value << "/" << counter.overflow << endl;
+ kout << "8ms: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_ms(16);
counter.stop();
- kout << "16ms: " << counter.value << "/" << counter.overflow << endl;
+ kout << "16ms: " << counter.value << "/" << counter.overflow << " cycles" << endl;
counter.start();
arch.delay_ms(32);
counter.stop();
- kout << "32ms: " << counter.value << "/" << counter.overflow << endl;
+ kout << "32ms: " << counter.value << "/" << counter.overflow << " cycles" << endl;
}
int main(void)
diff --git a/src/arch/msp430fr5994lp/Makefile.inc b/src/arch/msp430fr5994lp/Makefile.inc
index 1c8b331..57a7d2c 100644
--- a/src/arch/msp430fr5994lp/Makefile.inc
+++ b/src/arch/msp430fr5994lp/Makefile.inc
@@ -169,7 +169,7 @@ build/system.elf: ${OBJECTS}
-Wl,--library-path=/opt/msp430/ti/msp430-gcc-full-linux-5.1.2.0/include/ \
-Wl,--gc-sections \
-o $@ ${OBJECTS}
- ${QUIET}${SIZE} build/system.elf | tail -n1 | awk '{ print " ROM: " int(($$1+$$2)*100/49152) "% RAM: " int(($$2+$$3)*100/4096) "%" }'
+ ${QUIET}${SIZE} build/system.elf | tail -n1 | awk '{ print " ROM: " ($$1+$$2) " (" int(($$1+$$2)*100/49152) "%) RAM: " ($$2 + $$3) " (" int(($$2+$$3)*100/4096) "%)" }'
build/system.hex: build/system.elf
${QUIET}${OBJCOPY} -O ihex ${@:.hex=.elf} $@
@@ -183,6 +183,9 @@ program: build/system.hex
arch_clean:
${QUIET}rm -f ${OBJECTS} build/system.hex
+cat:
+ ${QUIET}script/cat.py /dev/${SERIAL_PORT} ${uart_freq} ${cpu_freq} 65536
+
monitor:
${QUIET}screen /dev/${SERIAL_PORT} ${uart_freq}
@@ -217,4 +220,4 @@ attributes: build/system.elf
${QUIET}script/size.py ${SIZE} text,data data,bss
endif
-.PHONY: arch_clean arch_help arch_info attributes monitor program
+.PHONY: arch_clean arch_help arch_info attributes cat monitor program