Skip to content

Commit 717856e

Browse files
authored
📝 Fix bullets for interfaces.md (#62)
1 parent d2f5949 commit 717856e

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

mkdocs/user_guide/interfaces.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ work with any microcontroller that provides an implementation of that interface.
9494
[`hal::timer`](https://libhal.github.io/4.1/api/libhal/timer.html)
9595

9696
Schedules future events. Used for:
97+
9798
- Delayed operations
9899
- Periodic tasks
99100
- Timeout management
@@ -103,6 +104,7 @@ work with any microcontroller that provides an implementation of that interface.
103104
[`hal::steady_clock`](https://libhal.github.io/4.1/api/libhal/steady_clock.html)
104105

105106
Provides consistent time measurements. Used for:
107+
106108
- Measuring durations
107109
- Timing operations
108110
- Creating delays
@@ -232,7 +234,7 @@ work with any microcontroller that provides an implementation of that interface.
232234
- Device orientation tracking
233235
- Angle measurement
234236

235-
### Coming Soon
237+
### Coming Soon
236238

237239
=== "Current Sensor"
238240
**API not available yet**
@@ -243,12 +245,12 @@ work with any microcontroller that provides an implementation of that interface.
243245
- Measuring system power consumption
244246
- Measure motor torque/force
245247

246-
=== "Voltage Sensor"
248+
=== "Voltage Sensor"
247249
**API not available yet**
248250

249251
Will measure voltage differences in circuits.
250252

251-
=== "GPS"
253+
=== "GPS"
252254
**API not available yet**
253255

254256
Will provide location, time, and velocity data from GPS signals.
@@ -257,14 +259,17 @@ work with any microcontroller that provides an implementation of that interface.
257259

258260
A quick note about virtual functions (which libhal uses extensively):
259261

260-
1. **They don't require heap memory**: Virtual functions work fine with stack-allocated objects.
261-
2. **Performance impact is minimal**: The overhead is usually just one pointer lookup.
262-
3. **Memory overhead is small**: Each class with virtual functions needs only one vtable (shared between all instances).
262+
1. **They don't require heap memory**: Virtual functions work fine with
263+
stack-allocated objects.
264+
2. **Performance impact is minimal**: The overhead is usually just one pointer
265+
lookup.
266+
3. **Memory overhead is small**: Each class with virtual functions needs only
267+
one vtable (shared between all instances).
263268

264269
Example of using virtual functions efficiently:
265270

266271
```cpp
267272
// This works fine - no heap allocation needed
268-
hal::stm32f103::input_pin my_pin('B', 2); // Stack allocated
269-
read_pin_state(my_pin); // Uses virtual functions, but still efficient
273+
hal::lpc4078::i2c i2c2(2); // Stack allocated
274+
initialize_display(i2c2); // Uses virtual functions, but still efficient
270275
```

0 commit comments

Comments
 (0)