Skip to content

Commit

Permalink
fix: Document generation
Browse files Browse the repository at this point in the history
  • Loading branch information
zfields committed Nov 9, 2024
1 parent 5a26d8a commit 60e701b
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 10 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"matepek.vscode-catch2-test-adapter",
"ms-vscode.cpptools",
"shardulm94.trailing-spaces",
"twxs.cmake"
Expand Down
55 changes: 54 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@
"isDefault": true
}
},
{
"label": "Note-C: Compile and Run ALL Tests (with coverage)",
"type": "cppbuild",
"command": "./scripts/run_unit_tests.sh",
"args": [
"--coverage",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "Note-C: Compile and Run ALL Tests (with coverage and memory check)",
"type": "cppbuild",
Expand Down Expand Up @@ -51,6 +69,41 @@
"group": {
"kind": "none"
}
},
{
"label": "Note-C: Generate Coverage HTML",
"type": "shell",
"command": "genhtml lcov.info -o tmp",
"args": [],
"options": {
"cwd": "${workspaceFolder}/build/test/coverage",
"env": {
"LC_ALL": "C"
}
},
"problemMatcher": [],
"group": {
"kind": "none"
},
"dependsOn": [
"Note-C: Compile and Run ALL Tests (with coverage)"
]
},
{
"label": "Note-C: Generate Documentation",
"type": "shell",
"command": "./scripts/build_docs.sh",
"args": [],
"options": {
"cwd": "${workspaceFolder}",
"env": {
"LC_ALL": "C"
}
},
"problemMatcher": [],
"group": {
"kind": "none"
}
}
]
}
}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ARG USER

# Local Argument(s)

# Local Environment Variable(s)
ENV LC_ALL="C.UTF-8"

# Create Non-Root User
RUN ["dash", "-c", "\
addgroup \
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
# Options for HTML output

html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# WARNING: Calling get_html_theme_path is deprecated. If you are calling it to define html_theme_path, you are safe to remove that code.
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_logo = str(NOTE_C_BASE / 'assets' / 'blues_logo_no_text.png')
html_theme_options = {
'logo_only': True,
Expand Down
14 changes: 7 additions & 7 deletions docs/library_initialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ The code below from `Src/main.c <https://github.com/blues/note-stm32l4/blob/mast
NoteSetFnSerial(_noteSerialReset, _noteSerialTransmit, _noteSerialAvailable, _noteSerialReceive);
#endif
``_noteSerialReset``
`_noteSerialReset`
^^^^^^^^^^^^^^^^^^^

.. code-block:: c
Expand All @@ -163,7 +163,7 @@ The code below from `Src/main.c <https://github.com/blues/note-stm32l4/blob/mast
The serial reset hook reinitializes the serial peripheral connected to the Notecard.

``_noteSerialTransmit``
`_noteSerialTransmit`
^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: c
Expand All @@ -174,7 +174,7 @@ The serial reset hook reinitializes the serial peripheral connected to the Notec
The serial transmit hook uses the HAL to write the data in the buffer to the serial peripheral connected to the Notecard.

``_noteSerialAvailable``
`_noteSerialAvailable`
^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: c
Expand All @@ -185,7 +185,7 @@ The serial transmit hook uses the HAL to write the data in the buffer to the ser
For receiving serial data from the Notecard, note-stm32l4 uses a circular buffer. In the receive interrupt handler for the UART peripheral, this buffer gets populated with the received data. ``serialFillIndex`` is the write index into that buffer, and ``serialDrainIndex`` is the read index. If the two indices are equal, there's nothing new to read. If they aren't equal, there is something to read.

``_noteSerialReceive``
`_noteSerialReceive`
^^^^^^^^^^^^^^^^^^^^^

.. code-block:: c
Expand All @@ -204,7 +204,7 @@ For receiving serial data from the Notecard, note-stm32l4 uses a circular buffer
The serial receive hook returns the byte from the circular receive buffer at the read index, handling the case where the index wraps around to 0.

``_noteI2CReset``
`_noteI2CReset`
^^^^^^^^^^^^^^^^

.. code-block:: c
Expand All @@ -218,7 +218,7 @@ The serial receive hook returns the byte from the circular receive buffer at the
The I2C reset hook reinitializes the I2C peripheral used to communicate with the Notecard.

``_noteI2CTransmit``
`_noteI2CTransmit`
^^^^^^^^^^^^^^^^^^^

.. code-block:: c
Expand Down Expand Up @@ -255,7 +255,7 @@ Then, it adds on the payload of ``Size`` bytes, which is pointed to by ``pBuffer
Then the host calls the platform-specific method to send those bytes over I2C, which is ``HAL_I2C_Master_Transmit`` in this case.

``_noteI2CReceive``
`_noteI2CReceive`
^^^^^^^^^^^^^^^^^^

.. code-block:: c
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ coverage`, and are in the build directory, you can view the coverage report as
HTML with:

```sh
cd test/coverage
cd build/test/coverage
genhtml lcov.info -o tmp
```

Expand Down

0 comments on commit 60e701b

Please sign in to comment.