Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Astro
rust-card10
Commits
5dc11ba9
Commit
5dc11ba9
authored
Aug 29, 2019
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
l0dable/src/light_sensor.rs
View file @
5dc11ba9
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
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment