Commit 5724a3de authored by Sergey Pepyakin's avatar Sergey Pepyakin
Browse files

Prevent creation of LightSensor

parent 6e22249c
use super::bindings::*;
pub struct LightSensor;
pub struct LightSensor {
// Prevent creation of this struct by all but this module.
_private: (),
}
impl LightSensor {
pub fn start() -> Self {
if unsafe { epic_light_sensor_run() } != 0 {
panic!("Cannot start light sensor");
}
LightSensor
LightSensor { _private: () }
}
pub fn get(&self) -> Option<u16> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment