From 3ddb4be6d5c0f21590d8d7cc35e25df241e0af35 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 4 Nov 2019 09:16:33 +0100 Subject: add support for EnergyTrace++ output with JSTATE field --- bin/msp430-etv | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/msp430-etv b/bin/msp430-etv index b4f1b89..28aaa5d 100755 --- a/bin/msp430-etv +++ b/bin/msp430-etv @@ -177,7 +177,13 @@ if __name__ == '__main__': for i, line in enumerate(data_lines): if i >= opt['skip']: - timestamp, current, voltage, total_energy = map(float, line.split(' ')) + fields = line.split(' ') + if len(fields) == 4: + timestamp, current, voltage, total_energy = map(float, line.split(' ')) + elif len(fields) == 5: + cpustate, timestamp, current, voltage, total_energy = map(float, line.split(' ')) + else: + raise RuntimeError('cannot parse line "{}"'.format(line)) data[i - opt['skip']] = [timestamp, current, voltage, total_energy] m_duration_us = data[-1, 0] - data[0, 0] -- cgit v1.2.3