1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#![no_std]
pub use embedded_hal as ehal;
pub use esp8266 as target;
pub use esp8266_hal_proc_macros::{interrupt, ram};
#[cfg(feature = "rt")]
pub use xtensa_lx_rt::{entry, exception};
#[cfg(all(feature = "rt", feature = "interrupt"))]
#[macro_use]
pub mod interrupt;
pub mod efuse;
pub mod flash;
pub mod gpio;
pub mod prelude;
pub mod rng;
pub mod rtccntl;
pub mod spi;
pub mod time;
pub mod timer;
pub mod uart;
pub mod watchdog;
#[cfg(feature = "rt")]
#[doc(hidden)]
#[no_mangle]
#[ram]
pub unsafe extern "C" fn ESP8266Reset() -> ! {
extern "C" {
static mut _rtc_bss_start: u32;
static mut _rtc_bss_end: u32;
}
use esp8266::Peripherals;
use rtccntl::{CrystalFrequency, RtcControlExt};
let mut dp = Peripherals::steal();
flash::cache_enable(&mut dp.SPI0, 0);
dp.RTCCNTL
.rtc_control()
.set_crystal_frequency(CrystalFrequency::Crystal26MHz);
xtensa_lx_rt::zero_bss(&mut _rtc_bss_start, &mut _rtc_bss_end);
xtensa_lx_rt::Reset();
}