fix(datasheet): fails when "bidirectional" is empty

e.g.

```yaml
documentation:
  ...

# A description of what the inputs do (e.g. red button, SPI CLK, SPI MOSI, etc).
  inputs:
    - sclrn
    - ser
    - rck
    - srck
    - G
# A description of what the outputs do (e.g. status LED, SPI MISO, etc)
  outputs:
    - q[0]
    - q[1]
    - q[2]
    - q[3]
    - q[4]
    - q[5]
    - q[6]
    - q[7]
# A description of what the bidirectional I/O pins do (e.g. I2C SDA, I2C SCL, etc)
  bidirectional:

```
This commit is contained in:
Uri Shaked
2023-09-30 07:58:45 +03:00
parent 2387160df7
commit 5925525982
+2
View File
@@ -117,6 +117,8 @@ class Docs:
# many people remove unused pins in input / output / bidirectional # many people remove unused pins in input / output / bidirectional
for key in ["inputs", "outputs", "bidirectional"]: for key in ["inputs", "outputs", "bidirectional"]:
if not yaml_data[key]:
yaml_data[key] = []
yaml_data[key].extend((8 - len(yaml_data[key])) * ["n/a"]) yaml_data[key].extend((8 - len(yaml_data[key])) * ["n/a"])
# now build the doc & print it # now build the doc & print it