update valtage and current get

This commit is contained in:
不吃油炸鸡
2025-09-14 18:47:02 +08:00
parent b7e746a7c2
commit a3b9fbbbe7
7 changed files with 122 additions and 29 deletions

View File

@@ -29,8 +29,20 @@ void DataTask(void *argument)
if(osMessageQueueGet(Key_MessageQueue, &keystr, NULL, 0)==osOK)
{
// UART6_TX_Send((uint8_t *)"key pressed\r\n", 13);
}
// __disable_irq();
// if(adc_buf_index == 0)
// memcpy((uint16_t*)adc_packet.data, (uint16_t*)ADC_BUF[1], sizeof(adc_packet.data));
// else
// memcpy((uint16_t*)adc_packet.data, (uint16_t*)ADC_BUF[0], sizeof(adc_packet.data));
// __enable_irq();
// adc_packet.header[0] = 0x55;
// adc_packet.header[1] = 0xAA;
// adc_packet.header[2] = ADC_TIMES;
// adc_packet.header[3] = ADC_CHANELS;
// adc_packet.header[4] = 0x10;
// HAL_UART_Transmit_DMA(&huart6, (uint8_t *)&adc_packet, sizeof(adc_packet));
osDelay(1);
}
}

View File

@@ -54,10 +54,8 @@ void HardwareInitTask(void *argument)
adc_packet.header[0] = 0x55;
adc_packet.header[1] = 0xAA;
adc_packet.header[2] = ADC_TIMES;
adc_packet.header[3] = ADC_CHANELS;
// 填充模式位
adc_packet.header[4] = 0x10;
adc_packet.header[2] = 0x03;
// gate, for current flow route selection, high current by default
Gate_Port_Init();