Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jan Kasprzak
tinyboard
Commits
15e2b46e
Commit
15e2b46e
authored
Apr 29, 2013
by
Jan Kasprzak
Browse files
pwmled.c: separate target setting and on/off switching
parent
d024b5fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
projects/step-up/lights.h
View file @
15e2b46e
...
...
@@ -3,8 +3,6 @@
#define TESTING_FW 1
#define N_LEDS 7
#define N_PWMLEDS 2
#define N_PWMLED_MODES 4
#define N_BUTTONS 2
...
...
@@ -45,7 +43,8 @@ void susp_tmr();
/* pwmled.c */
void
init_pwmled
();
void
pwmled_adc
(
uint16_t
adcval
);
void
pwmled_set_mode
(
unsigned
char
mode
);
void
pwmled_set_target
(
unsigned
char
mode
);
void
pwmled_on_off
(
unsigned
char
on
);
/* gpio.c */
void
init_gpio
();
...
...
projects/step-up/pwmled.c
View file @
15e2b46e
...
...
@@ -46,13 +46,18 @@ void init_pwmled()
state
=
ST_OFF
;
}
void
pwmled_set_mode
(
unsigned
char
mode
)
void
pwmled_set_target
(
unsigned
char
mode
)
{
target
=
targets
[
mode
];
mode_changed
=
1
;
}
void
pwmled_on_off
(
unsigned
char
mode
)
{
if
(
!
ST_CAN_SET_MODE
(
state
))
return
;
if
(
mode
)
{
target
=
targets
[
mode
-
1
];
state
=
ST_ON
;
mode_changed
=
1
;
pwm_set
(
pwm_val
);
...
...
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