added dac support
This commit is contained in:
@ -487,6 +487,9 @@ void UART_RxCpltCallback(void)
|
||||
case DS1809_CMD_HEADER: // DS1809 UC/DC pulse command
|
||||
UART_rec_incr = 2;//timeout flag is still setting!
|
||||
break;
|
||||
case STM32_DAC_CMD_HEADER: // STM32 internal DAC command
|
||||
UART_rec_incr = 2;//timeout flag is still setting!
|
||||
break;
|
||||
default: //error decoding header
|
||||
UART_rec_incr = 0;
|
||||
flg_tmt = 0;//Reset the timeout flag
|
||||
@ -529,6 +532,16 @@ void UART_RxCpltCallback(void)
|
||||
UART_rec_incr = 0;
|
||||
flg_tmt = 0;//Reset the timeout flag
|
||||
}
|
||||
else if (UART_header == STM32_DAC_CMD_HEADER)
|
||||
{
|
||||
if ((UART_rec_incr & 0x0001) > 0)
|
||||
COMMAND[(UART_rec_incr >> 1) - 1] += ((uint16_t)(uart_buf)) << 8;
|
||||
else
|
||||
COMMAND[(UART_rec_incr >> 1) - 1] = (uint16_t)(uart_buf);
|
||||
CPU_state = STM32_DAC_CMD;
|
||||
UART_rec_incr = 0;
|
||||
flg_tmt = 0;//Reset the timeout flag
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((UART_rec_incr&0x0001)>0)
|
||||
|
||||
Reference in New Issue
Block a user