feat: speed up PRTS LCD refresh

This commit is contained in:
TuxMonkey
2026-07-20 23:34:13 +08:00
parent b2169513e1
commit 8671f84139
14 changed files with 2296 additions and 98 deletions

View File

@@ -78,7 +78,7 @@ void MX_ADC1_Init(void)
*/
sConfig.Channel = ADC_CHANNEL_4;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5;
sConfig.SamplingTime = ADC_SAMPLETIME_64CYCLES_5;
sConfig.SingleDiff = ADC_SINGLE_ENDED;
sConfig.OffsetNumber = ADC_OFFSET_NONE;
sConfig.Offset = 0;
@@ -90,7 +90,9 @@ void MX_ADC1_Init(void)
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_19;
sConfig.Rank = ADC_REGULAR_RANK_2;
sConfig.SamplingTime = ADC_SAMPLETIME_64CYCLES_5;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();

View File

@@ -48,7 +48,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
#define PRTS_STATUS_UPDATE_PERIOD_MS 50U
#define PRTS_TASK_SLEEP_CAP_MS 2U
#define PRTS_TASK_SLEEP_CAP_MS 1U
/* USER CODE END PD */
@@ -169,7 +169,7 @@ const osThreadAttr_t prts_attributes = {
.cb_size = sizeof(prtsTaskControlBlock),
.stack_mem = prtsTaskStack,
.stack_size = sizeof(prtsTaskStack),
.priority = osPriorityBelowNormal
.priority = osPriorityNormal
};
osThreadId_t prtsHandle;
void StartPRTSTask(void *argument);

View File

@@ -49,7 +49,7 @@ void MX_SPI1_Init(void)
hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
hspi1.Init.NSS = SPI_NSS_SOFT;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;