File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,16 @@ CFLAGS += -DSTM32_HAL_H='<stm32$(MCU_SERIES)xx_hal.h>'
5858LDFLAGS = -nostdlib -T $(LD_FILE ) -Map=$(@:.elf=.map ) --cref
5959LIBS =
6060
61+ # Remove uncalled code from the final image.
62+ CFLAGS += -fdata-sections -ffunction-sections
63+ LDFLAGS += --gc-sections
64+
6165# Debugging/Optimization
6266ifeq ($(DEBUG ) , 1)
6367CFLAGS += -g -DPENDSV_DEBUG
6468COPT = -O0
6569else
66- CFLAGS += -fdata-sections -ffunction-sections
6770COPT += -Os -DNDEBUG
68- LDFLAGS += --gc-sections
6971endif
7072
7173# uncomment this if you want libgcc
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ void uart_deinit(void) {
115115STATIC bool uart_init2 (pyb_uart_obj_t * uart_obj ) {
116116 USART_TypeDef * UARTx ;
117117 IRQn_Type irqn ;
118- uint32_t GPIO_Pin , GPIO_Pin2 ;
118+ uint32_t GPIO_Pin , GPIO_Pin2 = 0 ;
119119 uint8_t GPIO_AF_UARTx = 0 ;
120120 GPIO_TypeDef * GPIO_Port = NULL ;
121121 GPIO_TypeDef * GPIO_Port2 = NULL ;
You can’t perform that action at this time.
0 commit comments