diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 00000000..35f8c820 --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,37 @@ +# Copyright 2026 Khalil Estell and the libhal contributors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 🔤 Spellcheck + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + spellcheck: + name: 🔤 Spellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..cd561221 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +# Copyright 2026 Khalil Estell and the libhal contributors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +repos: + # Spell checking, with the technical words in cspell.json + - repo: https://github.com/streetsidesoftware/cspell-cli + rev: v8.6.0 + hooks: + - id: cspell + files: \.(md|rst)$ diff --git a/README.md b/README.md index 3b64357e..2f739023 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ our static documentation and [sphinx](https://www.sphinx-doc.org/en/master/) for our API documentation If you'd like to contribute to the libhal website and documentation you can do -so by quickly setting up the enviornement by running the following commands. +so by quickly setting up the environment by running the following commands. Please note that the build script is designed for a bash environment and is intended to be used on unix-based operating systems. The documentation is fully compatible with Windows, however you will need to write your own `.bat` install diff --git a/cspell.json b/cspell.json index 208dbd81..a4bcf18c 100644 --- a/cspell.json +++ b/cspell.json @@ -31,13 +31,147 @@ "fprintf", "fputs", "offsetof", - "uart" + "uart", + "baremetal", + "bkpt", + "bootloaders", + "bringup", + "choco", + "cinttypes", + "clangd", + "climits", + "cmdline", + "CMSIS", + "conanbuild", + "conanfile", + "conset", + "consteval", + "constprop", + "countr", + "cout", + "Cpplang", + "cstdint", + "cstdio", + "cstring", + "dacs", + "datasheet", + "datasheets", + "deadsnakes", + "demangle", + "devirtualizes", + "dialout", + "Doxyfile", + "doxygenclass", + "doxygenfile", + "doxygengroup", + "doxygennamespace", + "dynamixel", + "eabi", + "EEPROM", + "endianness", + "ensurepath", + "errc", + "Espressif", + "Estell", + "exelinkflags", + "fexceptions", + "footgun", + "gamepad", + "gdbserver", + "gpdma", + "gpio", + "GPIOs", + "InvenSense", + "iostream", + "ISER", + "JEDEC", + "JTAG", + "kammce", + "Kbit", + "Khalil", + "libc", + "libexcept", + "libunwind", + "LQFP", + "LSDA", + "Mbit", + "Memfault", + "microcontroller", + "microcontrollers", + "micromod", + "minimp", + "misaligns", + "MISRA", + "mkdocs", + "multiarch", + "newlib", + "NMEA", + "noinline", + "NOLINT", + "noreturn", + "nullopt", + "NVIC", + "nxpprog", + "OEM", + "OLED", + "ostream", + "PCLKDIV", + "Pico", + "picolibc", + "picosdk", + "pimpl", + "pinout", + "pipx", + "POSIX", + "prescale", + "PRIMASK", + "pyocd", + "RDWR", + "readelf", + "regs", + "riscv", + "Robotis", + "rodata", + "Rohde", + "Schwarz", + "semihost", + "semihosting", + "SIGTRAP", + "SIMD", + "softwareupdate", + "Sparkfun", + "sstream", + "Stargirl", + "struct", + "structs", + "SWCLK", + "SWDIO", + "syscalls", + "toctree", + "UDLs", + "UFCS", + "unrepresentable", + "upscaling", + "uptr", + "usart", + "usbserial", + "usermod", + "usize", + "veltor", + "vtable", + "winget", + "Xtensa" ], "ignorePaths": [ "build/", "*.json" ], "enableFiletypes": [ - "markdown" + "markdown", + "restructuredtext" + ], + "ignoreRegExpList": [ + "\\.conan2/\\S*", + "(?:^|[\\s`])-[DOT][a-z_]+" ] } diff --git a/mkdocs/contributor_guide/architecture.md b/mkdocs/contributor_guide/architecture.md index d6089af4..c1d3d190 100644 --- a/mkdocs/contributor_guide/architecture.md +++ b/mkdocs/contributor_guide/architecture.md @@ -12,7 +12,7 @@ libhal will increment its major number to indicate that it has upgraded compiler versions. This decision exists to escape the issues of vendor and toolchain lock in thats -prevalant in the C++ and embedded industry. With sufficient testing, upgrading +prevalent in the C++ and embedded industry. With sufficient testing, upgrading compilers shouldn't result in bugs in applications. ## A.2 Interface Design Choices @@ -198,7 +198,7 @@ input parameters to allow libraries to customize and control how the CI works. libhal's CI attempts to use as many tools as reasonable to make sure that the C++ source code follows the style guide, C++ core guidelines and retains a -certain level of quality. All offical libhal libaries must opt in to the common +certain level of quality. All official libhal libraries must opt in to the common libhal/libhal workflow. This helps to ensure that all projects are held to the same standard and @@ -392,7 +392,7 @@ The options for these callbacks are: `std::function` for any interface API would ensure that applications that disallow dynamic allocations after boot or in general could never use them. -`function_ref` has two great PROS but the largets CON is lifetime issues that +`function_ref` has two great PROS but the largest CON is lifetime issues that are really easy to fall into. Specifically something like this: ```C++ @@ -417,7 +417,7 @@ pointers (`sizeof(std::intptr_t) * 2`). This size was chosen in order to be small and easily storable. Two pointers worth of size should be enough to hold a pointer to `this` in classes as well a pointer to some sort of state object. -The size of the callback object was not choosen in order to improve the +The size of the callback object was not chosen in order to improve the performance of calling callback setting class functions. Even with the small size of `hal::callback`, its too large to take advantage of register based parameter passing. Thus the size of 2 pointers was mostly to help in keeping @@ -449,7 +449,7 @@ compile time checks as well. This amends architectural component A.4 and pivots away from header only libraries over to prebuilt binaries. -The following are the reasons why supporting, producing and distibuting prebuilt +The following are the reasons why supporting, producing and distributing prebuilt binaries is critical to libhal. - ⏱️ **Faster compilation times**: When a project grows in size, compiling @@ -488,7 +488,7 @@ features of the platform, libhal emphasizes prebuilt libraries over header only. required adding additional architecture settings, required the use of conan profiles to make the arm-gnu-toolchain available globally for all packages, figuring out how to insert architectural compiler flags and ensure - they propogate to all packages took time and was a complex process. And + they propagate to all packages took time and was a complex process. And header-only libraries allowed the initial version of libhal to bypass all of this. @@ -523,7 +523,7 @@ remove that, your unwind time is deterministic. The issue with massive code bloat when you enable `-fexceptions` only comes from the linux version of `std::terminate` which uses `` and some -other locale related stuff. Simply overriding this with your own implmentation +other locale related stuff. Simply overriding this with your own implementation fixes this issue and reduces code size by ~100kB. A link to a paper written by Khalil Estell will be linked here to describe in diff --git a/mkdocs/contributor_guide/arm/arm_cortex_m_bringup.md b/mkdocs/contributor_guide/arm/arm_cortex_m_bringup.md index cbd537a5..15c2978b 100644 --- a/mkdocs/contributor_guide/arm/arm_cortex_m_bringup.md +++ b/mkdocs/contributor_guide/arm/arm_cortex_m_bringup.md @@ -207,7 +207,7 @@ application. The finer details about linker scripts and how they work can be found in the resources below: -- [Mastering the GNU linker script by AllThingsEmbeddd](https://allthingsembedded.com/post/2020-04-11-mastering-the-gnu-linker-script/): Easy to learn 13 min read +- [Mastering the GNU linker script by AllThingsEmbedded](https://allthingsembedded.com/post/2020-04-11-mastering-the-gnu-linker-script/): Easy to learn 13 min read - ["The most thoroughly commented linker script (probably)" by Thea "Stargirl" Flowers](https://blog.thea.codes/the-most-thoroughly-commented-linker-script/): A very thoroughly documented and easy read on linker scripts - [GNU Linker Scripts](https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html): Full user specification, if you need or want those details diff --git a/mkdocs/education/adc.md b/mkdocs/education/adc.md index 5cadc068..16d57088 100644 --- a/mkdocs/education/adc.md +++ b/mkdocs/education/adc.md @@ -733,7 +733,7 @@ void application() } ``` -All tests executed on an stm32f103c8 which featues a Cortex-M3 processor which +All tests executed on an stm32f103c8 which features a Cortex-M3 processor which does not include a floating point unit. Using GCC 12.3.1. Built using the following commands: diff --git a/mkdocs/getting_started.md b/mkdocs/getting_started.md index 5fedabef..faf90ea4 100644 --- a/mkdocs/getting_started.md +++ b/mkdocs/getting_started.md @@ -105,7 +105,7 @@ pipx install "conan>=2.18.0" ## 🔧 Setting up Conan -First install the libhal's conan configuration which is done via the commnd below. +First install the libhal's conan configuration which is done via the command below. ```bash conan config install https://github.com/libhal/conan-config2.git diff --git a/mkdocs/user_guide/debugging.md b/mkdocs/user_guide/debugging.md index f8bec7c1..a3ec5662 100644 --- a/mkdocs/user_guide/debugging.md +++ b/mkdocs/user_guide/debugging.md @@ -23,13 +23,13 @@ pipx install pyocd - For SWD (most common): - Connect GND (Ground) - Connect SWDIO (Data line) - - Connect SWDCLK (Clock line) + - Connect SWCLK (Clock line) - If your board uses JTAG: - Connect GND, TDI, TMS, TCK, and TDO pins - If you have a JTAG device that supports SWD - Connect GND - Connect JTAG TMS to MCU SWDIO - - Connect JTAG TCK to MCU SWDCLCK + - Connect JTAG TCK to MCU SWCLK !!! important Double-check all connections! Incorrect wiring can damage your board,