mirror of
https://github.com/eddyem/stm32samples.git
synced 2025-12-06 02:35:23 +03:00
F0 blink -flto
This commit is contained in:
parent
e98aa11f72
commit
491d930b0c
@ -44,7 +44,7 @@ DEPS := $(OBJS:.o=.d)
|
|||||||
|
|
||||||
INC_DIR ?= ../inc
|
INC_DIR ?= ../inc
|
||||||
|
|
||||||
INCLUDE := -I$(INC_DIR)/F0 -I$(INC_DIR)/cm
|
INCLUDE := -I$(INC_DIR)/Fx -I$(INC_DIR)/cm
|
||||||
LIB_DIR := $(INC_DIR)/ld
|
LIB_DIR := $(INC_DIR)/ld
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -53,12 +53,11 @@ CFLAGS += -O2 -g -MD -D__thumb2__=1
|
|||||||
CFLAGS += -Wall -Werror -Wextra -Wshadow -Wimplicit-function-declaration
|
CFLAGS += -Wall -Werror -Wextra -Wshadow -Wimplicit-function-declaration
|
||||||
CFLAGS += -Wredundant-decls $(INCLUDE)
|
CFLAGS += -Wredundant-decls $(INCLUDE)
|
||||||
# -Wmissing-prototypes -Wstrict-prototypes
|
# -Wmissing-prototypes -Wstrict-prototypes
|
||||||
CFLAGS += -fno-common -ffunction-sections -fdata-sections
|
CFLAGS += -fno-common -ffunction-sections -fdata-sections -flto
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Linker flags
|
# Linker flags
|
||||||
LDFLAGS += --static -nostartfiles
|
LDFLAGS += --static -nostartfiles -flto --specs=nano.specs
|
||||||
#--specs=nano.specs
|
|
||||||
LDFLAGS += -L$(LIB_DIR)
|
LDFLAGS += -L$(LIB_DIR)
|
||||||
LDFLAGS += -T$(LDSCRIPT)
|
LDFLAGS += -T$(LDSCRIPT)
|
||||||
LDFLAGS += -Wl,-Map=$(OBJDIR)/$(BINARY).map
|
LDFLAGS += -Wl,-Map=$(OBJDIR)/$(BINARY).map
|
||||||
|
|||||||
BIN
F0:F030,F042,F072/blink/blink.bin
Normal file → Executable file
BIN
F0:F030,F042,F072/blink/blink.bin
Normal file → Executable file
Binary file not shown.
@ -19,7 +19,7 @@
|
|||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stm32f0.h"
|
#include <stm32f0.h>
|
||||||
|
|
||||||
static volatile uint32_t blink_ctr = 0;
|
static volatile uint32_t blink_ctr = 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user