On some systems, a battery's charging regulator may not charge a battery
even though it is not full. This might be the case because it was
configured to stop charging at a capacity threshold, or e.g. because
environmental conditions do not allow for charging the battery.
This commit adds this status (called 'idle') and adds support for
detecting the status on Linux.
* FreeBSD: catchup with the internal changes in code
* FreeBSD: use statvfs instead on statfs
Follow NetBSD here while here, catch up with code architecture changes
Previously, the fields in the wireless module were declared but not explicitly
initialized upon declaration. As nothing else would do so afterwards, this
could introduce random characters left over in the memory segment into
the fields. This was explicitly observed in the essid-field, but likely
a possibility for other fields as well. Hence, this commit adds explicit
initialization with zero bytes to all fields to ensure proper
termination of all fields.
Fixes#432
Fixes a stack-overflow when memory is, for example, "1020.17 TiB".
This fix limits the max number of memory decimals to 4.
The crash was probably introduced in 066e813331 .
* Add support for batteries outputting Time to empty on linux
The battery in the pinebook pro does not output the remaining charge
in Wh or mAh, so i3 cannot calculate the time remaining. However, it
does directly output the number of minutes remaining on in
POWER_SUPPLY_TIME_TO_EMPTY. This adds support for reading this field
and converting it to seconds_remaining.
* Add testcase for POWER_SUPPLY_TIME_TO_EMTY_NOW
This generates much friendlier names on all my systems, e.g.
"HDMI / DisplayPort 5" rather than
"Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] Digital Stereo (HDMI 5)"
New matrix for 5 jobs in total.
Updates our checks to bionic & xenial. Trusty could also be
included but it is a bit outdated at this point.
I use bionic to pull a more recent clang-format and use a dedicated job
just to check formatting. An alternative would be to conditionally run
the formatting script only on bionic.
I don't think that there is a better way to expand a `dist` x `compiler`
matrix (except using docker).
- unused variable ‘walk’ [-Wunused-variable]
- implicit declaration of built-in function ‘free’
[-Wimplicit-function-declaration]
- initialization discards ‘const’ qualifier from pointer target type
[-Wdiscarded-qualifiers]
- variable 'ram_used' is used uninitialized whenever 'if' condition is
false [-Wsometimes-uninitialized]. This is actually easily reproducible
by specifying `memory_used_method = "XXX"`.
- comparison of integers of different signs: 'int' and 'unsigned long'
[-Wsign-compare] (for `exponent`)