Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rampinglight
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Greiner
rampinglight
Commits
8e10de3c
Commit
8e10de3c
authored
Jan 05, 2019
by
Sven Greiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define strobe pattern names
parent
8d0c1e8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
rampinglight.c
rampinglight.c
+22
-12
No files found.
rampinglight.c
View file @
8e10de3c
...
...
@@ -43,6 +43,7 @@
#define RAMP_SIZE sizeof(ramp_values)
#define RAMP_VALUES 5,5,5,5,5,6,6,6,6,7,7,8,8,9,10,11,12,13,14,15,17,18,20,22,23,25,28,30,32,35,38,41,44,47,51,55,59,63,67,71,76,81,86,92,97,103,109,116,122,129,136,144,151,159,167,176,185,194,203,213,223,233,244,255
#define TURBO_PWM 255
#define BEACON_PWM 5
#define FIXED_SIZE sizeof(fixed_values)
#define FIXED_VALUES 5,35,118,255
...
...
@@ -59,6 +60,10 @@
#define STROBE_PRESSES FIXED_SIZE+2
#define CONFIG_PRESSES 10
#define STROBE_PATTERN_BEACON 1
#define STROBE_PATTERN_FAST 2
#define STROBE_PATTERN_SIZE STROBE_PATTERN_FAST
/**
* Fuses for ATtiny13
*/
...
...
@@ -411,7 +416,7 @@ int main(void) {
#ifdef STROBE
case
STROBE_PRESSES
:
state
=
kStrobe
;
output
=
1
;
// First strobe pattern
output
=
STROBE_PATTERN_BEACON
;
break
;
#endif // ifdef STROBE
...
...
@@ -439,7 +444,7 @@ int main(void) {
#ifdef STROBE
case
kStrobe
:
output
=
(
output
%
2
)
+
1
;
output
=
(
output
%
STROBE_PATTERN_SIZE
)
+
1
;
break
;
#endif // ifdef STROBE
...
...
@@ -524,16 +529,21 @@ int main(void) {
#ifdef STROBE
case
kStrobe
:
set_pwm
(
TURBO_PWM
);
if
(
output
==
1
)
{
blink
(
2
,
3
);
set_level
(
1
);
delay_s
();
delay_s
();
}
else
{
enable_output
();
delay_10ms
(
2
);
disable_output
();
delay_10ms
(
4
);
switch
(
output
)
{
case
STROBE_PATTERN_BEACON
:
blink
(
2
,
3
);
set_pwm
(
BEACON_PWM
);
delay_s
();
delay_s
();
break
;
case
STROBE_PATTERN_FAST
:
default:
enable_output
();
delay_10ms
(
2
);
disable_output
();
delay_10ms
(
4
);
break
;
}
break
;
#endif // ifdef STROBE
...
...
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