Use templating for generated files#39
Use templating for generated files#39JamesH65 merged 8 commits intoraspberrypi:masterfrom matiasilva:use-templates
Conversation
|
That looks much better - nice one. The problem with this being my first Python program is you simply don't know what libraries exist to help you out! |
| // This example will use I2C0 on GPIO8 (SDA) and GPIO9 (SCL) running at 400KHz. | ||
| // Pins can be changed, see the GPIO function select table in the datasheet for information on GPIO assignments | ||
| #define I2C_PORT i2c0 | ||
| #define I2C_SDA 8 |
There was a problem hiding this comment.
@kilograham I think this project-generator was created before we added the "board headers" to the Raspberry Pi Pico SDK. Should we now update the pin-numbers used here (for the various interfaces) to match up with https://github.com/raspberrypi/pico-sdk/blob/master/src/boards/include/boards/pico.h ?
There was a problem hiding this comment.
Needs to be a separate issue.
|
There's quite a large diff in the main Python file, mostly owing to large blocks of text being removed but also due to applying |
|
Might be worth applying autopep8 first on a new branch, to keep whitespace and technical changes separate - makes doing a review diff difficult if they are mixed together. |
Yes, good idea. See #40. |
|
Going to have to revert this as found a load of problems. |
This PR adds templating for the various generated files, allowing us to separate logic from text formatting. It pulls out a considerable amount of strings and text into files. This makes the main code a lot cleaner and readable. It also means we can easily extend the project generator to do many more things if needed.