ToyKeeper / anduril

Anduril 2 Flashlight Firmware and FSM UI Toolkit
GNU General Public License v3.0
213 stars 52 forks source link

Per-user config implementation #9

Open ntoivola opened 10 months ago

ntoivola commented 10 months ago

Here's a proposed implementation for the per-user customization functionality mentioned in the README. That's a brilliant idea.

I think my approach is better than just adding the custom user directory at the beginning of INCLUDES as suggested by a comment in build.sh, as this allows one to override individual settings without having to replicate the entire config-defaults.h and/or anduril.h.

I don't know if this is at all what you had in mind but let me know what you think!

Fescron commented 9 months ago

This seems to be well documented and working fine. I can now create a .hex-file for my TS10 with all my preferred settings without having to actually configure them after flashing (new) firmware, thank you!

Fescron commented 9 months ago

On 2023/11/29 22:14 CET SammysHP wrote: This makes the assumption that the personal configuration applies to all targets in the same way. Well, for me that's definitely not the case. There are many (subtle) differences between my lights, for example floor/ceiling, the number of steps to get exactly MAX_7135, configuration of channels etc.

I keep common options in a file that I can include in my customized target configurations.

I don't think this is (completely) correct? From his documentation I read the following:

To customize the configuration for a specific model, create a users/<username>/<manufacturer>/<model>/config.h file (same directory structure as that under hw, just replace hw with users/<username>).

And as far as I can tell it works as expected. When doing this in my case with users/brecht/wurkkos/ts10/rgbaux/config.h and running ./make wurkkos ts10 rgbaux I get only one .hex file (for the TS10) with my correct configuration-settings. I have not tested merging config.h files though.

ntoivola commented 9 months ago

Hey, thanks for the comments. Indeed, the global user customizations are included first followed by the model-specific ones, so you can have a combination of customized defaults common to all lights and model-specific settings. I'm sure there are some scenarios that this approach cannot handle, but so far this is working well for me.

SammysHP commented 9 months ago

Yeah, I've seen that just a second later. That's why I had removed my comment immediately.