Lines
70.83 %
Functions
66.67 %
Branches
100 %
#![cfg_attr(not(test), no_std)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(dead_code)]
#![allow(static_mut_refs)]
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(unused_parens)]
#![allow(unused_unsafe)]
#![allow(unused_variables)]
// Do not edit this file as it will be overwritten if codegen is rerun
mod bridge;
mod component;
mod logging;
#[cfg(test)]
mod test;
use crate::bridge::thermostat_thermostat_api::{self as api, *};
use crate::component::thermostat_thermostat_app::*;
use data::*;
static mut app: Option<thermostat_thermostat> = None;
static mut init_api: thermostat_thermostat_Application_Api<thermostat_thermostat_Initialization_Api> = api::init_api();
static mut compute_api: thermostat_thermostat_Application_Api<thermostat_thermostat_Compute_Api> = api::compute_api();
#[no_mangle]
pub extern "C" fn thermostat_thermostat_initialize() {
logging::init_logging();
unsafe {
crate::bridge::extern_c_api::initialize_test_globals();
let mut _app = thermostat_thermostat::new();
_app.initialize(&mut init_api);
app = Some(_app);
}
pub extern "C" fn thermostat_thermostat_timeTriggered() {
if let Some(_app) = app.as_mut() {
_app.timeTriggered(&mut compute_api);
} else {
panic!("Unexpected: app is None");
pub extern "C" fn thermostat_thermostat_notify(channel: microkit_channel) {
_app.notify(channel);
// Need a Panic handler in a no_std environment
#[panic_handler]
#[cfg(not(test))]
fn panic(info: &core::panic::PanicInfo) -> ! {
log::error!("PANIC: {info:#?}");
loop {}