Skip to content

Commit

Permalink
Merge #1227
Browse files Browse the repository at this point in the history
1227: imix: remap LEDs r=alevy a=bradjc



### Pull Request Overview

This makes the "kernel" LED only accessible in the kernel, and makes `panic!()` blink the kernel LED (instead of the "user" one).

This change is noted in issue #1205, and likely a change we will want to make anyway, so it's probably better to have it in 1.3 to reduce any potential future confusion.

@phil-levis @hudson-ayers 

### Testing Strategy

This pull request was tested by running blink and mpu_walk_region on imix.


### TODO or Help Wanted

n/a


### Documentation Updated

- [x] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [x] Ran `make formatall`.


Co-authored-by: Brad Campbell <bradjc5@gmail.com>
  • Loading branch information
bors[bot] and bradjc committed Nov 29, 2018
2 parents 7c1aa06 + 0b6162d commit efeaa77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions boards/imix/src/components/led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ impl Component for LedComponent {

unsafe fn finalize(&mut self) -> Self::Output {
let led_pins = static_init!(
[(&'static sam4l::gpio::GPIOPin, led::ActivationMode); 2],
[
(&sam4l::gpio::PC[22], led::ActivationMode::ActiveHigh),
(&sam4l::gpio::PC[10], led::ActivationMode::ActiveHigh),
]
[(&'static sam4l::gpio::GPIOPin, led::ActivationMode); 1],
[(&sam4l::gpio::PC[10], led::ActivationMode::ActiveHigh),]
);
let led = static_init!(
led::LED<'static, sam4l::gpio::GPIOPin>,
Expand Down
2 changes: 1 addition & 1 deletion boards/imix/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Write for Writer {
#[no_mangle]
#[panic_implementation]
pub unsafe extern "C" fn panic_fmt(pi: &PanicInfo) -> ! {
let led = &mut led::LedLow::new(&mut sam4l::gpio::PC[10]);
let led = &mut led::LedLow::new(&mut sam4l::gpio::PC[22]);
let writer = &mut WRITER;
debug::panic(&mut [led], writer, pi, &cortexm4::support::nop, &PROCESSES)
}

0 comments on commit efeaa77

Please sign in to comment.