diff --git a/.cproject b/.cproject
index c77a126..35a013f 100644
--- a/.cproject
+++ b/.cproject
@@ -22,11 +22,12 @@
+
-
-
+
@@ -53,7 +54,7 @@
-
+
@@ -94,25 +95,26 @@
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
-
-
-
+
+
-
-
-
+
+
-
+
@@ -167,4 +169,5 @@
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 64a048a..c4772a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
.settings/
Debug/
Release/
-cross_motor.pdf
-cross_motor.txt
-*.bak
\ No newline at end of file
+*.bak
+*.launch
\ No newline at end of file
diff --git a/Core/Inc/board_logic.h b/Core/Inc/board_logic.h
index 554c073..da68813 100644
--- a/Core/Inc/board_logic.h
+++ b/Core/Inc/board_logic.h
@@ -12,6 +12,10 @@
#define REL_MAIN_BIT (1u<<0)
#define REL_AUX_BIT (1u<<1)
+#define MOTOR_MIN 0
+#define MOTOR_MAX 255
+
+
void loop_iterate();
diff --git a/Core/Inc/modbus_logic.h b/Core/Inc/modbus_logic.h
index 0dbc9ba..6360408 100644
--- a/Core/Inc/modbus_logic.h
+++ b/Core/Inc/modbus_logic.h
@@ -1,7 +1,7 @@
/*
* user_modbus.h
*
- * Created on: 13 ìàð. 2019 ã.
+ * Created on: 13 ���. 2019 �.
*/
#ifndef MODBUS_LOGIC_H_
@@ -9,9 +9,11 @@
#include
#define BOARD_ADRESS 34 //Relay Module 1
+#define BOARD_ADRESS_Panel 32 //Relay Module 1
+#define BOARD_ADRESS_DAC 36 //DAC module 1
//#define BOARD_ADRESS 35 //Relay Module 2
-#define BUS_IDLE_TIME 3
+#define BUS_IDLE_TIME 15
#define MODBUS_PROTOCOL_VERSION (1)
#define MODBUS_HEADER_SIZE (13)
diff --git a/Core/Src/board_logic.c b/Core/Src/board_logic.c
index 6205230..4fa9742 100644
--- a/Core/Src/board_logic.c
+++ b/Core/Src/board_logic.c
@@ -12,6 +12,7 @@
#define BOARD_DESC_LEN (23)
+extern TIM_HandleTypeDef htim3;
static const char board_description[BOARD_DESC_LEN] = "RS485 Relay Module v1";
extern uint16_t tranfer_errors_count;
extern uint16_t last_rx_time;
@@ -56,17 +57,9 @@ void loop_iterate()
REL_AUX_OFF;
LED_AUX_OFF;
}
- /*
- if(motor_pwm>MOTOR_MAX)motor_pwm=MOTOR_MAX;
- if(motor_pwmMOTOR_MAX)motor_pwm=MOTOR_MAX;
+ if(motor_pwm=BUS_IDLE_TIME)
- {
+ {
cmd_receiving = RECV_IDLE;
+ // memset(&recv_buffer[0],0,BUFFERS_SIZE);
//TXEN_485 = 1;
//delay_us(10);
//TXEN_485 = 0;
- }
+ }
}
if (cmd_receiving == RECV_IDLE)
{
diff --git a/Core/Src/stm32f0xx_hal_msp.c b/Core/Src/stm32f0xx_hal_msp.c
index bb19b14..9e50fba 100644
--- a/Core/Src/stm32f0xx_hal_msp.c
+++ b/Core/Src/stm32f0xx_hal_msp.c
@@ -94,9 +94,9 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
/* Peripheral clock enable */
__HAL_RCC_TIM1_CLK_ENABLE();
/* TIM1 interrupt Init */
- HAL_NVIC_SetPriority(TIM1_BRK_UP_TRG_COM_IRQn, 0, 0);
- HAL_NVIC_EnableIRQ(TIM1_BRK_UP_TRG_COM_IRQn);
- HAL_NVIC_SetPriority(TIM1_CC_IRQn, 0, 0);
+ HAL_NVIC_SetPriority(TIM1_BRK_UP_TRG_COM_IRQn, 2, 0);
+ HAL_NVIC_EnableIRQ(TIM1_BRK_UP_TRG_COM_IRQn);
+ HAL_NVIC_SetPriority(TIM1_CC_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(TIM1_CC_IRQn);
/* USER CODE BEGIN TIM1_MspInit 1 */
diff --git a/Relay_RS485 Debug.launch b/Relay_RS485 Debug.launch
index 3cf8a3a..ac2777c 100644
--- a/Relay_RS485 Debug.launch
+++ b/Relay_RS485 Debug.launch
@@ -1,5 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -9,14 +24,14 @@
-
+
-
-
+
+
@@ -49,9 +64,9 @@
-
+
-
+