ADD: support for chinese nunchuck

This commit is contained in:
Niklas Fauth
2018-05-06 20:11:53 +02:00
parent 5326e558ae
commit 7337a8ae7e
5 changed files with 424 additions and 424 deletions

View File

@@ -175,7 +175,7 @@ void DMA1_Channel1_IRQHandler() {
if(ABS((adc_buffer.dcl - offsetdcl) * MOTOR_AMP_CONV_DC_AMP) > DC_CUR_LIMIT || timeout > 50 || enable == 0) {
if(ABS((adc_buffer.dcl - offsetdcl) * MOTOR_AMP_CONV_DC_AMP) > DC_CUR_LIMIT || timeout > TIMEOUT || enable == 0) {
LEFT_TIM->BDTR &= ~TIM_BDTR_MOE;
//HAL_GPIO_WritePin(LED_PORT, LED_PIN, 1);
} else {
@@ -183,7 +183,7 @@ void DMA1_Channel1_IRQHandler() {
//HAL_GPIO_WritePin(LED_PORT, LED_PIN, 0);
}
if(ABS((adc_buffer.dcr - offsetdcr) * MOTOR_AMP_CONV_DC_AMP) > DC_CUR_LIMIT || timeout > 50 || enable == 0) {
if(ABS((adc_buffer.dcr - offsetdcr) * MOTOR_AMP_CONV_DC_AMP) > DC_CUR_LIMIT || timeout > TIMEOUT || enable == 0) {
RIGHT_TIM->BDTR &= ~TIM_BDTR_MOE;
} else {
RIGHT_TIM->BDTR |= TIM_BDTR_MOE;