Skip to content

Commit 362108a

Browse files
authored
Merge pull request #28 from robyoung/add-github-actions-ci
Add GitHub actions CI
2 parents afd51b5 + a317379 commit 362108a

File tree

6 files changed

+50
-6
lines changed

6 files changed

+50
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Install Rust
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
toolchain: stable
19+
profile: minimal
20+
target: thumbv6m-none-eabi
21+
override: true
22+
components: rustfmt, clippy
23+
24+
- name: rustfmt
25+
run: cargo fmt -- --check
26+
27+
- name: clippy
28+
run: cargo clippy --color=always -- -D warnings
29+
30+
- name: build
31+
run: cargo check
32+
33+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
**/*.rs.bk
44
Cargo.lock
55
bloat_log*
6+
!.gitignore
7+
!.github

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
microbit
2-
========
1+
# microbit
2+
3+
[![microbit on crates.io][cratesio-image]][cratesio]
4+
[![microbit on docs.rs][docsrs-image]][docsrs]
5+
6+
[cratesio-image]: https://img.shields.io/crates/v/microbit.svg
7+
[cratesio]: https://crates.io/crates/microbit
8+
[docsrs-image]: https://docs.rs/microbit/badge.svg
9+
[docsrs]: https://docs.rs/microbit
310

411
_microbit_ contains everything required to get started with the use of Rust to create firmwares for the fabulous [BBC micro:bit][] microcontroller board. This little board has everything and a kitchen sink built-in, even a capable debugging interface, so all that one needs to get going with programming this device is:
512

@@ -18,7 +25,6 @@ A guide to embedded development with Rust on the _microbit_ using this crate can
1825
[myblog]: https://www.eggers-club.de/blog/2018/05/31/rust-on-the-microbit-101-part-1
1926
[microrust]: https://droogmic.github.io/microrust/
2027

21-
License
22-
-------
28+
## License
2329

2430
[0-clause BSD license](LICENSE-0BSD.txt).

examples/led_nonblocking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ fn heart_image(inner_brightness: u8) -> GreyscaleImage {
2929

3030
static GPIO: Mutex<RefCell<Option<GPIO>>> = Mutex::new(RefCell::new(None));
3131
static ANIM_TIMER: Mutex<RefCell<Option<LoResTimer<RTC0>>>> = Mutex::new(RefCell::new(None));
32-
static DISPLAY_TIMER: Mutex<RefCell<Option<MicrobitDisplayTimer<TIMER1>>>> = Mutex::new(RefCell::new(None));
32+
static DISPLAY_TIMER: Mutex<RefCell<Option<MicrobitDisplayTimer<TIMER1>>>> =
33+
Mutex::new(RefCell::new(None));
3334
static DISPLAY: Mutex<RefCell<Option<Display<MicrobitFrame>>>> = Mutex::new(RefCell::new(None));
3435

3536
#[entry]

src/display/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl BitImage {
7676
// FIXME: can we reject values other than 0 or 1?
7777
const fn row_byte(row: [u8; 5]) -> u8 {
7878
row[0] | row[1] << 1 | row[2] << 2 | row[3] << 3 | row[4] << 4
79-
};
79+
}
8080
BitImage([
8181
row_byte(im[0]),
8282
row_byte(im[1]),

src/led.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::hal::gpio::gpio::{
88
use crate::hal::gpio::{Output, PushPull};
99
use crate::hal::prelude::*;
1010

11+
#[allow(clippy::upper_case_acronyms)]
1112
type LED = PIN<Output<PushPull>>;
1213

1314
const DEFAULT_DELAY_MS: u32 = 2;
@@ -28,6 +29,7 @@ pub struct Display {
2829

2930
impl Display {
3031
/// Initializes all the user LEDs
32+
#[allow(clippy::too_many_arguments)]
3133
pub fn new(
3234
col1: PIN4<Output<PushPull>>,
3335
col2: PIN5<Output<PushPull>>,

0 commit comments

Comments
 (0)