File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -430,20 +430,30 @@ main() {
430430 # https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x.svd
431431 )
432432
433- target/$TARGET /release/svd2rust --target msp430 -i $td /msp430g2553.svd | \
434- ( rustfmt 2> /dev/null > $td /src/lib.rs || true )
433+ local cwd=$( pwd)
435434
436- cargo check --manifest-path $td /Cargo.toml
435+ # Test MSP430
436+ pushd $td
437+
438+ $cwd /target/$TARGET /release/svd2rust --target msp430 -i $td /msp430g2553.svd
439+ mv $td /lib.rs $td /src/lib.rs
440+ rustfmt $td /src/lib.rs || true
437441
438- target/$TARGET /release/svd2rust --target none -i $td /msp430g2553.svd | \
439- ( rustfmt 2> /dev/null > $td /src/lib.rs || true )
442+ popd
440443
441444 cargo check --manifest-path $td /Cargo.toml
442445
443- # target/$TARGET/release/svd2rust --target riscv -i $td/e310x.svd | \
444- # ( rustfmt 2>/dev/null > $td/src/lib.rs || true )
446+ # Test RISC-V
445447
446- cargo check --manifest-path $td /Cargo.toml
448+ # pushd $td
449+
450+ # target/$TARGET/release/svd2rust --target riscv -i $td/e310x.svd
451+ # mv $td/lib.rs $td/src/lib.rs
452+ # rustfmt $td/src/lib.rs || true
453+
454+ # popd
455+
456+ # cargo check --manifest-path $td/Cargo.toml
447457 ;;
448458
449459 Nordic)
Original file line number Diff line number Diff line change @@ -103,17 +103,11 @@ fn run() -> Result<()> {
103103 let mut device_x = String :: new ( ) ;
104104 let items = generate:: device:: render ( & device, & target, nightly, & mut device_x) ?;
105105
106+ writeln ! ( File :: create( "lib.rs" ) . unwrap( ) , "{}" , quote!( #( #tokens) * ) ) . unwrap ( ) ;
107+
106108 if target == Target :: CortexM {
107- writeln ! ( File :: create( "lib.rs" ) . unwrap( ) , "{}" , quote!( #( #items) * ) ) . unwrap ( ) ;
108109 writeln ! ( File :: create( "device.x" ) . unwrap( ) , "{}" , device_x) . unwrap ( ) ;
109110 writeln ! ( File :: create( "build.rs" ) . unwrap( ) , "{}" , build_rs( ) ) . unwrap ( ) ;
110- } else {
111- println ! (
112- "{}" ,
113- quote! {
114- #( #items) *
115- }
116- ) ;
117111 }
118112
119113 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments