Сделано базовое управление по модбас
- сохранение температур в модбас - чтение параметров датчика - инициализация нового датчика - деинициализация старого датчика Проект связанный с PY32модулем и температурами ПЧ перенесен в отдельную папку
This commit is contained in:
@@ -39,7 +39,7 @@ void MX_IWDG_Init(void)
|
||||
/* USER CODE END IWDG_Init 1 */
|
||||
hiwdg.Instance = IWDG;
|
||||
hiwdg.Init.Prescaler = IWDG_PRESCALER_32;
|
||||
hiwdg.Init.Reload = 100;
|
||||
hiwdg.Init.Reload = 1000;
|
||||
if (HAL_IWDG_Init(&hiwdg) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
#include "tim.h"
|
||||
#include "usart.h"
|
||||
#include "iwdg.h"
|
||||
#include "pch_sensors.h"
|
||||
#include "rs_message.h"
|
||||
#include "PY32module_main.h"
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
@@ -42,6 +41,7 @@ static void APP_SystemClockConfig(void);
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
__HAL_DBGMCU_FREEZE_IWDG();
|
||||
__HAL_DBGMCU_FREEZE_TIM1();
|
||||
__HAL_DBGMCU_FREEZE_TIM14();
|
||||
/* Reset of all peripherals, Initializes the Systick. */
|
||||
@@ -50,32 +50,19 @@ int main(void)
|
||||
/* System clock configuration */
|
||||
APP_SystemClockConfig();
|
||||
|
||||
MX_IWDG_Init();
|
||||
// MX_IWDG_Init();
|
||||
MX_GPIO_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_TIM14_Init();
|
||||
MX_USART1_UART_Init();
|
||||
|
||||
MODBUS_FirstInit();
|
||||
RS_Receive_IT(&hmodbus1, &MODBUS_MSG);
|
||||
|
||||
|
||||
PCHSens_FirstInit();
|
||||
PYModule_FirstInit();
|
||||
/* infinite loop */
|
||||
while (1)
|
||||
{
|
||||
GPIOA->ODR ^= GPIO_LED_2;
|
||||
|
||||
|
||||
PCHSens_Covert(&DallasBus);
|
||||
|
||||
PCHSens_ModuleHandleAction(&module1);
|
||||
PCHSens_ModuleHandleAction(&module2);
|
||||
PCHSens_ModuleHandleAction(&module3);
|
||||
PCHSens_ModuleHandleAction(&module4);
|
||||
PCHSens_ModuleHandleAction(&module5);
|
||||
PCHSens_ModuleHandleAction(&module6);
|
||||
|
||||
PYModule_main();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user