We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c67765d commit 87a7bf5Copy full SHA for 87a7bf5
src/reactor.rs
@@ -43,6 +43,14 @@ cfg_if::cfg_if! {
43
}
44
45
46
+#[cfg(not(target_os = "espidf"))]
47
+const TIMER_QUEUE_SIZE: usize = 1000;
48
+
49
+/// ESP-IDF - being an embedded OS - does not need so many timers
50
+/// and this saves ~ 20K RAM which is a lot for an MCU with RAM < 400K
51
+#[cfg(target_os = "espidf")]
52
+const TIMER_QUEUE_SIZE: usize = 100;
53
54
const READ: usize = 0;
55
const WRITE: usize = 1;
56
@@ -98,7 +106,7 @@ impl Reactor {
98
106
sources: Mutex::new(Slab::new()),
99
107
events: Mutex::new(Vec::new()),
100
108
timers: Mutex::new(BTreeMap::new()),
101
- timer_ops: ConcurrentQueue::bounded(1000),
109
+ timer_ops: ConcurrentQueue::bounded(TIMER_QUEUE_SIZE),
102
110
103
111
})
104
112
0 commit comments