added dac support

This commit is contained in:
Ayzen
2026-02-18 16:04:34 +03:00
parent b1ae9a5e49
commit db80907a0b
20 changed files with 28584 additions and 28042 deletions

View File

@ -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)