Skip to content

Commit

Permalink
fix hal folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sky-dragn committed Feb 24, 2024
1 parent 3ef817a commit b6370d6
Show file tree
Hide file tree
Showing 80 changed files with 16,499 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/bin/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,14 @@ mod app {

#[task(binds = USART1, shared = [gps])]
fn on_uart(mut cx: on_uart::Context) {
info!("hewwo");
cx.shared.gps.lock(|gps| {
gps.handle();
});
info!("foo");
if let Ok(b) = cx.shared.gps.lock(|gps| gps.serial.read()) {
info!("hewwo {}", b);
}
// cx.shared.gps.lock(|gps| {
// gps.handle();
// });

}

#[task(binds = RTC_WKUP)]
Expand Down
1 change: 0 additions & 1 deletion stm32l4xx-hal
Submodule stm32l4xx-hal deleted from 26e091
31 changes: 31 additions & 0 deletions stm32l4xx-hal/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#[target.thumbv7m-none-eabi]
# uncomment this to make `cargo run` execute programs on QEMU
# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# uncomment ONE of these three option to make `cargo run` start a GDB session
# which option to pick depends on your system
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
# runner = "gdb-multiarch -q -x openocd.gdb"
# runner = "gdb -q -x openocd.gdb"

rustflags = [
# LLD (shipped with the Rust toolchain) is used as the default linker
"-C", "link-arg=-Tlink.x",

# if you run into problems with LLD switch to the GNU linker by commenting out
# this line
# "-C", "linker=arm-none-eabi-ld",

# if you need to link to pre-compiled C libraries provided by a C toolchain
# use GCC as the linker by commenting out both lines above and then
# uncommenting the three lines below
# "-C", "linker=arm-none-eabi-gcc",
# "-C", "link-arg=-Wl,-Tlink.x",
# "-C", "link-arg=-nostartfiles",
]

[build]
# Pick ONE of these compilation targets
# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU)
target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)
82 changes: 82 additions & 0 deletions stm32l4xx-hal/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
on:
push:
branches: [master]
pull_request:

name: Continuous integration

jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix: # All permutations of {rust, mcu}
rust:
- stable
mcu: # Note leading comma is required if any additional fetures are specified
- { id: stm32l412, additional-features: ",stm32-usbd" }
- { id: stm32l422, additional-features: ",stm32-usbd" }
- { id: stm32l431, additional-features: "" }
- { id: stm32l432, additional-features: ",stm32-usbd" }
- { id: stm32l433, additional-features: ",stm32-usbd" }
- { id: stm32l442, additional-features: ",stm32-usbd" }
- { id: stm32l443, additional-features: ",stm32-usbd" }
- { id: stm32l451, additional-features: "" }
- { id: stm32l452, additional-features: ",stm32-usbd" }
- { id: stm32l462, additional-features: ",stm32-usbd" }
- { id: stm32l471, additional-features: "" }
- { id: stm32l475, additional-features: "" } # USB_OTG not supported by PAC
- { id: stm32l476, additional-features: ",otg_fs" }
- { id: stm32l486, additional-features: ",otg_fs" }
- { id: stm32l496, additional-features: ",otg_fs" }
- { id: stm32l4a6, additional-features: ",otg_fs" }

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: thumbv7em-none-eabihf
override: true
- name: build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --verbose --release --examples --target thumbv7em-none-eabihf --features rt,unproven,${{ matrix.mcu.id }}${{ matrix.mcu.additional-features }}
- name: test
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --target x86_64-unknown-linux-gnu --features rt,unproven,${{ matrix.mcu.id }}${{ matrix.mcu.additional-features }}

ci-r9:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
mcu:
- { id: stm32l4r9, additional-features: "" }
- { id: stm32l4s9, additional-features: "" }

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: thumbv7em-none-eabihf
override: true
- name: build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --verbose --release --target thumbv7em-none-eabihf --features rt,unproven,${{ matrix.mcu.id }}${{ matrix.mcu.additional-features }}
# note that examples were not built
- name: test
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --target x86_64-unknown-linux-gnu --features rt,unproven,${{ matrix.mcu.id }}${{ matrix.mcu.additional-features }}
22 changes: 22 additions & 0 deletions stm32l4xx-hal/.github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
branches: [ master ]
pull_request:

name: Clippy check
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
override: true
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --examples --target thumbv7em-none-eabihf --features=stm32l432,rt,unproven
23 changes: 23 additions & 0 deletions stm32l4xx-hal/.github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
branches: [ master ]
pull_request:

name: Code formatting check

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
10 changes: 10 additions & 0 deletions stm32l4xx-hal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/target
**/*.rs.bk
Cargo.lock

# cargo-embed
/Embed.local.toml
/logs

# Visual Studio Code
/.vscode
Loading

0 comments on commit b6370d6

Please sign in to comment.