Skip to content

Commit

Permalink
refactor: replace static with const for global constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Integral-Tech authored and 981213 committed Dec 7, 2024
1 parent c011fdf commit b0ec7bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/bl2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::slice;
use std::time::Duration;
use serialport::{ClearBuffer, SerialPort};

static BL2_HANDSHAKE_REQ: &[u8] = "mudl".as_bytes();
static BL2_HANDSHAKE_RESP: &[u8] = "TF-A".as_bytes();
const BL2_HANDSHAKE_REQ: &[u8] = "mudl".as_bytes();
const BL2_HANDSHAKE_RESP: &[u8] = "TF-A".as_bytes();

pub struct BL2 {
port: Box<dyn SerialPort>,
Expand Down Expand Up @@ -142,4 +142,4 @@ impl BL2 {
pub fn go(&mut self) {
self.echo(slice::from_ref(&4));
}
}
}
4 changes: 2 additions & 2 deletions src/bootrom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::slice;
use std::time::Duration;
use serialport::{ClearBuffer, SerialPort};

static BROM_HANDSHAKE: &[u8] = &[0xa0, 0x0a, 0x50, 0x05];
const BROM_HANDSHAKE: &[u8] = &[0xa0, 0x0a, 0x50, 0x05];
pub struct BootROM {
port: Box<dyn SerialPort>,
}
Expand Down Expand Up @@ -159,4 +159,4 @@ impl BootROM {
panic!("jump_da64 magic status: {}", ret);
}
}
}
}

0 comments on commit b0ec7bd

Please sign in to comment.