Skip to content

Commit

Permalink
Changes from google#580
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczmarczyck committed Apr 22, 2023
1 parent bcd382e commit 7043fa8
Show file tree
Hide file tree
Showing 76 changed files with 3,994 additions and 4,629 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cargo_bloat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up OpenSK
run: ./setup.sh
- name: Run bloat on the PR
run: RUSTFLAGS="-C link-arg=-icf=all -C force-frame-pointers=no" cargo bloat --release --target=thumbv7em-none-eabi --features=with_ctap1,vendor_hid --crates >> .github/workflows/bloat_output_new.txt
run: RUSTFLAGS="-C link-arg=-icf=all -C force-frame-pointers=no -C link-arg=-Tnrf52840_layout.ld" cargo bloat --release --target=thumbv7em-none-eabi --features=with_ctap1,vendor_hid --crates >> .github/workflows/bloat_output_new.txt

# Second run: PR
- uses: actions/checkout@v2
Expand All @@ -41,7 +41,7 @@ jobs:
run: ./setup.sh
- name: Run bloat on base
working-directory: ./OpenSK_base
run: RUSTFLAGS="-C link-arg=-icf=all -C force-frame-pointers=no" cargo bloat --release --target=thumbv7em-none-eabi --features=with_ctap1,vendor_hid --crates >> "$GITHUB_WORKSPACE/.github/workflows/bloat_output_old.txt"
run: RUSTFLAGS="-C link-arg=-icf=all -C force-frame-pointers=no -C link-arg=-Tnrf52840_layout.ld" cargo bloat --release --target=thumbv7em-none-eabi --features=with_ctap1,vendor_hid --crates >> "$GITHUB_WORKSPACE/.github/workflows/bloat_output_old.txt"

- name: Run output formatter to echo workflow command
run: ./.github/workflows/bloat_formatter.sh bloat_output_new.txt bloat_output_old.txt bloat_comment.md
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ target/
/reproducible/elf2tab.txt
/reproducible/reproduced.tar
__pycache__

# ctags
**/tags*
79 changes: 70 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@ authors = [
license = "Apache-2.0"
edition = "2018"

[target.'cfg(any(target_arch = "arm", target_arch = "riscv32"))'.dependencies]
libtock_runtime = { path = "third_party/libtock-rs/runtime", default-features = false, features = [
"no_auto_layout",
"no_debug_memop",
] }

[dependencies]
libtock_core = { path = "third_party/libtock-rs/core" }
libtock_buttons = { path = "third_party/libtock-rs/apis/buttons" }
libtock_platform = { path = "third_party/libtock-rs/platform" }
libtock_drivers = { path = "third_party/libtock-drivers" }
libtock_console = { path = "third_party/libtock-rs/apis/console" }
libtock_leds = { path = "third_party/libtock-rs/apis/leds" }
lang_items = { path = "third_party/lang-items" }
opensk = { path = "libraries/opensk" }
sk-cbor = { path = "libraries/cbor" }
crypto = { path = "libraries/crypto" }
persistent_store = { path = "libraries/persistent_store" }
libtock_unittest = { path = "third_party/libtock-rs/unittest", optional = true }
byteorder = { version = "1", default-features = false }
arrayref = "0.3.6"
rand_core = "0.6.4"
Expand All @@ -27,7 +37,7 @@ ed25519-compact = { version = "1", default-features = false, optional = true }
debug_allocations = ["lang_items/debug_allocations"]
debug_ctap = ["libtock_drivers/debug_ctap", "opensk/debug_ctap"]
panic_console = ["lang_items/panic_console"]
std = ["crypto/std", "lang_items/std", "persistent_store/std", "opensk/std"]
std = ["crypto/std", "lang_items/std", "persistent_store/std", "opensk/std", "libtock_unittest"]
verbose = ["debug_ctap", "libtock_drivers/verbose_usb"]
with_ctap1 = ["crypto/with_ctap1", "opensk/with_ctap1"]
with_nfc = ["libtock_drivers/with_nfc"]
Expand All @@ -44,10 +54,10 @@ openssl = "0.10.36"

[profile.dev]
panic = "abort"
lto = true # Link Time Optimization usually reduces size of binaries and static libraries
lto = true # Link Time Optimization usually reduces size of binaries and static libraries

[profile.release]
panic = "abort"
lto = true # Link Time Optimization usually reduces size of binaries and static libraries
lto = true # Link Time Optimization usually reduces size of binaries and static libraries
opt-level = "z"
codegen-units = 1
6 changes: 3 additions & 3 deletions boards/nordic/nrf52840_dongle_opensk/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use kernel::hil::led;
use kernel::hil::uart::{self, Configure};
use nrf52840::gpio::Pin;

use crate::CHIP;
use crate::PROCESSES;
use crate::{CHIP, PROCESSES, PROCESS_PRINTER};

struct Writer {
initialized: bool,
Expand All @@ -31,7 +30,7 @@ impl IoWrite for Writer {
let uart = nrf52840::uart::Uarte::new();
if !self.initialized {
self.initialized = true;
uart.configure(uart::Parameters {
let _ = uart.configure(uart::Parameters {
baud_rate: 115200,
stop_bits: uart::StopBits::One,
parity: uart::Parity::None,
Expand Down Expand Up @@ -64,5 +63,6 @@ pub unsafe extern "C" fn panic_fmt(pi: &PanicInfo) -> ! {
&cortexm4::support::nop,
&PROCESSES,
&CHIP,
&PROCESS_PRINTER,
)
}
Loading

0 comments on commit 7043fa8

Please sign in to comment.