actually use given address
This commit is contained in:
@@ -58,7 +58,6 @@
|
|||||||
void SystemClock_Config(void);
|
void SystemClock_Config(void);
|
||||||
static void MX_GPIO_Init(void);
|
static void MX_GPIO_Init(void);
|
||||||
|
|
||||||
uint8_t dmx_address;
|
|
||||||
/* USER CODE BEGIN PFP */
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
/* USER CODE END PFP */
|
/* USER CODE END PFP */
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ void do_steps(){
|
|||||||
static uint16_t old_ramp_to_speed;
|
static uint16_t old_ramp_to_speed;
|
||||||
old_ramp_to_speed = steppers[i].ramp_to_speed;
|
old_ramp_to_speed = steppers[i].ramp_to_speed;
|
||||||
|
|
||||||
uint8_t raw_endless = rxBuffer[3*i + DMX_ADDRESS + 2];
|
uint8_t raw_endless = rxBuffer[3*i + dmx_address + 2];
|
||||||
|
|
||||||
/* deadzone on top and bottom */
|
/* deadzone on top and bottom */
|
||||||
if(raw_endless >= 5 && raw_endless <= 250) {
|
if(raw_endless >= 5 && raw_endless <= 250) {
|
||||||
@@ -187,7 +187,7 @@ void do_steps(){
|
|||||||
steppers[i].ramp_to_speed = rotation_speed;
|
steppers[i].ramp_to_speed = rotation_speed;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
int32_t swapped_val = rxBuffer[3*i + DMX_ADDRESS]<<8 | (rxBuffer[3*i+DMX_ADDRESS+1]&0xFF);
|
int32_t swapped_val = rxBuffer[3*i + dmx_address]<<8 | (rxBuffer[3*i+dmx_address+1]&0xFF);
|
||||||
//swapped_val += steppers[i].endless_rot_integrator;
|
//swapped_val += steppers[i].endless_rot_integrator;
|
||||||
int32_t scaled_steps = swapped_val * STEPPER_STEPS_PER_ROTATION / UINT16_MAX;
|
int32_t scaled_steps = swapped_val * STEPPER_STEPS_PER_ROTATION / UINT16_MAX;
|
||||||
steppers[i].ramp_to_speed = scaled_steps - steppers[i].pos;
|
steppers[i].ramp_to_speed = scaled_steps - steppers[i].pos;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
-mthumb
|
-mthumb
|
||||||
-DUSE_HAL_DRIVER
|
-DUSE_HAL_DRIVER
|
||||||
-DSTM32G0B1xx
|
-DSTM32G0B1xx
|
||||||
-DDMX_ADDRESS=2
|
-DDMX_ADDRESS=99
|
||||||
-IInc
|
-IInc
|
||||||
-IDrivers/STM32G0xx_HAL_Driver/Inc
|
-IDrivers/STM32G0xx_HAL_Driver/Inc
|
||||||
-IDrivers/STM32G0xx_HAL_Driver/Inc/Legacy
|
-IDrivers/STM32G0xx_HAL_Driver/Inc/Legacy
|
||||||
|
|||||||
Reference in New Issue
Block a user