forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from commaai/master
[pull] master from commaai:master
- Loading branch information
Showing
151 changed files
with
5,102 additions
and
3,129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ a.out | |
config.json | ||
clcache | ||
compile_commands.json | ||
compare_runtime*.html | ||
|
||
persist | ||
board/obj/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cereal
updated
from 589ef0 to d3a943
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
from typing import Optional | ||
|
||
def gpio_init(pin: int, output: bool) -> None: | ||
try: | ||
with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f: | ||
f.write(b"out" if output else b"in") | ||
except Exception as e: | ||
print(f"Failed to set gpio {pin} direction: {e}") | ||
|
||
|
||
def gpio_set(pin: int, high: bool) -> None: | ||
try: | ||
with open(f"/sys/class/gpio/gpio{pin}/value", 'wb') as f: | ||
f.write(b"1" if high else b"0") | ||
except Exception as e: | ||
print(f"Failed to set gpio {pin} value: {e}") | ||
|
||
def gpio_read(pin: int) -> Optional[bool]: | ||
val = None | ||
try: | ||
with open(f"/sys/class/gpio/gpio{pin}/value", 'rb') as f: | ||
val = bool(int(f.read().strip())) | ||
except Exception as e: | ||
print(f"Failed to set gpio {pin} value: {e}") | ||
|
||
return val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.