verbesserte Stabilitaet

This commit is contained in:
Tristan Krause 2019-03-28 15:22:17 +01:00
parent bca001bc2e
commit 58d59b00e2
6 changed files with 126 additions and 70 deletions

View file

@ -96,10 +96,26 @@ void rqAdcDacStroke()
{
dac0.setValue(i);
wdt_reset();
uint16_t a = adu.getValue(channel_a);
uint16_t b = adu.getValue(channel_b);
usart.writeInt(a);
usart.writeInt(b);
union doubleword
{
uint16_t word[2];
uint8_t byte[4];
};
union doubleword dw;
dw.word[0] = adu.getValue(channel_a);
dw.word[1] = adu.getValue(channel_b);
uint8_t ret = 0;
do
{
wdt_reset();
ret = usart.writeBlock(&(dw.byte[0]), 4);
if(ret == 0)
return;
} while(ret != USART::MSG_OK);
}
usart.writeByte(USART::MSG_OK);