Compare commits

..

No commits in common. "4e5d4fa092191cc17482acb3d00d5aaa9cd6cfd5" and "f0182fdb20edd7258ef8748cfbc5cdd5865682c6" have entirely different histories.

5 changed files with 10 additions and 18 deletions

View file

@ -85,7 +85,3 @@ lcd.o: lcd.c spi_slave.h lcd_routines.h lcd_routines.c uart_atmega16.c
$(AD) -U eeprom:r:$@
%.eeprom.burn: %.eeprom
$(AD) -U eeprom:v:$< || $(AD) -U eeprom:w:$<
%.ad:
$(AD) -v -t

View file

@ -1,9 +1,8 @@
#include "avr/io.h"
#define ADC_SDI 7
#define ADC_SDI 4
#define ADC_SCK 5
#define ADC_CE 4
#define ADC_CE 7
#define ADC_SDO 1
#define ADC_RST 0
#define ADC_PO PORTD
#define ADC_PI PORTD
#define ADC_PO_IO _SFR_IO_ADDR(ADC_PO)

View file

@ -252,8 +252,8 @@ unsigned int adc_hv;
int hv_is_safe()
{
return !hvosc_is_on()
&& conf.dac <= conf.dac_off
&& adc_hv <= conf.hvadc_safe
&& conf.dac == conf.dac_off
&& adc_hv < conf.hvadc_safe
;
}
@ -277,12 +277,9 @@ void hv_safe()
unsigned char sreg = disable_irq();
ltc1655_cmd(INT2FRAME(conf.dac_off));
conf.dac = conf.dac_off;
unsigned int adc_last = 0xffff;
while (!read_hvadc()) {
if (adc_hv < conf.hvadc_safe || adc_hv >= adc_last)
while (!read_hvadc())
if (adc_hv < conf.hvadc_safe)
break;
adc_last = adc_hv;
}
enable_irq(sreg);
toggle_hv_led();
}
@ -298,7 +295,7 @@ int main()
ltc1655_init();
hv_safe();
eeprom_load(0);
if (conf.magic == MAGIC && conf.version == VERSION)
if (conf.magic == MAGIC || conf.version == VERSION)
conf_init();
while (1) {
unsigned char cmd[3];

View file

@ -1,7 +1,7 @@
#include "avr/io.h"
#define LED1 4
#define LED1 2
#define LED2 3
#define LED_PORT PORTB
#define LED_PORT PORTC
#define LED_GREEN (1<<LED1)
#define LED_RED (1<<LED2)
#define LED_MASK (LED_GREEN | LED_RED)

View file

@ -1,5 +1,5 @@
#include "avr/io.h"
#define DAC_SDI 7
#define DAC_SDI 4
#define DAC_SCK 5
#define DAC_CE 6
#define DAC_PORT PORTD