Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(quality control): ✨ Add MISRA C-2012 compliance #138

Draft
wants to merge 41 commits into
base: Version-1.1.0-Development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ddcd69b
chore(library): Bump Semantic Version to `1.1.0-2024.9.3`
ZZ-Cat Sep 2, 2024
b5116d3
chore(`platformio.ini`): Set the `defect_detector` as the development…
ZZ-Cat Sep 3, 2024
5b99964
ci(quality control): :wastebasket: Comment out the `--disable=unusedF…
ZZ-Cat Sep 3, 2024
5840867
ci(quality control): :construction_worker: Add all `*.cpp` files in t…
ZZ-Cat Sep 3, 2024
d143844
ci(quality control): :construction_worker: Add all example files to C…
ZZ-Cat Sep 3, 2024
3020722
ci(quality control): :construction_worker: Explicitly state C++23 is …
ZZ-Cat Sep 3, 2024
031fd77
ci(quality control): :construction_worker: Add `misra-rules.txt` file
ZZ-Cat Sep 3, 2024
c166cf8
ci(quality control): :construction_worker: Add `misra.json` manifest
ZZ-Cat Sep 3, 2024
7b4462e
ci(quality control): :construction_worker: Add `suppressions.txt` file
ZZ-Cat Sep 3, 2024
c961eba
ci(quality control): :construction_worker: Add the `suppressions.txt`…
ZZ-Cat Sep 3, 2024
c8f2568
ci(quality control): :construction_worker: Add the `misra.json` manif…
ZZ-Cat Sep 3, 2024
11bb963
ci(quality control): :construction_worker: Enable all Cppcheck flags …
ZZ-Cat Sep 3, 2024
cd82903
ci(quality control): :construction_worker: Suppress `missingInclude` …
ZZ-Cat Sep 3, 2024
3bff723
ci(quality control): :construction_worker: Suppress `unmatchedSuppres…
ZZ-Cat Sep 3, 2024
c0a5a38
ci(quality control): :construction_worker: Suppress `unusedFunction` …
ZZ-Cat Sep 3, 2024
5e734ee
ci(quality control): :construction_worker: Activate MISRA C:2012 chec…
ZZ-Cat Sep 3, 2024
f973b34
docs(compliance matrix): :memo: Initial commit for MISRA C 2012 Compl…
ZZ-Cat Sep 4, 2024
19d3337
docs(compliance matrix): :memo: Populate Compliance Matrix with curre…
ZZ-Cat Sep 4, 2024
c0391e1
ci(misra rules): :safety_vest: Add rules for switch statements
ZZ-Cat Sep 8, 2024
4da9c71
ci(misra rules): :safety_vest: Add rules for functions
ZZ-Cat Sep 8, 2024
31d8992
ci(misra rules): :safety_vest: Add rules for pointers and arrays
ZZ-Cat Sep 8, 2024
f2cdc2d
ci(misra rules): :safety_vest: Add rules for overlapping storage
ZZ-Cat Sep 8, 2024
7868282
build(`platformio.ini`): :wrench: Add the entire `src` directory to `…
ZZ-Cat Sep 8, 2024
fbd8f97
ci(misra rules): :safety_vest: Add rules for preprocessing directives
ZZ-Cat Sep 8, 2024
68c880a
ci(misra rules): :safety_vest: Add rules for standard libraries
ZZ-Cat Sep 8, 2024
14c03d4
ci(misra rules): :safety_vest: Add rules for resources
ZZ-Cat Sep 8, 2024
cb383f9
docs(misra c compliance matrix): :memo: Add missing rules
ZZ-Cat Sep 9, 2024
62b55ff
docs(misra c compliance matrix): :memo: Add `Rule flag` column
ZZ-Cat Sep 9, 2024
97d0d2a
docs(misra c compliance matrix): :memo: Add a legend to the complianc…
ZZ-Cat Sep 9, 2024
1b321ab
docs(misra c compliance matrix): :memo: Flesh out the compliance matr…
ZZ-Cat Sep 9, 2024
08cd5e7
docs(misra c compliance matrix): :memo: Add rule 1.1 with appropriate…
ZZ-Cat Sep 9, 2024
a7350a2
docs(misra c compliance matrix): :memo: Add information on how each g…
ZZ-Cat Sep 9, 2024
a45433a
docs(misra c compliance matrix): :memo: Fix typo in checkmark emoticon
ZZ-Cat Sep 9, 2024
3815949
docs(misra c compliance matrix): :memo: Add Rule 1.2 and place a chec…
ZZ-Cat Sep 9, 2024
a80f9cb
docs(misra c compliance matrix): :memo: Populate compliance matrix wi…
ZZ-Cat Sep 9, 2024
8f4b1d2
docs(misra c compliance matrix): :memo: Add Manual review checks to c…
ZZ-Cat Sep 9, 2024
fbfac95
docs(misra c compliance matrix): :memo: Sort Rules and Directives int…
ZZ-Cat Sep 10, 2024
97ff4d3
docs(misra c compliance matrix): :memo: Highlight rules with unknown …
ZZ-Cat Sep 10, 2024
e668877
docs(misra c compliance matrix): :memo: Re-word the **Advisory**, **R…
ZZ-Cat Sep 10, 2024
657947b
docs(misra c compliance matrix): :bug: Fix broken link
ZZ-Cat Sep 10, 2024
d6ae3ff
docs(misra c compliance matrix): :memo: Add MISRA C directives
ZZ-Cat Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 198 additions & 0 deletions docs/misra_c_compliance_matrix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# MISRA C Compliance and Deviations

This document outlines the MISRA C compliance of CRSF for Arduino and documents any deviations from the MISRA C guidelines.
The [compliance](#compliance) section lists all of the MISRA C guidelines that CRSF for Arduino is compliant with.
The [deviations](#deviations) section lists any deviations from the MISRA C guidelines.

## Compliance Matrix

The following tables represent the compliance level of CRSF for Arduino with the MISRA C guidelines, and the tools used to verify compliance.
The compliance level is determined by the following flags:

- **Advisory**: CRSF for Arduino should follow this guideline wherever reasonable and practical, unless the relevant deviation is documented.
- **Required**: CRSF for Arduino should follow this guideline without any deviations unless that deviation is already documented.
- **Mandatory**: CRSF for Arduino must follow this guideline. Deviations are not permitted.

The icons listed here are used in the [directives](#directives) and [rules](#rules) tables to represent the compliance level.
An icon is placed in a cell that corresponds to the guideline and the method used to verify compliance. Each icon represents a different compliance level.
The icons are as follows:

- :white_check_mark: - CRSF for Arduino is compliant with the guideline.
- :negative_squared_cross_mark: - CRSF for Arduino violates the guideline. A deviation from the guideline is being reviewed and may be documented.
- :o: - A deviation from the guideline is documented. See [deviations](#deviations) for more information.
- :no_entry_sign: - CRSF for Arduino violates the guideline and is yet to be fixed.
- :x: - This method is not used.
- :warning: - Rule status is unknown and requires manual review.

### Directives

| MISRA Directive | Rule flag | Manual review |
| --- | --- | --- |
| Directive 1.1 | Required | :warning: |
| Directive 2.1 | Required | :no_entry_sign: |
| Directive 3.1 | Required | :warning: |
| Directive 4.1 | Required | :white_check_mark: |
| Directive 4.2 | Advisory | :white_check_mark: |
| Directive 4.3 | Required | :white_check_mark: |
| Directive 4.4 | Advisory | :warning: |
| Directive 4.5 | Advisory | :white_check_mark: |
| Directive 4.6 | Advisory | :white_check_mark: |
| Directive 4.7 | Required | :white_check_mark: |
| Directive 4.8 | Advisory | :warning: |
| Directive 4.9 | Advisory | :white_check_mark: |
| Directive 4.10 | Required | :white_check_mark: |
| Directive 4.11 | Required | :no_entry_sign: |
| Directive 4.12 | Required | :no_entry_sign: |
| Directive 4.13 | Advisory | :warning: |

### Rules

| MISRA Rule | Rule flag | GCC Arm None EABI | Cppcheck | Manual review |
| --- | --- | --- | --- | --- |
| Rule 1.1 | Required | :x: | :x: | :warning: |
| Rule 1.2 | Required | :x: | :x: | :warning: |
| Rule 1.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 2.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 2.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 2.3 | Advisory | :x: | :no_entry_sign: | :x: |
| Rule 2.4 | Advisory | :x: | :no_entry_sign: | :x: |
| Rule 2.5 | Advisory | :x: | :no_entry_sign: | :x: |
| Rule 2.6 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 2.7 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 3.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 3.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 4.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 4.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.4 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.5 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 5.8 | Required | :x: | :no_entry_sign: | :x: |
| Rule 5.9 | Required | :x: | :white_check_mark: | :x: |
| Rule 6.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 6.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 7.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 7.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 7.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 7.4 | Required | :x: | :white_check_mark: | :x: |
| Rule 8.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 8.2 | Required | :x: | :no_entry_sign: | :x: |
| Rule 8.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 8.4 | Required | :x: | :no_entry_sign: | :x: |
| Rule 8.5 | Required | :x: | :white_check_mark: | :x: |
| Rule 8.6 | Required | :x: | :no_entry_sign: | :x: |
| Rule 8.7 | Advisory | :x: | :no_entry_sign: | :x: |
| Rule 8.8 | Required | :x: | :white_check_mark: | :x: |
| Rule 8.9 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 8.10 | Required | :x: | :white_check_mark: | :x: |
| Rule 8.11 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 8.12 | Required | :x: | :white_check_mark: | :x: |
| Rule 8.13 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 8.14 | Required | :x: | :white_check_mark: | :x: |
| Rule 9.1 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 9.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 9.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 9.4 | Required | :x: | :white_check_mark: | :x: |
| Rule 9.5 | Required | :x: | :white_check_mark: | :x: |
| Rule 10.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 10.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 10.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 10.4 | Required | :x: | :no_entry_sign: | :x: |
| Rule 10.5 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 10.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 10.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 10.8 | Required | :x: | :white_check_mark: | :x: |
| Rule 11.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 11.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 11.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 11.4 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 11.5 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 11.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 11.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 11.8 | Required | :x: | :white_check_mark: | :x: |
| Rule 11.9 | Required | :x: | :white_check_mark: | :x: |
| Rule 12.1 | Advisory | :x: | :no_entry_sign: | :x: |
| Rule 12.2 | Required |:x: | :white_check_mark: | :x: |
| Rule 12.3 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 12.4 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 13.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 13.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 13.3 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 13.4 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 13.5 | Required | :x: | :white_check_mark: | :x: |
| Rule 13.6 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 14.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 14.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 14.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 14.4 | Required | :x: | :white_check_mark: | :x: |
| Rule 15.1 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 15.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 15.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 15.4 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 15.5 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 15.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 15.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 16.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 16.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 16.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 16.4 | Required | :x: | :white_check_mark: | :x: |
| Rule 16.5 | Required | :x: | :white_check_mark: | :x: |
| Rule 16.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 16.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 17.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 17.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 17.3 | Mandatory | :x: | :x: | :warning: |
| Rule 17.4 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 17.5 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 17.6 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 17.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 17.8 | Advisory | :x: | :no_entry_sign: | :x: |
| Rule 18.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 18.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 18.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 18.4 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 18.5 | Required | :x: | :white_check_mark: | :x: |
| Rule 18.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 18.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 18.8 | Required | :x: | :white_check_mark: | :x: |
| Rule 19.1 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 19.2 | Advisory | :x: | :no_entry_sign: | :x: |
| Rule 20.1 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 20.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.4 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.5 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 20.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.8 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.9 | Required | :x: | :no_entry_sign: | :x: |
| Rule 20.10 | Advisory | :x: | :white_check_mark: | :x: |
| Rule 20.11 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.12 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.13 | Required | :x: | :white_check_mark: | :x: |
| Rule 20.14 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.2 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.4 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.5 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.6 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.7 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.8 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.9 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.10 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.11 | Required | :x: | :white_check_mark: | :x: |
| Rule 21.12 | Required | :x: | :white_check_mark: | :x: |
| Rule 22.1 | Required | :x: | :white_check_mark: | :x: |
| Rule 22.2 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 22.3 | Required | :x: | :white_check_mark: | :x: |
| Rule 22.4 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 22.5 | Mandatory | :x: | :white_check_mark: | :x: |
| Rule 22.6 | Mandatory | :x: | :white_check_mark: | :x: |

## Deviations

No deviations are documented at this time.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json",
"name": "CRSFforArduino",
"version": "1.1.0-1.0.0",
"version": "1.1.0-2024.9.3",
"description": "An Arduino Library for communicating with ExpressLRS and TBS Crossfire receivers.",
"keywords": "arduino, remote-control, arduino-library, protocols, rc, radio-control, crsf, expresslrs",
"repository":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=CRSFforArduino
version=1.1.0-1.0.0
version=1.1.0-2024.9.3
author=Cassandra Robinson <[email protected]>
maintainer=Cassandra Robinson <[email protected]>
sentence=CRSF for Arduino brings the Crossfire Protocol to the Arduino ecosystem.
Expand Down
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
[platformio]
core_dir = .pio/core
default_envs =
; defect_detector
development
defect_detector
; development
; ${build.all}
extra_configs =
targets/common.ini
Expand Down
10 changes: 5 additions & 5 deletions src/CFA_Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ See https://semver.org/ for more information. */
// These are the pre-release version details which are only used if CRSFFORARDUINO_VERSION_IS_PRERELEASE is set to 1.
// NOTE: Pre-release versions are not recommended for production use.
#if CRSFFORARDUINO_VERSION_IS_PRERELEASE == 1
#define CRSFFORARDUINO_VERSION_PRE "1.0.0"
#define CRSFFORARDUINO_VERSION_BUILD_DATE "2024-7-21"
#define CRSFFORARDUINO_VERSION_BUILD_MAJOR 1
#define CRSFFORARDUINO_VERSION_BUILD_MINOR 0
#define CRSFFORARDUINO_VERSION_BUILD_PATCH 0
#define CRSFFORARDUINO_VERSION_PRE "2024.9.3"
#define CRSFFORARDUINO_VERSION_BUILD_DATE "2024-9-3"
#define CRSFFORARDUINO_VERSION_BUILD_MAJOR 2024
#define CRSFFORARDUINO_VERSION_BUILD_MINOR 9
#define CRSFFORARDUINO_VERSION_BUILD_PATCH 3
#endif

/* Failsafe Options
Expand Down
Loading
Loading