diff --git a/Makefile b/Makefile index 501d3d42..dbf97c86 100644 --- a/Makefile +++ b/Makefile @@ -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). diff --git a/mcpwm.c b/mcpwm.c index c070a5da..fa0a8370 100644 --- a/mcpwm.c +++ b/mcpwm.c @@ -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;