Skip to content

Commit 64570ac

Browse files
authored
Create functions above setup/loop
setSketchStats and getSketchStats were not prototyped, so their definitions should go above setup/loop
1 parent 802b538 commit 64570ac

File tree

1 file changed

+1
-1
lines changed
  • content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store

1 file changed

+1
-1
lines changed

content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Now that you have everything ready, let's retrieve the previous values from the
242242
}
243243
```
244244

245-
To finish the sketch, create `getSketchStats` and `setSketchStats` functions at the bottom of the sketch (after the `setup()` and `loop()`).
245+
To finish the sketch, create `getSketchStats` and `setSketchStats` functions above `setup()` and `loop()`.
246246

247247
The `getSketchStats` function tries to retrieve the stats values stored in the Flash using the key `key` and returns them via the `stats` pointer parameter. Our `SketchStats` data struct is very simple and has a fixed size. You can therefore deserialize the buffer with a simple `memcpy`.
248248

0 commit comments

Comments
 (0)