Skip to content

Commit

Permalink
fix: compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Dec 5, 2023
1 parent 8ecc339 commit 0fba15f
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 1,257 deletions.
5 changes: 1 addition & 4 deletions examples/adc_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use hal::interrupt::Interrupt;
use hal::isp::EEPROM_BLOCK_SIZE;
use hal::rtc::{DateTime, Rtc};
use hal::sysctl::Config;
use hal::systick::SysTick;
use hal::uart::UartTx;
use hal::{pac, peripherals, Peripherals};
use {ch58x_hal as hal, panic_halt as _};
Expand All @@ -25,8 +24,6 @@ fn main() -> ! {

let p = hal::init(config);

let mut delay = SysTick::new(p.SYSTICK);

// LED PA8
let mut blue_led = Output::new(p.PA8, Level::Low, OutputDrive::_5mA);

Expand Down Expand Up @@ -80,6 +77,6 @@ fn main() -> ! {
)
.unwrap();

delay.delay_ms(1000);
hal::delay_ms(1000);
}
}
11 changes: 4 additions & 7 deletions examples/adc_temp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use hal::interrupt::Interrupt;
use hal::isp::EEPROM_BLOCK_SIZE;
use hal::rtc::{DateTime, Rtc};
use hal::sysctl::Config;
use hal::systick::SysTick;
use hal::uart::UartTx;
use hal::{pac, peripherals, Peripherals};
use {ch58x_hal as hal, panic_halt as _};
Expand All @@ -25,8 +24,6 @@ fn main() -> ! {

let p = hal::init(config);

let mut delay = SysTick::new(p.SYSTICK);

// LED PA8
let mut blue_led = Output::new(p.PA8, Level::Low, OutputDrive::_5mA);

Expand All @@ -36,7 +33,7 @@ fn main() -> ! {
let mut reset_button = Input::new(p.PB23, Pull::Up);
let mut rtc = Rtc {};

serial.blocking_flush();
serial.blocking_flush().unwrap();
// rtc.set_datatime(DateTime {
// year: 2023,
// month: 10,
Expand All @@ -48,7 +45,7 @@ fn main() -> ! {

writeln!(serial, "\n\n\nHello World!").unwrap();
writeln!(serial, "Clocks: {}", hal::sysctl::clocks().hclk).unwrap();
writeln!(serial, "ChipID: {:02x}", hal::signature::get_chip_id());
writeln!(serial, "ChipID: {:02x}", hal::signature::get_chip_id()).unwrap();
let now = rtc.now();
writeln!(serial, "Boot time: {} weekday={}", now, now.isoweekday()).unwrap();

Expand All @@ -59,7 +56,7 @@ fn main() -> ! {
// writeln!(serial, "mias: 0x{:08x?}", mias.bits());

// ADC part
let mut adc_config = hal::adc::Config::for_temperature();
let adc_config = hal::adc::Config::for_temperature();
let mut adc = Adc::new(p.ADC, adc_config);

let mut temp_sensor = adc.enable_temperature();
Expand Down Expand Up @@ -87,6 +84,6 @@ fn main() -> ! {
)
.unwrap();

delay.delay_ms(1000);
hal::delay_ms(1000);
}
}
Loading

0 comments on commit 0fba15f

Please sign in to comment.