Skip to content

Commit

Permalink
chore: minor fn rename
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Dec 31, 2023
1 parent f88029a commit 9be6259
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ble/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub fn init(
cfg.srandCB = Some(srand); // tmos_rand will call this

cfg.rcCB = None; // use LSE, no calibrate
cfg.tsCB = Some(get_raw_temperature);
cfg.tsCB = Some(temperature_raw);

// No need to set HAL_SLEEP(WakeUpTIme, sleepCB)

Expand Down Expand Up @@ -226,7 +226,8 @@ pub unsafe extern "C" fn srand() -> u32 {
systick.cnt.read().bits() as u32
}

pub unsafe extern "C" fn get_raw_temperature() -> u16 {
/// Get temperature reading in raw ADC value
pub unsafe extern "C" fn temperature_raw() -> u16 {
let mut regs: [u8; 4] = [0; 4];

let rb = &*pac::ADC::PTR;
Expand Down
11 changes: 11 additions & 0 deletions src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,17 @@ mod eh02 {
self.blocking_write(words)
}
}

impl<'d, T: Instance> embedded_hal_02::blocking::spi::Transfer<u8> for Spi<'d, T> {
type Error = Error;

fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error> {
self.blocking_write(words)?;
self.blocking_read(words)?;

Ok(words)
}
}
}

// - instance trait
Expand Down

0 comments on commit 9be6259

Please sign in to comment.