Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sven Greiner
rampinglight
Commits
771291a3
Commit
771291a3
authored
Mar 08, 2020
by
Sven Greiner
Browse files
Freeze at both ends (after blip)
This makes everything a bit more consistent.
parent
aa05164e
Changes
2
Show whitespace changes
Inline
Side-by-side
README.md
View file @
771291a3
...
...
@@ -10,7 +10,7 @@ This firmware is compatible with the driver commonly found in Convoy flashlights
-
Battery check: one to four flashes
-
Low voltage protection: flicker every 15 seconds if the voltage is low and turn off if the voltage is critical
-
Mode memory: start with last frozen ramp value or with last fixed level (off-time memory)
-
Stop at
high
: in ramping UI, stop if ramping reaches maximum output
-
Stop at
ramp end
: in ramping UI, stop if ramping reaches
minimum or
maximum output
-
Start at high: after the flashlight was off, start with the highest output (and go from high to low)
-
Beacon mode: low background light with regular flashes
-
Tactical strobe: if enabled, always start with fast strobe mode
...
...
@@ -27,12 +27,12 @@ This firmware is compatible with the driver commonly found in Convoy flashlights
1.
Start with strobe
1.
Ramping or fixed levels
1.
Mode memory on or off
1.
Freeze on
high
1.
Freeze on
ramp end
1.
Start on high
1.
Stealth beacon mode
1.
Slow beacon mode
The default is: no strobe, ramping UI, no mode memory, do not freeze on
high
, start on low, no stealth beacon, no slow beacon
The default is: no strobe, ramping UI, no mode memory, do not freeze on
ramp end
, start on low, no stealth beacon, no slow beacon
### Ramping UI
...
...
@@ -43,7 +43,7 @@ Tap two times to go into turbo mode. There is no timer, so make sure to monitor
If "start on high" is enabled, the light starts with the highest level and ramps down.
Enable "freeze on
high
" to stop ramping when reaching the highest level.
Enable "freeze on
ramp end
" to stop ramping when reaching the
lowest or
highest level.
### Fixed level UI
...
...
rampinglight.c
View file @
771291a3
...
...
@@ -99,7 +99,7 @@ typedef union {
unsigned
strobe
:
1
;
unsigned
fixed_mode
:
1
;
unsigned
mode_memory
:
1
;
unsigned
freeze_on_
high
:
1
;
unsigned
freeze_on_
end
:
1
;
unsigned
start_high
:
1
;
unsigned
stealth_beacon
:
1
;
unsigned
slow_beacon
:
1
;
...
...
@@ -471,13 +471,15 @@ int main(void) {
output
+=
ramping_up
?
1
:
-
1
;
set_level
(
output
);
if
(
output
==
RAMP_SIZE
-
1
&&
options
.
freeze_on_high
)
{
state
=
kFrozen
;
break
;
}
else
if
(
output
==
RAMP_SIZE
-
1
||
output
==
0
)
{
if
(
output
==
RAMP_SIZE
-
1
||
output
==
0
)
{
blink
(
2
,
FLICKER_TIME
);
enable_output
();
delay_10ms
(
50
);
if
(
options
.
freeze_on_end
)
{
state
=
kFrozen
;
break
;
}
}
delay_10ms
(
RAMP_TIME
*
100
/
RAMP_SIZE
);
...
...
Write
Preview
Supports
Markdown
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