Skip to content

Commit c95558f

Browse files
committed
Merge branch 'main' into fix-memory-x-file
2 parents 9e54766 + cd222fd commit c95558f

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

examples/rtic/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ features = ["critical-section"]
3535
[dependencies.ringbuf]
3636
version = "0.4.7"
3737
default-features = false
38+
git = "https://github.com/robamu/ringbuf.git"
39+
branch = "remove-mut-on-split-ref"
3840
features = ["portable-atomic"]
3941

4042
[dependencies.va108xx-hal]

examples/rtic/src/bin/uart-echo-rtic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use ringbuf::StaticRb;
1212
const RX_RING_BUF_SIZE: usize = 1024;
1313

1414
// Ring buffers to handling variable sized telemetry
15-
static mut RINGBUF: Lazy<StaticRb<u8, RX_RING_BUF_SIZE>> =
15+
static RINGBUF: Lazy<StaticRb<u8, RX_RING_BUF_SIZE>> =
1616
Lazy::new(StaticRb::<u8, RX_RING_BUF_SIZE>::default);
1717

1818
#[rtic::app(device = pac, dispatchers = [OC4])]
@@ -71,7 +71,7 @@ mod app {
7171

7272
rx.start();
7373

74-
let (data_producer, data_consumer) = unsafe { RINGBUF.split_ref() };
74+
let (data_producer, data_consumer) = RINGBUF.split_ref();
7575
echo_handler::spawn().unwrap();
7676
(
7777
Shared {},

flashloader/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ version = "0.4"
2525
[dependencies.ringbuf]
2626
version = "0.4.7"
2727
default-features = false
28+
git = "https://github.com/robamu/ringbuf.git"
29+
branch = "remove-mut-on-split-ref"
2830
features = ["portable-atomic"]
2931

3032
[dependencies.once_cell]

flashloader/src/main.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ const BUF_RB_SIZE_TM: usize = 256;
4545
const SIZES_RB_SIZE_TM: usize = 16;
4646

4747
// Ring buffers to handling variable sized telemetry
48-
static mut BUF_RB_TM: Lazy<StaticRb<u8, BUF_RB_SIZE_TM>> =
48+
static BUF_RB_TM: Lazy<StaticRb<u8, BUF_RB_SIZE_TM>> =
4949
Lazy::new(StaticRb::<u8, BUF_RB_SIZE_TM>::default);
50-
static mut SIZES_RB_TM: Lazy<StaticRb<usize, SIZES_RB_SIZE_TM>> =
50+
static SIZES_RB_TM: Lazy<StaticRb<usize, SIZES_RB_SIZE_TM>> =
5151
Lazy::new(StaticRb::<usize, SIZES_RB_SIZE_TM>::default);
5252

5353
// Ring buffers to handling variable sized telecommands
54-
static mut BUF_RB_TC: Lazy<StaticRb<u8, BUF_RB_SIZE_TC>> =
54+
static BUF_RB_TC: Lazy<StaticRb<u8, BUF_RB_SIZE_TC>> =
5555
Lazy::new(StaticRb::<u8, BUF_RB_SIZE_TC>::default);
56-
static mut SIZES_RB_TC: Lazy<StaticRb<usize, SIZES_RB_SIZE_TC>> =
56+
static SIZES_RB_TC: Lazy<StaticRb<usize, SIZES_RB_SIZE_TC>> =
5757
Lazy::new(StaticRb::<usize, SIZES_RB_SIZE_TC>::default);
5858

5959
pub struct DataProducer<const BUF_SIZE: usize, const SIZES_LEN: usize> {
@@ -149,11 +149,11 @@ mod app {
149149

150150
let verif_reporter = VerificationReportCreator::new(0).unwrap();
151151

152-
let (buf_prod_tm, buf_cons_tm) = unsafe { BUF_RB_TM.split_ref() };
153-
let (sizes_prod_tm, sizes_cons_tm) = unsafe { SIZES_RB_TM.split_ref() };
152+
let (buf_prod_tm, buf_cons_tm) = BUF_RB_TM.split_ref();
153+
let (sizes_prod_tm, sizes_cons_tm) = SIZES_RB_TM.split_ref();
154154

155-
let (buf_prod_tc, buf_cons_tc) = unsafe { BUF_RB_TC.split_ref() };
156-
let (sizes_prod_tc, sizes_cons_tc) = unsafe { SIZES_RB_TC.split_ref() };
155+
let (buf_prod_tc, buf_cons_tc) = BUF_RB_TC.split_ref();
156+
let (sizes_prod_tc, sizes_cons_tc) = SIZES_RB_TC.split_ref();
157157

158158
let mut rx_context = IrqContextTimeoutOrMaxSize::new(MAX_TC_FRAME_SIZE);
159159
rx.read_fixed_len_or_timeout_based_using_irq(&mut rx_context)

va108xx-hal/src/gpio/pin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ macro_rules! pin_id {
320320
//==================================================================================================
321321

322322
/// A type-level GPIO pin, parameterized by [PinId] and [PinMode] types
323-
324323
pub struct Pin<I: PinId, M: PinMode> {
325324
pub(in crate::gpio) regs: Registers<I>,
326325
mode: PhantomData<M>,

va108xx-hal/src/uart.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,17 @@ impl IrqResultMaxSizeOrTimeout {
284284

285285
#[inline]
286286
pub fn overflow_error(&self) -> bool {
287-
self.errors.map_or(false, |e| e.overflow)
287+
self.errors.is_some_and(|e| e.overflow)
288288
}
289289

290290
#[inline]
291291
pub fn framing_error(&self) -> bool {
292-
self.errors.map_or(false, |e| e.framing)
292+
self.errors.is_some_and(|e| e.framing)
293293
}
294294

295295
#[inline]
296296
pub fn parity_error(&self) -> bool {
297-
self.errors.map_or(false, |e| e.parity)
297+
self.errors.is_some_and(|e| e.parity)
298298
}
299299

300300
#[inline]

0 commit comments

Comments
 (0)