mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-23 20:51:31 +11:00
Remove redundant variable in pico uart examples
This removes the hard-coded XTAL_FREQ_HZ variable from the rp-pico UART examples as it's already defined in this library as XOSC_CRYSTAL_FREQ. I noticed this as I was looking thru the examples and it seems like most of them use the rp_pico::XOSC_CRYSTAL_FREQ value instead. I'm new to embedded so please let me know if I got something wrong here. Thanks!
This commit is contained in:
parent
2f8d0f4404
commit
8b7c67ee47
|
@ -73,10 +73,6 @@ struct UartQueue {
|
||||||
interrupt: pac::Interrupt,
|
interrupt: pac::Interrupt,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust
|
|
||||||
/// if your board has a different frequency
|
|
||||||
const XTAL_FREQ_HZ: u32 = 12_000_000u32;
|
|
||||||
|
|
||||||
/// This how we transfer the UART into the Interrupt Handler
|
/// This how we transfer the UART into the Interrupt Handler
|
||||||
static GLOBAL_UART: Mutex<RefCell<Option<Uart>>> = Mutex::new(RefCell::new(None));
|
static GLOBAL_UART: Mutex<RefCell<Option<Uart>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
@ -105,7 +101,7 @@ fn main() -> ! {
|
||||||
|
|
||||||
// Configure the clocks
|
// Configure the clocks
|
||||||
let clocks = hal::clocks::init_clocks_and_plls(
|
let clocks = hal::clocks::init_clocks_and_plls(
|
||||||
XTAL_FREQ_HZ,
|
rp_pico::XOSC_CRYSTAL_FREQ,
|
||||||
pac.XOSC,
|
pac.XOSC,
|
||||||
pac.CLOCKS,
|
pac.CLOCKS,
|
||||||
pac.PLL_SYS,
|
pac.PLL_SYS,
|
||||||
|
|
|
@ -64,10 +64,6 @@ type UartPins = (
|
||||||
/// Alias the type for our UART to make things clearer.
|
/// Alias the type for our UART to make things clearer.
|
||||||
type Uart = hal::uart::UartPeripheral<hal::uart::Enabled, pac::UART0, UartPins>;
|
type Uart = hal::uart::UartPeripheral<hal::uart::Enabled, pac::UART0, UartPins>;
|
||||||
|
|
||||||
/// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust
|
|
||||||
/// if your board has a different frequency
|
|
||||||
const XTAL_FREQ_HZ: u32 = 12_000_000u32;
|
|
||||||
|
|
||||||
/// This how we transfer the UART into the Interrupt Handler
|
/// This how we transfer the UART into the Interrupt Handler
|
||||||
static GLOBAL_UART: Mutex<RefCell<Option<Uart>>> = Mutex::new(RefCell::new(None));
|
static GLOBAL_UART: Mutex<RefCell<Option<Uart>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
@ -89,7 +85,7 @@ fn main() -> ! {
|
||||||
|
|
||||||
// Configure the clocks
|
// Configure the clocks
|
||||||
let clocks = hal::clocks::init_clocks_and_plls(
|
let clocks = hal::clocks::init_clocks_and_plls(
|
||||||
XTAL_FREQ_HZ,
|
rp_pico::XOSC_CRYSTAL_FREQ,
|
||||||
pac.XOSC,
|
pac.XOSC,
|
||||||
pac.CLOCKS,
|
pac.CLOCKS,
|
||||||
pac.PLL_SYS,
|
pac.PLL_SYS,
|
||||||
|
|
Loading…
Reference in a new issue