Skip to content

Commit 2e573a9

Browse files
committed
Misc improvements.
1 parent 9a43e9a commit 2e573a9

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

doc/decisions/dr-004.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Context
44

55
Currently we violate the requirement to use libraries and frameworks only through adapters, as it is required by the objectives of the software architecture (see
6-
[relevant section in Software Architecture](<\ref flexible_structure> "relevant section in Software Architecture"):
6+
[relevant section in Software Architecture](<\ref flexible_structure> "relevant section in Software Architecture")):
77
We currently use an implementation of the [ArduinoCore-API][ACA] (ACA) as a hardware abstraction layer (HAL) from outside of the adapters layer.
88
More specifically we use an implementation of the ACA from Espressif coined for ESP32s.
99

@@ -26,7 +26,7 @@ Those adapters would reside in the
2626

2727
#### Option 1a)
2828

29-
For an object oriented (OO) variant, defining an interface and inheriting from it, it would require to:
29+
For an object oriented (OO) variant, defining an interface and inheriting from it would require to:
3030

3131
- define one or several interfaces inside the
3232
[board adapters package](<\ref board_adapters> "board adapters package")
@@ -70,7 +70,7 @@ Factories are not necessary because this approach does not rely on objects.
7070
#### Option 1c)
7171

7272
A hybrid approach (OO and free functions) is also possible.
73-
This would fit well to the [ACA][] as is also consists of classes and free functions.
73+
This would fit well to the ACA as is also consists of classes and free functions.
7474

7575
The steps required would be a mixture of those of options 1a) and 1b).
7676

@@ -81,10 +81,10 @@ Change the current guidelines such that the direct dependency to 3rd party HALs
8181

8282
This approach eliminates the requirement to define 3rd party adapters to the HAL.
8383

84-
In order to be able to test code depending on the [ACA][], the 3rd party interface needs to be stubbed.
85-
*For vanilla [ACA][], stubbing the proprietary interface can be greatly simplified by using [ArduinoFake][].*
86-
We use an [implementation of the Arduino Core API (ACA) specific for ESP32s by Espressif](https://github.com/espressif/arduino-esp32/) which extends the [ACA][].
87-
Following the approach of this option, to directly use [ACA][] and [ArduinoFake][] for testing, we would need to deal with the extensions separately.
84+
In order to be able to test code depending on the ACA, the 3rd party interface needs to be stubbed.
85+
*For vanilla ACA, stubbing the proprietary interface can be greatly simplified by using [ArduinoFake][].*
86+
We use an [implementation of the Arduino Core API (ACA) specific for ESP32s by Espressif](https://github.com/espressif/arduino-esp32/) which extends the ACA.
87+
Following the approach of this option, to directly use ACA and ArduinoFake for testing, we would need to deal with the extensions separately.
8888
The following variants of this option, specifies different methods to cope with the extensions.
8989

9090
[ArduinoFake]: https://platformio.org/lib/show/1689/ArduinoFake "ArduinoFake in PlaftormIO's registry"
@@ -93,14 +93,14 @@ The following variants of this option, specifies different methods to cope with
9393

9494
Instead of directly using a modified Arduino interface (for example for a specific `class`), we use an adapter.
9595
The adapters would be integrated just as for option 1.
96-
But compared to option 1 this only needs to be done for those smallest indivisible interfaces which are not compatible to the vanilla [ACA][].
96+
But compared to option 1 this only needs to be done for those smallest indivisible interfaces which are not compatible to the vanilla ACA.
9797

9898
#### Option 2b)
9999

100100
At those places in the source code where extensions are used, we introduce conditionally compiled sections.
101-
One section uses the modified version of the [ACA][], necessary for the productive code.
101+
One section uses the modified version of the ACA, necessary for the productive code.
102102
The alternative section is instead used when compiling for native tests.
103-
It uses the vanilla [ACA][] which can be simply stubbed using [ArduinoFake][].
103+
It uses the vanilla ACA which can be simply stubbed using ArduinoFake.
104104

105105
The selection of conditionally compiled sections is done using `constexpr if`, where possible.
106106
Else the C preprocessor (CPP) is used for conditional inclusion (`#if`, ...).
@@ -175,5 +175,5 @@ And more specifically for testing on native environments, use:
175175

176176
> **Option 2b):** Where the ACA is used it is allowed to add small conditionally compiled sections for tests in order to cope with deviations of the ACA used in productive code from the vanilla ACA.
177177
178-
The latter relaxation is in order to facilitate the use of [ArduinoFake][] to stub the HAL's interface.
178+
The latter relaxation is in order to facilitate the use of ArduinoFake to stub the HAL's interface.
179179

0 commit comments

Comments
 (0)