-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapper for RTC Slow memory #300
Comments
You don't need any wrapper for it since you can directly specify where you want stuff to be linked. Here is a small example #[no_mangle]
#[link_section = ".rtc.data"]
static mut RTC_VARIABLE: u32 = 0;
fn main() {
// It is necessary to call this function once. Otherwise some patches to the runtime
// implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
esp_idf_svc::sys::link_patches();
// Bind the log crate to the ESP Logging facilities
esp_idf_svc::log::EspLogger::initialize_default();
log::info!("Current RTC Value!: {}", unsafe { RTC_VARIABLE });
unsafe { RTC_VARIABLE += 1 };
FreeRtos::delay_ms(2_000);
unsafe {
esp_deep_sleep(2_000_000);
}
} Keep in mind that this example only illustrate the point. Please use something more appropriate that a |
Thanks for the reply! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a wrapper for this?
I searched all over Github, but I couldn't find anything.
The text was updated successfully, but these errors were encountered: