From cba83e780a9350eb45eb1c2f09fc87f5d389e1ac Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 20 May 2018 15:54:03 +0200 Subject: Move documentation and simulation stuff to its own subdir --- firmware/calc_framerate.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 firmware/calc_framerate.py (limited to 'firmware/calc_framerate.py') diff --git a/firmware/calc_framerate.py b/firmware/calc_framerate.py deleted file mode 100644 index aaedc4d..0000000 --- a/firmware/calc_framerate.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 - -TIMER_FREQ = 30e6 # MHz - - -with open('main.c') as f: - lines = f.readlines() - -defs = {} -for line in lines: - if line.startswith('#define'): - _pragma, name, val, *_comment = line.split() - val = defs.get(val, val) - defs[name] = val - -print('Bit cycle timings:') -timings_total = 0 -in_array = False -for line in lines: - if not in_array: - if line.startswith('static uint16_t timer_period_lookup'): - in_array = True - else: - if '}' in line: - break - if ',' not in line: - continue - val, *_comment = line.split(',') - for name, defval in defs.items(): - val = val.replace(name, defval) - duration = eval(val) - print(duration) - timings_total += duration + int(defs['RESET_PERIOD_LENGTH']) - -total_len = timings_total/TIMER_FREQ -print('Total cycles:', timings_total) -print('Total cycle length: {:.3f}ms'.format(total_len*1e3)) -print('Frame rate: {:.3f}Hz'.format(1/total_len)) -- cgit