Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jan Kasprzak
tinyboard
Commits
3e9d94b2
Commit
3e9d94b2
authored
May 02, 2013
by
Jan Kasprzak
Browse files
power off by default, power on/off with button
parent
ffb49825
Changes
4
Hide whitespace changes
Inline
Side-by-side
projects/step-up/adc.c
View file @
3e9d94b2
...
...
@@ -120,21 +120,12 @@ void init_adc()
start_next_adc
();
}
#if 0
void
susp_adc
()
{
ADCSRA
=
0
;
DIDR0
=
0
;
}
static void adc1_gain20_adc(uint16_t adcsum)
{
// running average
adc1_gain20_offset += adcsum
- (adc1_gain20_offset >> ADC1_GAIN20_OFFSET_SHIFT);
}
#endif
static
void
inline
adc_based_timer
()
{
static
unsigned
char
count
;
...
...
projects/step-up/control.c
View file @
3e9d94b2
...
...
@@ -77,8 +77,7 @@ void short_press()
void
long_press
()
{
e
.
shutdown_in_progress
=
0
;
pattern_reload
();
power_down
();
}
pattern_t
*
pwmled_pattern_select
()
...
...
projects/step-up/main.c
View file @
3e9d94b2
...
...
@@ -26,16 +26,14 @@ static void hw_setup()
set_sleep_mode
(
SLEEP_MODE_IDLE
);
}
#if 0
static
void
hw_suspend
()
{
susp_pwm
();
susp_adc
();
susp_tmr();
susp_gpio();
susp_buttons
();
wdt_disable
();
power_all_disable
();
}
void
power_down
()
...
...
@@ -60,7 +58,6 @@ void power_down()
// ok, so I will wake up
hw_setup
();
}
#endif
int
main
(
void
)
{
...
...
@@ -69,7 +66,7 @@ int main(void)
log_set_state
(
3
);
hw_setup
();
//
power_down();
- not while still debugging
power_down
();
sei
();
#if 1
...
...
projects/step-up/pwm.c
View file @
3e9d94b2
...
...
@@ -39,22 +39,16 @@ void init_pwm()
PORTB
&=
~
_BV
(
PB4
);
// set to zero
}
#if 0
void
susp_pwm
()
{
unsigned char i;
for (i = 0; i < N_PWMLEDS; i++)
pwm[i] = 0;
DDRB &= ~(_BV( PB1 ) | _BV( PB3 ) | _BV( PB5 ));
TCCR1D = TCCR1C = TCCR1B = TCCR1A = 0;
DDRB
&=
~
(
_BV
(
PB4
));
PORTB
&=
~
(
_BV
(
PB4
));
TCCR1
=
0
;
TIMSK
=
0
;
TIFR
=
0
;
PLLCSR
&=
~
(
_BV
(
PLLE
)
|
_BV
(
PCKE
));
}
#endif
void
pwm_off
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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