mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-12-28 05:51:53 +01:00
5b85b0f661
* [SC64][SW] Added board bring-up via UART header * [SC64][SW] Made I2C in primer stable * [SC64][SW] LCMXO2 primer fixes * [SC64][SW] SC64 primer PC software * [SC64][SW] Added primer.py to release package * [SC64][SW] Fixed FPGA refresh * [SC64][SW] Changed release package contents
26 lines
526 B
Python
26 lines
526 B
Python
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if (len(sys.argv) != 2):
|
|
print(f"Usage: python {sys.argv[0]} file_path")
|
|
sys.exit(1)
|
|
|
|
file = sys.argv[1]
|
|
|
|
try:
|
|
data = b''
|
|
with open(file, 'rb') as f:
|
|
data = f.read()
|
|
with open(file, 'wb') as f:
|
|
f.write(data.strip(b'\xFF'))
|
|
except FileNotFoundError:
|
|
print(f"Couldn't open file \"{file}\"")
|
|
sys.exit(2)
|
|
except Exception as e:
|
|
print(e)
|
|
sys.exit(3)
|