diff --git a/src/Makefile b/src/Makefile index f98b5fc34..7297642b4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -649,7 +649,6 @@ endif # -adhlns...: create assembler listing CPPFLAGS = -g$(DBGFMT) CPPFLAGS += $(CPPDEFS) -CPPFLAGS += -O$(OPT) CPPFLAGS += -Wall CPPFLAGS += -fno-exceptions CPPFLAGS += -Wno-strict-aliasing @@ -696,8 +695,8 @@ MSG_CLEANING = Cleaning project: # Combine all necessary flags and optional flags. # Add target processor to flags. -ARMCPPFLAGS = -c -mcpu=$(MCU) -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=open9x.lst -Dat91sam3s4 -DRUN_FROM_FLASH=1 $(CPPFLAGS) $(GENDEPFLAGS) -AVRCPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) -fwhole-program +ARMCPPFLAGS = -c -mcpu=$(MCU) -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=open9x.lst -Dat91sam3s4 -DRUN_FROM_FLASH=1 -O$(OPT) $(CPPFLAGS) $(GENDEPFLAGS) +AVRCPPFLAGS = -mmcu=$(MCU) -I. -x c++ -O$(OPT) $(CPPFLAGS) $(GENDEPFLAGS) -fwhole-program ifneq ($(PCB), SKY9X) GCCVERSIONGTE462 := $(shell expr 4.6.2 \<= `$(CC) -dumpversion`) diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 57e27004b..1d211da94 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -1283,7 +1283,7 @@ bool moveCurve(uint8_t index, int8_t shift, int8_t custom=0) } int8_t *nextCrv = curveaddress(index+1); - memmove(nextCrv+shift, nextCrv, 5*(MAX_CURVES-index-1)+g_model.curves[MAX_CURVES-1]); + memmove(nextCrv+shift, nextCrv, 5*(MAX_CURVES-index-1)+g_model.curves[MAX_CURVES-1]-g_model.curves[index]); if (shift < 0) memclear(&g_model.points[NUM_POINTS-1] + shift, -shift); while (index