forked from M-Labs/zynq-rs
fix const in arr expression
This commit is contained in:
parent
49a84da2ce
commit
675ef795a8
|
@ -1,6 +1,5 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(const_in_array_repeat_expressions)]
|
|
||||||
#![feature(naked_functions)]
|
#![feature(naked_functions)]
|
||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![feature(const_fn)]
|
|
||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
|
|
|
@ -172,13 +172,12 @@ impl<'a, T> Iterator for Receiver<'a, T> where T: Clone {
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
/// Macro for initializing the sync_channel with static buffer and indexes.
|
/// Macro for initializing the sync_channel with static buffer and indexes.
|
||||||
/// Note that this requires `#![feature(const_in_array_repeat_expressions)]`
|
|
||||||
macro_rules! sync_channel {
|
macro_rules! sync_channel {
|
||||||
($t: ty, $cap: expr) => {
|
($t: ty, $cap: expr) => {
|
||||||
{
|
{
|
||||||
use core::sync::atomic::{AtomicUsize, AtomicPtr};
|
use core::sync::atomic::{AtomicUsize, AtomicPtr};
|
||||||
use $crate::sync_channel::{Sender, Receiver};
|
use $crate::sync_channel::{Sender, Receiver};
|
||||||
static LIST: [AtomicPtr<$t>; $cap + 1] = [AtomicPtr::new(core::ptr::null_mut()); $cap + 1];
|
static LIST: [AtomicPtr<$t>; $cap + 1] = [const { AtomicPtr::new(core::ptr::null_mut()); }; $cap + 1];
|
||||||
static WRITE: AtomicUsize = AtomicUsize::new(0);
|
static WRITE: AtomicUsize = AtomicUsize::new(0);
|
||||||
static READ: AtomicUsize = AtomicUsize::new(0);
|
static READ: AtomicUsize = AtomicUsize::new(0);
|
||||||
(Sender::new(&LIST, &WRITE, &READ), Receiver::new(&LIST, &WRITE, &READ))
|
(Sender::new(&LIST, &WRITE, &READ), Receiver::new(&LIST, &WRITE, &READ))
|
||||||
|
|
Loading…
Reference in New Issue