diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-25 12:36:58 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-25 12:36:58 +0200 |
commit | 67ac62c0264cbe37c1a096ff7765ecdddaba853a (patch) | |
tree | 40cca2206baba0777cab41115b53ae9c21c6141e /bin | |
parent | 94f2ed4b0a7a6fe4365a00c3b015e769f91006b8 (diff) |
perform peripheral setup after MIMOSA calibration
Otherwise, initialization steps may be undone by the calibration
(as it removes VCC from the device)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/generate-dfa-benchmark.py | 9 |
1 files changed, 6 insertions, 3 deletions
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)) |