Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Oct 10, 2023
1 parent acd034d commit 8758ef3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions esp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@

class Esp:

def __init__(
self, nand: bool = False, xavier: bool = False, orin: bool = False, device: Optional[str] = None) -> None:
def __init__(self,
nand: bool = False,
xavier: bool = False,
orin: bool = False,
device: Optional[str] = None,
) -> None:
print('Initializing ESP...')
self.en = 436 if xavier else 492 if orin else 216
self.g0 = 428 if xavier else 460 if orin else 50
Expand All @@ -24,7 +28,7 @@ def write(self, path: str, value: Union[str, int]) -> None:
print(f'echo {value:3} > /sys/class/gpio/{path}')
with open(f'/sys/class/gpio/{path}', 'w') as f:
f.write(f'{value}\n')
except:
except Exception:
print(f'could not write {value} to {path}')

@contextmanager
Expand Down

0 comments on commit 8758ef3

Please sign in to comment.