Update HAL version, board description, version number to 10.0

This commit is contained in:
Anton Mukhin
2023-11-22 10:43:10 +03:00
parent 65ca64389e
commit 89ced0fc11
65 changed files with 21574 additions and 1608 deletions

View File

@@ -13,7 +13,7 @@
#define BOARD_DESC_LEN (23)
extern TIM_HandleTypeDef htim3;
static const char board_description[BOARD_DESC_LEN] = "RS485 Relay Module v1";
static const char board_description[BOARD_DESC_LEN] = "RS485_Relay V1R1";
extern uint16_t tranfer_errors_count;
extern uint16_t last_rx_time;
@@ -141,22 +141,24 @@ uint8_t write_register(uint16_t address, uint16_t value)
#ifdef UART_DEBUG
printf("Write A=0x%X D=0x%X\n\r",address,value);
#endif
switch (address)
{
case 0x2001: relays = value; break;
case 0x2002: motor_pwm = value;
if(motor_pwm>MOTOR_MAX)motor_pwm=MOTOR_MAX;
if(motor_pwm<MOTOR_MIN)motor_pwm=MOTOR_MIN;
if(motor_pwm==0)
HAL_TIM_PWM_Stop(&htim3, TIM_CHANNEL_1);
else
{
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
__HAL_TIM_SetCompare(&htim3, TIM_CHANNEL_1, motor_pwm);
HAL_Delay(5);
}
break;
default: ret = 1;
switch (address) {
case 0x2001:
relays = value;
break;
case 0x2002:
motor_pwm = value;
if(motor_pwm>MOTOR_MAX)motor_pwm=MOTOR_MAX;
if(motor_pwm<MOTOR_MIN)motor_pwm=MOTOR_MIN;
if(motor_pwm==0)
HAL_TIM_PWM_Stop(&htim3, TIM_CHANNEL_1);
else {
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
__HAL_TIM_SetCompare(&htim3, TIM_CHANNEL_1, motor_pwm);
HAL_Delay(5);
}
break;
default:
ret = 1;
}
return ret;
}