Compare commits

..

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

4 changed files with 8 additions and 15 deletions

View file

@ -5,7 +5,7 @@
#define ADC_SDO 1
#define ADC_RST 0
#define ADC_PO PORTD
#define ADC_PI PIND
#define ADC_PI PORTD
#define ADC_PO_IO _SFR_IO_ADDR(ADC_PO)
#define ADC_PI_IO _SFR_IO_ADDR(ADC_PI)
static inline void ads8688_init()
@ -40,7 +40,7 @@ static inline void ads8688_read(unsigned char *r, unsigned char *rr, unsigned ch
__asm__("sbi %[pk], %[ck]" "\n\t"
"sbic %[pd], %[d]" "\n\t"
"ori %[q], %[i]" "\n\t"
"sbis %[pd], %[d]" "\n\t"
"sbic %[pd], %[d]" "\n\t"
"andi %[q], %[ii]" "\n\t"
"cbi %[pk], %[ck]" "\n\t"
"nop" "\n\t"

View file

@ -434,12 +434,6 @@ int main()
wdt_kick();
}
break;
case 'm':
resp[2] = conf.flags2;
conf.flags2 &=~ cmd[2];
conf.flags2 |= cmd[1];
resp[1] = conf.flags2;
break;
case 'M':
resp[2] = conf.flags;
conf.flags &=~ cmd[2];
@ -456,15 +450,14 @@ int main()
case 'L':
resp[1] = cmd[1];
resp[2] = sizeof(conf);
if ((cmd[1] | 0x20) == 'e')
eeprom_load(cmd[2]);
eeprom_load(cmd[1]);
if (conf.magic != MAGIC || conf.version != VERSION) {
resp[0] = 'E';
resp[2] = conf.version;
if (cmd[2] != 'F')
break;
}
if (cmd[1] && upcase(cmd[1])) {
if (cmd[2]) {
enable_irq(sreg);
spi_slave_Tx(resp, 3);
conf_init();
@ -550,8 +543,8 @@ void ads8688_config()
ads8688_cmd(INT2FRAME(conf.adcconf), r);
for (char i=0; i<8; i++)
ads8688_cmd((unsigned char []){
(conf.adcgain >> (4*i)) & 0xf,
2*i+11,
(conf.adcgain >> (4*i)) & 0xf,
}, r);
}
@ -567,7 +560,7 @@ unsigned char read_adc(unsigned char c, unsigned char n)
cc = 1<<c;
spi_int_init();
unsigned char cmd[2] = {0, 0xc0 | (c << 2)};
unsigned char cmd[2] = {0xc0 | (c << 2), 0};
unsigned char resp[2];
unsigned char i;
for (i=0; i<3; i++)

View file

@ -8,7 +8,7 @@
static inline void led_init()
{
DDRB |= LED_MASK;
DDRC |= LED_MASK;
}
static uint8_t led_status()

View file

@ -7,7 +7,7 @@
static inline void ltc1655_init()
{
DDRD |= 0xe0;
DDRD |= 0x70;
}
static inline void ltc1655_bit(unsigned char c, unsigned char i)