From 67ac62c0264cbe37c1a096ff7765ecdddaba853a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 25 Sep 2019 12:36:58 +0200 Subject: perform peripheral setup after MIMOSA calibration Otherwise, initialization steps may be undone by the calibration (as it removes VCC from the device) --- bin/generate-dfa-benchmark.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index 809f8b5..65da4be 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -69,11 +69,9 @@ def benchmark_from_runs(pta: PTA, runs: list, harness: OnboardTimerHarness, benc outbuf.write('int main(void)\n') outbuf.write('{\n') + for driver in ('arch', 'gpio', 'kout'): outbuf.write('{}.setup();\n'.format(driver)) - if 'setup' in pta.codegen: - for call in pta.codegen['setup']: - outbuf.write(call) # There is a race condition between flashing the code and starting the UART log. # When starting the log before flashing, output from a previous benchmark may cause bogus data to be added. @@ -82,6 +80,11 @@ def benchmark_from_runs(pta: PTA, runs: list, harness: OnboardTimerHarness, benc # This is also useful to faciliate MIMOSA calibration after flashing outbuf.write('arch.delay_ms(12000);\n') + if 'setup' in pta.codegen: + for call in pta.codegen['setup']: + outbuf.write(call) + + if repeat: outbuf.write('unsigned char i = 0;\n') outbuf.write('while (i++ < {}) {{\n'.format(repeat)) -- cgit v1.2.3