Skip to content

Commit 39cf7d4

Browse files
authored
Address spelling issues of Available and Tcxo. (#365)
1 parent 06afd50 commit 39cf7d4

File tree

15 files changed

+46
-45
lines changed

15 files changed

+46
-45
lines changed

.config/lingo.dic

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ TCXO
122122
timestamp
123123
Timestamp
124124
tuple
125-
TXCO
126125
UART
127126
UFBGA73
128127
UFQFPN48

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88
### Changed
9+
- Renamed function TcxoMode::set_txco_trim() to TcxoMode::set_tcxo_trim() to correct spelling.
10+
- Renamed enum CmdStatus::Avaliable to CmdStatus::Available to correct spelling.
911
- Updated minimum `chrono` version to `0.4.23` to satisfy `cargo-audit`.
1012
- Changed minimum supported rust version from 1.60 to 1.62.
1113

hal/src/adc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ impl Adc {
825825
/// ```
826826
#[inline]
827827
pub fn set_isr(&mut self, isr: u32) {
828-
// saftey: reserved bits are masked and will be held at reset value
828+
// safety: reserved bits are masked and will be held at reset value
829829
self.adc.isr.write(|w| unsafe { w.bits(isr & irq::ALL) })
830830
}
831831

@@ -848,7 +848,7 @@ impl Adc {
848848
/// ```
849849
#[inline]
850850
pub fn isr() -> pac::adc::isr::R {
851-
// saftey: atomic read with no side-effects
851+
// safety: atomic read with no side-effects
852852
unsafe { (*pac::ADC::PTR).isr.read() }
853853
}
854854

@@ -870,7 +870,7 @@ impl Adc {
870870
/// ```
871871
#[inline]
872872
pub fn set_ier(&mut self, ier: u32) {
873-
// saftey: reserved bits are masked and will be held at reset value
873+
// safety: reserved bits are masked and will be held at reset value
874874
self.adc.ier.write(|w| unsafe { w.bits(ier & irq::ALL) })
875875
}
876876

@@ -909,7 +909,7 @@ impl Adc {
909909
pub fn start_chsel(&mut self, ch: u32) {
910910
debug_assert!(self.adc.cr.read().adstart().is_not_active());
911911
// See section 18.3.8 page 542 "Channel selection"
912-
// saftey: reserved bits are masked and will be held at reset value
912+
// safety: reserved bits are masked and will be held at reset value
913913
self.adc
914914
.chselr0()
915915
.write(|w| unsafe { w.chsel().bits(ch & CH_MASK) });

hal/src/dma/cr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl Cr {
280280
/// ```
281281
///
282282
/// [`enabled`]: crate::dma::Cr::enabled
283-
#[must_use = "set_secm returns a modified Cr"]
283+
#[must_use = "set_secure returns a modified Cr"]
284284
pub const fn set_secure(mut self, sec: bool) -> Cr {
285285
if sec {
286286
self.val |= 1 << 17;

hal/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
all(feature = "stm32wl5x_cm4", feature = "stm32wle5"),
1717
))]
1818
compile_error!(
19-
"Multile chip features activated. \
19+
"Multiple chip features activated. \
2020
You must activate exactly one of the following features: \
2121
stm32wl5x_cm0p, stm32wl5x_cm4, stm32wle5"
2222
);

hal/src/rtc/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ impl Rtc {
218218
/// Read the RTC status (interrupt) register.
219219
#[inline]
220220
pub fn status() -> pac::rtc::sr::R {
221-
// saftey: atomic read with no side-effects
221+
// safety: atomic read with no side-effects
222222
unsafe { (*pac::RTC::PTR).sr.read() }
223223
}
224224

225225
/// Read the RTC masked status (interrupt) register.
226226
#[inline]
227227
pub fn masked_status() -> pac::rtc::misr::R {
228-
// saftey: atomic read with no side-effects
228+
// safety: atomic read with no side-effects
229229
unsafe { (*pac::RTC::PTR).misr.read() }
230230
}
231231

hal/src/subghz/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ pub fn mask_irq() {
188188
/// details.
189189
#[inline]
190190
pub fn rfbusys() -> bool {
191-
// safety: atmoic read with no side-effects
191+
// safety: atomic read with no side-effects
192192
unsafe { (*pac::PWR::PTR).sr2.read().rfbusys().is_busy() }
193193
}
194194

@@ -198,7 +198,7 @@ pub fn rfbusys() -> bool {
198198
/// details.
199199
#[inline]
200200
pub fn rfbusyms() -> bool {
201-
// saftey: atomic read with no side-effects
201+
// safety: atomic read with no side-effects
202202
unsafe { (*pac::PWR::PTR).sr2.read().rfbusyms().is_busy() }
203203
}
204204

@@ -273,7 +273,7 @@ fn pulse_reset(rcc: &mut pac::RCC) {
273273
/// const TX_PARAMS: TxParams = TxParams::LP_10.set_ramp_time(RampTime::Micros40);
274274
///
275275
/// const TCXO_MODE: TcxoMode = TcxoMode::new()
276-
/// .set_txco_trim(TcxoTrim::Volts1pt7)
276+
/// .set_tcxo_trim(TcxoTrim::Volts1pt7)
277277
/// .set_timeout(Timeout::from_millis_sat(10));
278278
///
279279
/// let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
@@ -769,12 +769,12 @@ where
769769
///
770770
/// [`set_rx_duty_cycle`]: crate::subghz::SubGhz::set_rx_duty_cycle
771771
pub fn set_rtc_period(&mut self, period: Timeout) -> Result<(), Error> {
772-
let tobits: u32 = period.into_bits();
772+
let to_bits: u32 = period.into_bits();
773773
self.write(wr_reg![
774774
RTCPRDR2,
775-
(tobits >> 16) as u8,
776-
(tobits >> 8) as u8,
777-
tobits as u8
775+
(to_bits >> 16) as u8,
776+
(to_bits >> 8) as u8,
777+
to_bits as u8
778778
])
779779
}
780780

@@ -907,23 +907,23 @@ where
907907

908908
/// Setup the sub-GHz radio for TX.
909909
pub fn set_tx(&mut self, timeout: Timeout) -> Result<(), Error> {
910-
let tobits: u32 = timeout.into_bits();
910+
let to_bits: u32 = timeout.into_bits();
911911
self.write(&[
912912
OpCode::SetTx.into(),
913-
(tobits >> 16) as u8,
914-
(tobits >> 8) as u8,
915-
tobits as u8,
913+
(to_bits >> 16) as u8,
914+
(to_bits >> 8) as u8,
915+
to_bits as u8,
916916
])
917917
}
918918

919919
/// Setup the sub-GHz radio for RX.
920920
pub fn set_rx(&mut self, timeout: Timeout) -> Result<(), Error> {
921-
let tobits: u32 = timeout.into_bits();
921+
let to_bits: u32 = timeout.into_bits();
922922
self.write(&[
923923
OpCode::SetRx.into(),
924-
(tobits >> 16) as u8,
925-
(tobits >> 8) as u8,
926-
tobits as u8,
924+
(to_bits >> 16) as u8,
925+
(to_bits >> 8) as u8,
926+
to_bits as u8,
927927
])
928928
}
929929

hal/src/subghz/mod_params.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ impl FskModParams {
544544
/// .set_bandwidth(FskBandwidth::Bw58)
545545
/// .set_fdev(FskFdev::from_hertz(10_000));
546546
///
547-
/// // 30 PPM is wost case (if the HSE32 crystal meets requirements)
547+
/// // 30 PPM is worst case (if the HSE32 crystal meets requirements)
548548
/// sa::const_assert!(MOD_PARAMS.is_valid(30));
549549
/// ```
550550
#[must_use = "the return value indicates if the modulation parameters are valid"]
@@ -851,7 +851,7 @@ impl LoRaModParams {
851851
/// When possible, enabling the low data rate optimization, relaxes the
852852
/// total frequency drift over the packet time by 16:
853853
///
854-
/// Freq_drift_optimise_max = 16 × Freq_drift_max
854+
/// Freq_drift_optimize_max = 16 × Freq_drift_max
855855
///
856856
/// # Example
857857
///

hal/src/subghz/packet_status.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl FskPacketStatus {
3030
/// let pkt_status: FskPacketStatus = FskPacketStatus::from(example_data_from_radio);
3131
/// let status: Status = pkt_status.status();
3232
/// assert_eq!(status.mode(), Ok(StatusMode::Rx));
33-
/// assert_eq!(status.cmd(), Ok(CmdStatus::Avaliable));
33+
/// assert_eq!(status.cmd(), Ok(CmdStatus::Available));
3434
/// ```
3535
pub const fn status(&self) -> Status {
3636
Status::from_raw(self.buf[0])
@@ -195,7 +195,7 @@ impl LoRaPacketStatus {
195195
/// let pkt_status: LoRaPacketStatus = LoRaPacketStatus::from(example_data_from_radio);
196196
/// let status: Status = pkt_status.status();
197197
/// assert_eq!(status.mode(), Ok(StatusMode::Rx));
198-
/// assert_eq!(status.cmd(), Ok(CmdStatus::Avaliable));
198+
/// assert_eq!(status.cmd(), Ok(CmdStatus::Available));
199199
/// ```
200200
pub const fn status(&self) -> Status {
201201
Status::from_raw(self.buf[0])

hal/src/subghz/stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<ModType> Stats<ModType> {
4040
/// let example_data_from_radio: [u8; 7] = [0x54, 0, 0, 0, 0, 0, 0];
4141
/// let stats: Stats<FskStats> = Stats::from_raw_fsk(example_data_from_radio);
4242
/// assert_eq!(stats.status().mode(), Ok(StatusMode::Rx));
43-
/// assert_eq!(stats.status().cmd(), Ok(CmdStatus::Avaliable));
43+
/// assert_eq!(stats.status().cmd(), Ok(CmdStatus::Available));
4444
/// ```
4545
pub const fn status(&self) -> Status {
4646
self.status
@@ -159,7 +159,7 @@ mod test {
159159
let example_data_from_radio: [u8; 7] = [0x54, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
160160
let stats: Stats<LoRaStats> = Stats::from_raw_lora(example_data_from_radio);
161161
assert_eq!(stats.status().mode(), Ok(StatusMode::Rx));
162-
assert_eq!(stats.status().cmd(), Ok(CmdStatus::Avaliable));
162+
assert_eq!(stats.status().cmd(), Ok(CmdStatus::Available));
163163
assert_eq!(stats.pkt_rx(), 0x0102);
164164
assert_eq!(stats.pkt_crc(), 0x0304);
165165
assert_eq!(stats.pkt_hdr_err(), 0x0506);

0 commit comments

Comments
 (0)