-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
fix: Prevent functional degradation if SD has less than 50MB free space (#3730) #3802
Conversation
There's an issue where the logsClose and loggingTimerStop calls at the end of logsWrite may be called every main loop iteration. You can see this in the trace output of the simulator in 2.9. They should be inside an if (g_oLogFile.obj.fs) {} block like it was before this PR. |
Both, or just Just to make things more spicier than usual, logging behaves a little differently on the simulator to the radio hardware... on the simulator, |
loggingTimerStop used to be inside logsClose so to keep original functionality both should be in the if block. |
Need to see why @mha1 moved that, as he separated it when adding the warning popup, and has a comment that implies the timer still running after log close triggers the UI warning message... |
you are referring to the else path of the log SF is active if statement, right?
This piece of code is only active if the logs SF is off and you'd have to distinguish radio firmware and Simu: But you are right for the current implementation, logsClose is called every cycle, but only in Simu. LogsClose will try to close a file that's already closed. No harm done because f_close() takes care of this. I agree it'll be better practice to check for g_oLogFile.obj.fs before trying to close the log file to stop unnecessary f_close() calls in Simu. But it should be done in logsClose itself:
The reasons to move timer stop out of logsClose() was to have a consistent timer to function activated relation. The timer (which calls logsWrite()) is running if logs are activated (SF on) and stopped (SF off) when deactivated. First it's clean and second it enables a use case where SD card got full while writing logs and you'd delete a large file with the logs still enabled. It'll start a new log as soon as there is enough space again. As long as SD full persists it'll issue the popup (only if it's not already up) but keeps trying as long as SF the is activated. No worries about CPU consumption. Retries take much less time than logging itself. |
Just tried this on 2.9. Makes Simu quiet again.
|
|
It was your PR, please take up your concerns with the author 🤭 If you can't, patch/diff files are also accepted, I'm good at faking the commit author attribution by now 😇 |
Asked author. Says don't ask, do it. Does that work ? logsClose.patch |
…ce (#3730) * justification: #3666 - checks SD card free space at startup, start of logging and writing screenshots - issues warning to user if SD card has less than 50MB free space - will not write logs or screenshots if free space is less than 50MB at activation timerReset - fixes crash of warning popup in logs.cpp (#3728) * update: warning message if SD card fills up to threshold while logging * empty commit * call popup in non-blocking mode * make b&w compatible to non-blocking popup calls * 2nd attempt * Popup: - turns on backlight if dimmed due to inactivity setting - if backlight is dimmed due to inactivity setting backlight can turnd on again by any controls * #3599 * fixed b&w UI * updated languages CN, CZ, DA, DE, FR, HE, IT, PL, PT, SE, TW * chore: Update translations
5713295
to
cdc65fe
Compare
cherry-pick of #3730