Commit 5dc11ba9 authored by Astro's avatar Astro
Browse files

Merge branch 'lilpep-fix-light-sensor' into 'master'

Prevent creation of LightSensor outside of the module

See merge request !16
parents 6e22249c 5724a3de
Pipeline #3678 passed with stage
in 23 minutes and 2 seconds
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> {
......
Markdown is supported
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