summaryrefslogtreecommitdiff
path: root/py/genlast.py
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-12-02 12:51:43 -0800
committerGitHub <noreply@github.com>2020-12-02 12:51:43 -0800
commitd7ba641ff646b48e5ad38ff72a2dcfe17bb54624 (patch)
treea0c4f9fb561b2caa38636645ca27f0ddad59f087 /py/genlast.py
parent5b3c930e384ef6440f0f7b5167bb54ea68a8be76 (diff)
parent72fa7d88b881d2ed9978c0bd65ce5f8d6eb51703 (diff)
Merge pull request #3767 from dhalbert/sleep
Initial alarm and sleep PR: time alarms with light and deep sleep; PinAlarms not yet implemented
Diffstat (limited to 'py/genlast.py')
-rw-r--r--py/genlast.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/genlast.py b/py/genlast.py
index 1df2a2482..5b195d23e 100644
--- a/py/genlast.py
+++ b/py/genlast.py
@@ -47,7 +47,9 @@ def preprocess(command, output_dir, fn):
print(e, file=sys.stderr)
def maybe_preprocess(command, output_dir, fn):
- if subprocess.call(["grep", "-lqE", "(MP_QSTR|translate)", fn]) == 0:
+ # Preprocess the source file if it contains "MP_QSTR", "translate",
+ # or if it uses enum.h (which generates "MP_QSTR" strings.
+ if subprocess.call(["grep", "-lqE", r"(MP_QSTR|translate|enum\.h)", fn]) == 0:
preprocess(command, output_dir, fn)
if __name__ == '__main__':