Commit Graph

966 Commits

Author SHA1 Message Date
22fa2769ad gaze17-3050: Update configs
- Add to CI
- Correct smart charger values
- Enable WLAN power
- Enable USB power
- Disable mute

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-07-26 09:27:44 -06:00
7ab91e9f1d oryp9: Sync fans
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-07-20 14:20:31 -06:00
5ef477ab5b ci: Add darp8 and lemp11
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-07-12 15:31:35 -06:00
e8d91e5c2d oryp9: Add Oryx Pro 9
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-07-12 15:31:35 -06:00
60dfb62f90 lemp11: Add Lemur Pro 11
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-28 13:22:30 -06:00
7b9b91187a darp8: Add Darter Pro 8
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-22 09:17:21 -06:00
158ec124fe Add Pause key
In proprietary firmware and QMK, the Break key by itself is always just
Pause. They produce the same scan code, but Ctrl must be held for the OS
to recognize it as Break.

Behavior tested with xev.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-05-23 13:08:31 -06:00
375d11f4ed Add gaze17 2022-05-16 11:16:33 -07:00
a70ea4558c Fix battery TRACE macro 2022-04-27 07:13:48 -06:00
5780bb5e83 Update Rust toolchain to 2022-03-18
Match the toolchain used by Redox.

Update dependencies and submodules to fix building.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-04-04 18:59:20 -06:00
700f9e3756 ci: Add clang-format check
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-22 12:52:47 -06:00
b70a09e205 Disable clang-format for sensitive blocks
Things like macro blocks should not be auto-formatted.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-22 12:52:47 -06:00
04df6ae311 Add .clang-format
Most options are configured to keep most of the current style.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-22 12:52:47 -06:00
f21cc6d602 battery: Group battery info in a struct
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-18 12:47:59 -06:00
ee8ba5b72e fan: Replace 'static const' with defines
SDCC is not able to optimize statics [1]. Replace their use with defines
so significantly better code is generated.

[1]: https://sourceforge.net/p/sdcc/feature-requests/414/

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-18 12:47:20 -06:00
84f9aad7d8 Add force console mode to arduino firmware 2022-02-14 18:55:14 -07:00
cb341cfb2b Add power_init function 2022-02-14 18:55:14 -07:00
474b1c2191 Remove unused power states, rename power on/off functions 2022-02-14 18:55:14 -07:00
2262097c2b Add missing newline 2022-02-14 18:55:14 -07:00
4bab1cc00d Ensure that system powers off S5 plane if it fails to power on S5 plane 2022-02-14 18:55:14 -07:00
c31ef33101 Remove DEEP_SX, no boards use it 2022-02-14 18:55:14 -07:00
1cb61e6918 deps.sh: Update rustup or inform user of env vars
Ensure rustup is up-to-date to avoid users having a version that is too
old to support the TOML format.

If rustup was just installed, tell the user to source the new env vars
to use the correct version of the toolchain.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-01-18 08:09:56 -07:00
ca58502137 readme: Add datasheet info
The IT81202E, despite using a different core, contains sufficiently
equivalent documentation to IT8587E and IT5570E for most tasks except
interrupt management. Provide it as a reference since we cannot share
the datasheets for the models we use.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-01-07 18:36:10 -07:00
7d75235081 Fix ectool path in power.sh 2021-12-02 10:35:56 -07:00
ab0c55fae2 ectool 0.3.8 2021-11-19 13:32:00 -08:00
85595a8d4c tool: Add a system76_ec command to disable input events
For testing Launch keyboards.

Could easily support in EC firmware as well if we had a use for that,
but not adding that for now.
2021-11-18 13:08:05 -08:00
d9ce247a15 ectool: update lock file 2021-11-17 18:27:11 -07:00
e8ce6d9096 Add libhidapi-dev to deps 2021-11-17 18:26:26 -07:00
95632b4503 ectool: use linux-shared-hidraw feature for hidapi 2021-11-17 18:26:26 -07:00
55a617f2e0 gaze16-3060-b: Symlink new variant to gaze16-3060 2021-11-01 11:01:34 -06:00
987a5b4b70 Update submodules
Submodules have been updated to work with newer toolchains and fix build
warnings.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-10-26 11:35:48 -06:00
43e5cf4ba3 Fix or silence clippy warnings on nightly
Fix:
- dead_code
- clippy::if_then_panic
- clippy::manual_memcpy
- clippy::needless_borrow

Silence:
- clippy::missing_safety_doc
- clippy::needless_range_loop
- clippy::single_match

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-10-26 11:35:48 -06:00
975377af42 Update Rust toolchain to 2021-06-15
Update toolchain to match the version used in Redox.

Update dependencies to fix build.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-10-26 11:35:48 -06:00
9fa83ad359 gaze16-3050, gaze16-3060: set PCH_DPWROK_EC low on EC boot to ensure PCH is off 2021-09-30 12:29:24 -06:00
d3ee037879 Add gaze16 to CI 2021-09-20 10:58:11 -06:00
9046f1e527 Add oryp8 2021-09-20 10:50:53 -06:00
15c5f936b5 Read cycle count from battery and expose for ACPI 2021-09-15 07:49:50 -06:00
646a6436a7 Attempt to fix power_peci_limit issues
- Return false when power_peci_limit fails
- Allow power_peci_limit to be retried indefinitely from power_set_limit
2021-09-08 13:39:54 -06:00
f55e493001 Remove overflow check for unsigned diffs
Calculating diffs with *unsigned* integers will always produce the
correct result, as long as the diff is less than the type max.

For example, suppose we read 254 and 2 for an 8 bit value:

    2 - 254 = 4

Using this property, simplify diffs on time_get() comparisons.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-16 09:52:08 -06:00
e00686a661 docs: Only 5570 and 8587 are valid EC IDs
ecflash has no verification for the EC it detects. It will attempt to
read and erase whatever it finds, where it will hang. Document what it
*should* read and an example of what it *shouldn't* read.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-03 08:12:50 -06:00
73c6bd986d main: Use unsigned modulo
Explicitly affix the literal with `U` so SDCC will directly call
`moduint()` instead of `modsint()`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
d99ea41259 power: Use u8/u16 for loop index
Use u8/u16 instead of i16 as the value will never be negative and the
bounds are known at compile time.

Use a decrementing loop as SDCC generates more efficient code.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
37fa06ebc8 parallel: Use u16 for data length
The length will never be negative. Change it from i16 to u16 so
SDCC will generate more efficient code.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
5599c02e83 keymap: Use u8 for array access
The index will never be negative and will never exceed 255. Change them
from i16 to u8 so SDCC will generate more efficient code.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
458cb000f3 kbscan: Use u8 for array access
The index will never be negative and will never exceed 255. Change them
from i16 to u8 so SDCC will generate more efficient code.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
571316a4ea kbled: Use u8 for array access
The index will never be negative and will never exceed 255. Change them
from i16 to u8 so SDCC will generate more efficient code.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
f27d6350f2 kbc: Use u16 for timeout
The timeout will never be negative.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
2a3830fb57 i2c: Use u16 for data length
The length will never be negative.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
784202383e fan: Use u8 for array access
The index will never be negative and will never exceed 255. Change them
from i16 to u8 so SDCC will generate more efficient code.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 14:37:08 -06:00
99af8a35f5 Use explicitly sized types from stdint
Replace bare int types with stdint types. This was done with:

    grep -rwl 'int' src/ | xargs sed -i 's/\<int\>/int16_t/g'
    grep -rwl 'unsigned long' src/ | xargs sed -i 's/\<unsigned long\>/uint32_t/g'
    grep -rwl 'unsigned char' src/ | xargs sed -i 's/\<unsigned char\>/uint8_t/g'

Then reverted for *main(), putchar(), and getchar().

The Arduino declarations for parallel_main() were also corrected to
match their definitions.

SDCC does *not* generate the same code in all instances, due to `int`
being treated different than `short int`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 07:46:44 -06:00