I'm developing a project using an STM32 Nucleo board. At the core of this project is a UART-based communication protocol running in interrupt (IT) mode — not polling or DMA. This protocol is responsible for controlling multiple subsystems such as a relay module and a fan speed controller.
However, most of these subsystem modules were previously written in polling mode.
My question is: Can I integrate these polling-based modules into my current UART IT-mode communication system without causing issues? Or should I consider converting them to interrupt or DMA mode to prevent CPU blocking or communication delays?
Additionally: What should I watch out for to ensure the CPU doesn't get blocked and UART interrupts don't get delayed in this mixed-mode setup?
Extra context: There are 20 NTC temperature sensors in the system, and temperature from all of them is read once every second using ADC. The highest temperature value is selected and stored in a variable. Based on this value, the fan speed is adjusted accordingly.
Note: The polling-based modules do not contain any infinite loops like while(1) or other blocking code. For example, the ntc reader and fan control logic looks like:
NTC_Read_Temperatures(temps);
HAL_Delay(1000);
if(max_temp == 54.23f ){
speed_of_fan = mode_2;
hal_delay(1);
}