-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config on SD card - read/save, change meter resolution, add stats in lux_only mode #39
config on SD card - read/save, change meter resolution, add stats in lux_only mode #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks a lot for your effort! Looking good, except for a few minor things to fix
Or maybe it would be even better to wait for this getter for the app data path flipperdevices/flipperzero-firmware#2181 to be merged |
@oleksiikutuzov do you know if there's any reason why app on Flipper seem to prefer using built-in |
Weird, despite being on unleashed-030 and building against freshly downloaded SDK ( Example of file that once written by app crashes Flipper with stack overflow on first attempt to read it:
And working one for
|
convert `flipper_format_*_hex` to `flipper_format_*_int32`
- move `bh1750_set_mode` after config is loaded - replace hardcoded value with `app->config->measurement_resolution`
I guess it's just not to use external libraries which would make the app more complex and heavier. In this case I would also say the standard implementation would be enough as this is not a user-definable config |
single callback function that handles sensor mode and address setting this requires oleksiikutuzov/flipperzero-BH1750#1 to be merged
Makes sense :) I pushed some fixes. So if everything else looks OK, then we wait for oleksiikutuzov/flipperzero-BH1750#1 + flipperdevices/flipperzero-firmware#2181, and finally, I will be able to get them backported and finish this PR. |
I'll be back to my laptop in couple of days or by the end of the week, so I approved the fix now. It seems fine, so you can continue as the other one will be merged. |
I also got an answer from @DrZlo13 in Tg chat regarding your question to config files, will share the auto translated text here. He also meant that even 2 KB of stack is quite optimistic and can easily be increased to at least 4 KB 😁
|
@oleksiikutuzov merged :). |
Draft for now, I want to add I2C address change since it'll be around the same place as meter resolution setting.
Config on SD card
It lives in
/ext/lightmeter/config.txt
and as of now looks like this:I'll be checking that weird issue with
flipper_format_write_int32
vsflipper_format_write_hex
causing stack overflow. It may be something in my local setup - I'm using SDK for 0.76.0 and firmware hacked fromunlshd-026
which now I realized is old...Sensor resolution
For now, it does not provide ton of benefits as we're anyway polling meter in UI threads. Maybe it'll get useful in the future.
Stats in Lux meter mode