From 2e36ac14c1fb219e8eb2e1f4efb79af70e7ab0e5 Mon Sep 17 00:00:00 2001 From: Aaron de los Santos Date: Fri, 11 Jun 2021 17:05:33 -0700 Subject: [PATCH] Update makefile to generate new arduino enums file Added command to makefile to generate enums.h for Arduino use. Did the same for the dockerfile. Added note on developer-guide markdown file to also update enums.h along with enums.py. --- Dockerfile | 4 ++++ Firmware/Makefile | 1 + docs/developer-guide.md | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8810dc23..5356399f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,10 @@ CMD \ --definitions odrive-interface.yaml \ --template ../tools/enums_template.j2 \ --output ../tools/odrive/enums.py && \ + python interface_generator_stub.py \ + --definitions odrive-interface.yaml \ + --template ../tools/arduino_enums_template.j2 \ + --output ../Arduino/ODriveArduino/enums.h && \ # Hack around Tup's dependency on FUSE tup init && \ tup generate build.sh && \ diff --git a/Firmware/Makefile b/Firmware/Makefile index 3191c4a2..bac32559 100644 --- a/Firmware/Makefile +++ b/Firmware/Makefile @@ -32,6 +32,7 @@ all: @$(PY_CMD) ../tools/odrive/version.py --output autogen/version.c @tup --quiet -no-environ-check @$(PY_CMD) interface_generator_stub.py --definitions odrive-interface.yaml --template ../tools/enums_template.j2 --output ../tools/odrive/enums.py + @$(PY_CMD) interface_generator_stub.py --definitions odrive-interface.yaml --template ../tools/arduino_enums_template.j2 --output ../Arduino/ODriveArduino/enums.h # Copy libfibre files to odrivetool if they were built @ ! test -f "fibre-cpp/build/libfibre-linux-amd64.so" || cp fibre-cpp/build/libfibre-linux-amd64.so ../tools/odrive/pyfibre/fibre/ diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 360baaea..f3b70fb9 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -332,4 +332,4 @@ When filing a PR please go through this checklist: - Also, for each removed/moved/renamed API item use your IDE's search feature to search for occurrences of this name. Update the places you found (this will usually be documentation and test scripts). - If you added things to `odrive-interface.yaml` make sure the new things have decent documentation in the YAML file. We don't expect 100% coverage but use good sense of what to document. - Make sure your PR doesn't contain spurious changes that unnecessarily add or remove whitespace. These add noise and make the reviewer's lifes harder. - - If you changed any enums in `odrive-interface.yaml`, make sure you update [enums.py](../tools/odrive/enums.py). The file includes instructions on how to do this. Check the diff to verify that none of the existing enumerators changed their value. + - If you changed any enums in `odrive-interface.yaml`, make sure you update [enums.py](../tools/odrive/enums.py) and [enums.h](../Arduino/ODriveArduino/enums.h). The file includes instructions on how to do this. Check the diff to verify that none of the existing enumerators changed their value.