Fixed warning by uppercasing static variable

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
This commit is contained in:
Daniel Egger 2019-04-25 08:47:33 +02:00
parent b10bbb76b0
commit 8fa4d3f527
1 changed files with 4 additions and 4 deletions

View File

@ -60,25 +60,25 @@ fn main() -> ! {
#[exception]
fn SysTick() -> ! {
// Exception handler state variable
static mut state: u8 = 1;
static mut STATE: u8 = 1;
// Enter critical section
cortex_m::interrupt::free(|cs| {
// Borrow access to our GPIO pin from the shared structure
if let Some(ref mut led) = *GPIO.borrow(cs).borrow_mut().deref_mut() {
// Check state variable, keep LED off most of the time and turn it on every 10th tick
if *state < 10 {
if *STATE < 10 {
// Turn off the LED
led.set_low();
// And now increment state variable
*state += 1;
*STATE += 1;
} else {
// Turn on the LED
led.set_high();
// And set new state variable back to 0
*state = 0;
*STATE = 0;
}
}
});