diff --git a/Makefile b/Makefile index d594a6d..9769959 100644 --- a/Makefile +++ b/Makefile @@ -47,5 +47,5 @@ bin: $(PRG).bin $(OBJCOPY) -j .text -j .data -O binary $< $@ install: text - uisp -dprog=avr910 -dserial=/dev/ttyS0 -dspeed=115200 -dpart=M8 --erase --upload if=$(PRG).hex -# avrdude -p m8 -c butterfly -b 19200 -P /dev/ttyUSB0 -u -e -U flash:w:$(PRG).hex +# uisp -dprog=avr910 -dserial=/dev/ttyS0 -dspeed=115200 -dpart=M8 --erase --upload if=$(PRG).hex + avrdude -p m8 -c butterfly -b 115200 -P /dev/ttyUSB0 -u -e -U flash:w:$(PRG).hex diff --git a/lipo-charger.c b/lipo-charger.c index e34a427..8735b8b 100644 --- a/lipo-charger.c +++ b/lipo-charger.c @@ -50,6 +50,7 @@ */ #define CH0 PORTC0 #define CH1 PORTC1 +#define SUMMER PORTB0 #define PWM PORTB1 #define NOP asm volatile ("nop") @@ -60,7 +61,7 @@ #define VOLTAGE_CONNECT 9000 #define VOLTAGE_CHARGE 12450 -#define CURRENT_CHARGE 16000 +#define CURRENT_CHARGE 17500 #define CURRENT_READY 2000 #define VOLTAGE_REMOVE 1000 @@ -223,6 +224,9 @@ ISR(TIMER0_OVF_vect) lcd_update = 1; } + static uint16_t beep_timer; + beep_timer = (beep_timer +1) & 0x3FF; + /* * charge with constant voltage of 12.45V * and a current limit of 1.6A @@ -243,6 +247,11 @@ ISR(TIMER0_OVF_vect) TCCR1A &= ~(1< 9V is detected (lipo connected) */ @@ -266,7 +275,7 @@ ISR(TIMER0_OVF_vect) int main(void) { - DDRB = (1<