mirror of https://github.com/rusefi/bldc.git
minor changes
This commit is contained in:
parent
22e1e30354
commit
a3cc6cc089
|
@ -157,7 +157,7 @@ void hw_setup_adc_channels(void) {
|
|||
ADC_InjectedChannelConfig(ADC3, ADC_Channel_12, 3, ADC_SampleTime_15Cycles);
|
||||
|
||||
|
||||
if (!dac_thread_running) {
|
||||
if (!dac_thread_running && conf->controller_id == 7) {
|
||||
chThdCreateStatic(dac_thread_wa, sizeof(dac_thread_wa), NORMALPRIO, dac_thread, NULL);
|
||||
dac_thread_running = true;
|
||||
}
|
||||
|
@ -265,6 +265,9 @@ THD_FUNCTION(dac_thread, arg) {
|
|||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);
|
||||
DAC->CR |= DAC_CR_EN2;
|
||||
|
||||
|
||||
|
||||
|
||||
const float current_scaling_factor = MAX_CURRENT_SUM / 4096;
|
||||
|
||||
float current_sum = 0;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
|
||||
#include "drv8323s.h"
|
||||
/*
|
||||
Copyright 2019 Benjamin Vedder benjamin@vedder.se
|
||||
|
||||
|
@ -20,6 +22,8 @@
|
|||
#ifndef HW_UXV_SR_H_
|
||||
#define HW_UXV_SR_H_
|
||||
|
||||
#include "drv8323s.h"
|
||||
|
||||
#define HW_NAME "UXV_SR"
|
||||
|
||||
// HW properties
|
||||
|
@ -137,8 +141,6 @@
|
|||
|
||||
// ICU Peripheral for servo decoding
|
||||
#define HW_USE_SERVO_TIM4
|
||||
#define HW_ICU_TIMER TIM4
|
||||
#define HW_ICU_TIM_CLK_EN() RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE)
|
||||
#define HW_ICU_DEV ICUD4
|
||||
#define HW_ICU_CHANNEL ICU_CHANNEL_1
|
||||
#define HW_ICU_GPIO_AF GPIO_AF_TIM4
|
||||
|
|
Loading…
Reference in New Issue