Skip to content

examples: change all clocks for ch32v003 to use internal oscillator by default #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ch32v003/src/bin/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use {ch32_hal as hal, panic_halt as _};
fn main() -> ! {
hal::debug::SDIPrint::enable();
let mut config = hal::Config::default();
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSE;
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSI;
let p = hal::init(config);

let mut delay = Delay;
Expand Down
2 changes: 1 addition & 1 deletion examples/ch32v003/src/bin/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use {ch32_hal as hal, panic_halt as _};
fn main() -> ! {
hal::debug::SDIPrint::enable();
let mut config = hal::Config::default();
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSE;
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSI;
let p = hal::init(config);

let mut delay = Delay;
Expand Down
4 changes: 3 additions & 1 deletion examples/ch32v003/src/bin/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use {ch32_hal as hal, panic_halt as _};
#[qingke_rt::entry]
fn main() -> ! {
hal::debug::SDIPrint::enable();
let p = hal::init(Default::default());
let mut config = hal::Config::default();
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSI;
let p = hal::init(config);

let pin = PwmPin::new_ch4::<0>(p.PC4);
let mut pwm = SimplePwm::new(
Expand Down
3 changes: 2 additions & 1 deletion examples/ch32v003/src/bin/spi-lcd-st7735-cube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,10 @@ impl<const WIDTH: u16, const HEIGHT: u16, const OFFSETX: u16, const OFFSETY: u16
fn main() -> ! {
hal::debug::SDIPrint::enable();
let mut config = hal::Config::default();
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSE;
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSI;
let p = hal::init(config);

hal::println!("spi-lcd-st7335-cube example starting");

// SPI1, remap 0
let cs = p.PC1;
Expand Down
2 changes: 1 addition & 1 deletion examples/ch32v003/src/bin/uart_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use {ch32_hal as hal, panic_halt as _};
fn main() -> ! {
hal::debug::SDIPrint::enable();
let mut config = hal::Config::default();
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSE;
config.rcc = hal::rcc::Config::SYSCLK_FREQ_48MHZ_HSI;
let p = hal::init(config);

let mut uart = UartTx::new_blocking(p.USART1, p.PC0, Default::default()).unwrap();
Expand Down