mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-09 20:11:31 +11:00
Merge pull request #21 from nmarley/rm-uart-ex-clock-freq
Remove redundant variable in pico uart examples
This commit is contained in:
commit
1218a69191
|
@ -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