Before this patch, I have to use the repo below.
https://github.com/brokentoaster/freebsd-system76-charge-thresholds/
Details
Details
In order to set the charging thresholds
% sysctl hw.acpi.s76.battary_thresholds_high hw.acpi.s76.battary_thresholds_high: 95 % sysctl hw.acpi.s76.battary_thresholds_low hw.acpi.s76.battary_thresholds_low: 60 % sysctl hw.acpi.s76.battary_thresholds_low=10 hw.acpi.s76.battary_thresholds_low: 60 -> 10 % sysctl hw.acpi.s76.battary_thresholds_high=70 hw.acpi.s76.battary_thresholds_high: 95 -> 70 % sysctl hw.acpi.s76 hw.acpi.s76.battary_thresholds_high: 70 hw.acpi.s76.battary_thresholds_low: 10 hw.acpi.s76.keyboard_color: 16777215 hw.acpi.s76.keyboard_backlight: 48
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/dev/acpi_support/acpi_system76.c | ||
|---|---|---|
| 334 | If you removed default case than convert #defines to enum. It will enable case completeness checks in C compiler | |
| sys/dev/acpi_support/acpi_system76.c | ||
|---|---|---|
| 82 | S76_CTRL_MAX should not be in enum | |
| sys/dev/acpi_support/acpi_system76.c | ||
|---|---|---|
| 82 |
Can I ask you why? | |
Comment Actions
It will trigger enumeration value ‘S76_CTRL_MAX’ not specifically handled in switch if -Wswitch option is passed to compiler.
From [1]:
-Wswitch
Warn whenever a switch statement has an index of enumerated type and lacks a case for one or more of the named codes of that enumeration. (The presence of a default label prevents this warning.) case labels that do not correspond to enumerators also provoke warnings when this option is used, unless the enumeration is marked with the flag_enum attribute. This warning is enabled by -Wall.
Obviously case S76_CTRL_MAX is not generally handled in switch() statements.
It seems that both ACPI and netlink builds without -Wswitch so we see no negative effects now.