Remove unused functions (#2254)
This commit is contained in:
parent
11c73caf89
commit
b8a4d5f9ff
@ -4,12 +4,7 @@ use esp_wifi_sys::include::timeval;
|
||||
use hal::{macros::ram, rng::Rng};
|
||||
|
||||
use crate::{
|
||||
binary::include::{
|
||||
esp_event_base_t,
|
||||
esp_timer_create_args_t,
|
||||
esp_timer_get_time,
|
||||
esp_timer_handle_t,
|
||||
},
|
||||
binary::include::{esp_event_base_t, esp_timer_get_time},
|
||||
compat::{common::*, timer_compat::*},
|
||||
hal,
|
||||
};
|
||||
@ -317,29 +312,6 @@ pub unsafe extern "C" fn esp_fill_random(dst: *mut u8, len: u32) {
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn esp_timer_stop(_handle: *mut ()) {
|
||||
todo!("esp_timer_stop");
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn esp_timer_delete(_handle: *mut ()) {
|
||||
todo!("esp_timer_delete");
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn esp_timer_start_once(_handle: *mut (), _timeout_us: u64) -> i32 {
|
||||
todo!("esp_timer_start_once");
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn esp_timer_create(
|
||||
args: *const esp_timer_create_args_t,
|
||||
out_handle: *mut esp_timer_handle_t,
|
||||
) -> i32 {
|
||||
compat_esp_timer_create(args, out_handle)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn strrchr(_s: *const (), _c: u32) -> *const u8 {
|
||||
todo!("strrchr");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
use crate::binary::{
|
||||
c_types,
|
||||
include::{esp_timer_create_args_t, esp_timer_handle_t, ets_timer},
|
||||
include::{esp_timer_create_args_t, ets_timer},
|
||||
};
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
@ -141,36 +141,3 @@ pub fn compat_timer_setfn(
|
||||
warn!("Failed to set timer function {:x}", ets_timer as usize);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn compat_esp_timer_create(
|
||||
args: *const esp_timer_create_args_t,
|
||||
out_handle: *mut esp_timer_handle_t,
|
||||
) -> i32 {
|
||||
unsafe {
|
||||
debug!("esp_timer_create {:?} {:?}", (*args).callback, (*args).arg);
|
||||
}
|
||||
|
||||
critical_section::with(|_| unsafe {
|
||||
if TIMERS.is_full() {
|
||||
// TODO: should we return -1 instead?
|
||||
panic!("ran out of timers");
|
||||
}
|
||||
|
||||
let ets_timer =
|
||||
crate::compat::malloc::calloc(1, core::mem::size_of::<ets_timer>()).cast::<ets_timer>();
|
||||
|
||||
_ = TIMERS.push(Timer {
|
||||
ets_timer,
|
||||
started: 0,
|
||||
timeout: 0,
|
||||
active: false,
|
||||
periodic: false,
|
||||
callback: TimerCallback::from(unwrap!(args.as_ref())),
|
||||
});
|
||||
|
||||
debug!("esp_timer_create {:x}", ets_timer as usize);
|
||||
*out_handle = ets_timer as _;
|
||||
|
||||
0
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user