minor clarifications
This commit is contained in:
2
.github/copilot-instructions.md
vendored
2
.github/copilot-instructions.md
vendored
@@ -33,7 +33,7 @@ Always reference these instructions first and fallback to search or bash command
|
||||
|
||||
| Command | Purpose | Typical Time |
|
||||
|---|---|---|
|
||||
| `npm run build` | Build web UI → generates `wled00/html_*.h` headers | ~3 s |
|
||||
| `npm run build` | Build web UI → generates `wled00/html_*.h` and `wled00/js_*.h` headers | ~3 s |
|
||||
| `npm test` | Run test suite | ~40 s |
|
||||
| `npm run dev` | Watch mode — auto-rebuilds web UI on file changes | — |
|
||||
| `pio run -e <env>` | Build firmware for a hardware target | 15–20 min |
|
||||
|
||||
11
.github/cpp.instructions.md
vendored
11
.github/cpp.instructions.md
vendored
@@ -147,12 +147,13 @@ This pattern enables optimizations and makes intent clear to reviewers.
|
||||
|
||||
### `const` locals
|
||||
|
||||
Adding `const` to a local variable that is only assigned once is not necessary — but it **is** required when the variable is passed to a function that takes a `const` parameter (pointer or reference). In hot-path code, `const` on cached locals helps the compiler keep values in registers:
|
||||
* Adding `const` to a local variable that is only assigned once is optional, but *not* strictly necessary.
|
||||
* In hot-path code, `const` on cached locals may help the compiler keep values in registers:
|
||||
```cpp
|
||||
const uint_fast16_t cols = vWidth();
|
||||
const uint_fast16_t rows = vHeight();
|
||||
```
|
||||
|
||||
```cpp
|
||||
const uint_fast16_t cols = virtualWidth();
|
||||
const uint_fast16_t rows = virtualHeight();
|
||||
```
|
||||
<!-- HUMAN_ONLY_END -->
|
||||
### `const` references to avoid copies
|
||||
|
||||
|
||||
Reference in New Issue
Block a user