Skip to content

Commit

Permalink
Merge pull request #260 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Release Candidate v4.3.2
  • Loading branch information
ruck314 authored Mar 16, 2022
2 parents ec38937 + 9a7eb35 commit 6fd89eb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
61 changes: 61 additions & 0 deletions scripts/bin2txt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Description:
# Script to convert the .bin file from opalkelly
# into a .txt file for DM160237 I2C Evaluation Kit GUI
# ----------------------------------------------------------------------------
# https://opalkelly.com/tools/fmceepromgenerator/
# https://www.microchip.com/en-us/development-tool/DM160237
# ----------------------------------------------------------------------------
# This file is part of the 'SLAC Firmware Standard Library'. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
# No part of the 'SLAC Firmware Standard Library', including this file, may be
# copied, modified, propagated, or distributed except according to the terms
# contained in the LICENSE.txt file.
# ----------------------------------------------------------------------------

import argparse

from array import array

#################################################################

# Set the argument parser
parser = argparse.ArgumentParser()

parser.add_argument(
"--bin",
type = str,
required = True,
help = "path to .bin file",
)

parser.add_argument(
"--txt",
type = str,
required = True,
help = "path to .txt file",
)

# Get the arguments
args = parser.parse_args()

#################################################################

if __name__ == '__main__':

# Load the FRU binary file into python array
data = array('B')
with open(args.bin, 'rb') as f:
data.fromfile(f, 256)

# Write the loaded data into a text file
ofd = open(args.txt, 'w')
for i in range(len(data)):
byte = hex(data[i]).upper()[2:].zfill(2)
ofd.write(byte)
if (i%8==7):
ofd.write('\n')
ofd.close()
4 changes: 2 additions & 2 deletions scripts/createNewRepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ def argBool(s):
'--adminTeam',
nargs = '+',
required = False,
default = [ ['slaclab','tid-air-es-admin'] ],
default = [ ['slaclab','tid-id-es-admin'] ],
help = 'List of admin teams [org,team_name]'
)

parser.add_argument(
'--writeTeam',
nargs = '+',
required = False,
default = [ ['slaclab','tidaires'] ],
default = [ ['slaclab','tid-id-es'] ],
help = 'List of write teams [org,team_name]'
)

Expand Down

0 comments on commit 6fd89eb

Please sign in to comment.