Commit 56ad7e84 authored by Jan Kasprzak's avatar Jan Kasprzak
Browse files

Watchdog handling moved to its own source file

parent aea7cb9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line

PROGRAM=lights
SRC=main.c logging.c pwm.c adc.c pwmled.c pattern.c buttons.c control.c \
	battery.c
	battery.c wdt.c
OBJ=$(SRC:.c=.o)


+4 −0
Original line number Diff line number Diff line
@@ -75,6 +75,10 @@ pattern_t *status_led_pattern_select();
#define ERR_PWMLED  2
void set_error(unsigned char err);

/* wdt.c */
void init_wdt();
void susp_wdt();

/* main.c */
void power_down();

+3 −3
Original line number Diff line number Diff line
@@ -11,11 +11,10 @@ static void hw_setup()
{
	power_all_disable();

	wdt_enable(WDTO_1S);

	init_battery();
	init_pwm();
	init_adc();
	init_wdt();

	init_buttons();

@@ -30,9 +29,10 @@ static void hw_suspend()
{
	susp_pwm();
	susp_adc();
	susp_wdt();

	susp_buttons();

	wdt_disable();
	power_all_disable();
}

projects/step-up/wdt.c

0 → 100644
+16 −0
Original line number Diff line number Diff line
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>

#include "lights.h"

void init_wdt()
{
	wdt_enable(WDTO_1S);
}

void susp_wdt()
{
	wdt_disable();
}