Konrad Dybcio
5bf2dcc137
lib: Use greentext to signify send_image progress
...
not to be confused with 4chan memes
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-21 23:05:03 +02:00
Konrad Dybcio
143159b868
main+lib: Locky lock, implement console writing
...
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-21 23:05:03 +02:00
Konrad Dybcio
90e7bfd69e
main: Add some context to early returns
...
Suggested-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
2024-05-06 23:44:14 +02:00
Dmitry Baryshkov
c9644fd423
main: get rid of unwrap()
...
Replace .unwrap() with the question-mark returns. The main function can
only choke on the std::io::Error, so it's simple to return this kind of
errors.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
dfe093c804
lib: drop unwrap() from send_msg()
...
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
e901247cd2
lib: use write! to send image percentage
...
Use write! instead of writeln! to remove extra linewraps.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
f49bcf417f
main: simplify buffer handling
...
Use temporary mutable slice to reference a part of the buffer that is
used for the data.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
b50f910fb5
lib: print_string_msg: drop length argument
...
There is no need to pass addtional buffer size, use slice length
instead.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
eedd28230b
lib: console_print: drop length argument
...
There is no need to pass addtional buffer size, use slice length
instead.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
fea5839501
lib: use write_all in send_msg()
...
Use write_all() instead of write() to send the whole buffer.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
7bd68c3239
lib: stop using bincode::serialize()
...
There is little point in using bincode::serialize(). Serialize the
header manually, reducing the footprint.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov
d661e0e8d2
lib: drop size attribute from send_msg
...
There is no need to pass size in addition to the slice. Use buf.len()
instead.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
2024-05-06 22:55:02 +02:00
Konrad Dybcio
72dd9fb2d4
ci: Add Windows/macOS
...
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:29 +02:00
Konrad Dybcio
e876b75c0e
ci: matrix
2024-05-01 23:01:29 +02:00
Konrad Dybcio
41860310b5
main.rs: Redefine todo! for raw mode TTY
...
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:04 +02:00
Konrad Dybcio
67fe7d0cd5
main.rs: Fix the "Goodbye"
...
Add a condition to let the key-watching loop stop
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:04 +02:00
Konrad Dybcio
d02d6b5ef1
main.rs: Print "sk8brd vVERNUM" at startup
...
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:04 +02:00
Konrad Dybcio
51339dd720
main.rs: Don't open code send_ack
...
it was made for this
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:04 +02:00
Konrad Dybcio
79972d496c
main.rs: stubby handle all calls
...
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:04 +02:00
Konrad Dybcio
d9740766b0
main.rs: Fix up msg parsing error messages
...
fix typo
use writeln! as we're in raw tty mode
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:04 +02:00
Konrad Dybcio
f28a6f61e7
lib: impl MsgVbusOn/Off
...
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-05-01 23:01:04 +02:00
Konrad Dybcio
2b2c45a110
Cargo.toml: fill in some tags
2024-04-27 01:23:11 +02:00
dependabot[bot]
5f88aecf37
build(deps): bump mio from 0.8.10 to 0.8.11
...
Bumps [mio](https://github.com/tokio-rs/mio ) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases )
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md )
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11 )
---
updated-dependencies:
- dependency-name: mio
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-04-27 01:16:17 +02:00
Konrad Dybcio
65627bb1ca
Create README.md
...
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-04-27 01:13:51 +02:00
Konrad Dybcio
30cac1cf4e
ci: import more crust from Traverse Research
...
https://github.com/Traverse-Research/rust-template/blob/main/.github/workflows/ci.yml
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org >
2024-04-27 01:10:46 +02:00