Temperature limit bug fix, removed compilation warnings (requires modifying stm32f4xx.h in chibios)

This commit is contained in:
Benjamin Vedder 2014-12-06 23:36:36 +01:00
parent 42cab4c18d
commit a4072fc108
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99
USE_OPT += -DSTM32F40_41xxx -DBOARD_OTG_NOVBUSSENS
USE_OPT += -DBOARD_OTG_NOVBUSSENS
endif
# C specific options here (added to USE_OPT).

View File

@ -155,7 +155,7 @@ static void update_override_limits(volatile mc_configuration *conf);
#define IS_DETECTING() (state == MC_STATE_DETECTING)
// Threads
static WORKING_AREA(timer_thread_wa, 1024);
static WORKING_AREA(timer_thread_wa, 2048);
static msg_t timer_thread(void *arg);
static WORKING_AREA(rpm_thread_wa, 1024);
static msg_t rpm_thread(void *arg);
@ -540,7 +540,7 @@ static void update_override_limits(volatile mc_configuration *conf) {
maxc = fabsf(conf->l_current_min);
}
maxc = utils_map(temp, conf->l_temp_fet_start, temp > conf->l_temp_fet_end, maxc, conf->cc_min_current);
maxc = utils_map(temp, conf->l_temp_fet_start, conf->l_temp_fet_end, maxc, 0.0);
if (fabsf(conf->l_current_max) > maxc) {
conf->lo_current_max = SIGN(conf->l_current_max) * maxc;