diff options
| author | Shane Synan | 2023-11-28 14:57:41 -0500 |
|---|---|---|
| committer | Shane Synan | 2023-11-28 14:57:41 -0500 |
| commit | 538e5029dc426bfd61eb3c6b9e2891b3cec355b7 (patch) | |
| tree | ef8550aa5ab82ae7053f66d7e7280f6accbf6f56 | |
| parent | added a Makefile, so either `make` or `./make` can be used for most tasks (diff) | |
| download | anduril-538e5029dc426bfd61eb3c6b9e2891b3cec355b7.tar.gz anduril-538e5029dc426bfd61eb3c6b9e2891b3cec355b7.tar.bz2 anduril-538e5029dc426bfd61eb3c6b9e2891b3cec355b7.zip | |
bikeflash: Cap default brightness to max, define
Cap fallback default bike flasher brightness to stay below
MAX_BIKING_LEVEL, fixing noFET/boost driver builds where MAX_1x7135 is
above MAX_BIKING_LEVEL.
Add the optional define DEFAULT_BIKING_LEVEL to set the default bike
flasher brightness. This is NOT checked against MAX_BIKING_LEVEL, for
simplicity.
Alternatively, strobe-modes.c could be updated to check if the value
exceeds MAX_BIKING_LEVEL at runtime. However, that might take up more
flash space.
Migrated from https://code.launchpad.net/~digitalcircuit/flashlight-firmware/anduril2_fix_nofet_bikeflash/+merge/408124
Diffstat (limited to '')
| -rw-r--r-- | ui/anduril/load-save-config.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/anduril/load-save-config.h b/ui/anduril/load-save-config.h index 514fcbb..eb6d798 100644 --- a/ui/anduril/load-save-config.h +++ b/ui/anduril/load-save-config.h @@ -118,7 +118,15 @@ Config cfg = { .strobe_delays = { 41, 67 }, #endif #ifdef USE_BIKE_FLASHER_MODE - .bike_flasher_brightness = MAX_1x7135, + #ifndef DEFAULT_BIKING_LEVEL + #if MAX_1x7135 > MAX_BIKING_LEVEL + // Make sure fallback default doesn't exceed maximum (e.g. noFET) + #define DEFAULT_BIKING_LEVEL MAX_BIKING_LEVEL + #else + #define DEFAULT_BIKING_LEVEL MAX_1x7135 + #endif + #endif + .bike_flasher_brightness = DEFAULT_BIKING_LEVEL, #endif #ifdef USE_BEACON_MODE // beacon timing |
