kopia lustrzana https://github.com/micropython/micropython
stmhal: Allow make DEBUG=1 to build
rodzic
8844d031e4
commit
364bb61df3
|
@ -58,14 +58,16 @@ CFLAGS += -DSTM32_HAL_H='<stm32$(MCU_SERIES)xx_hal.h>'
|
||||||
LDFLAGS = -nostdlib -T $(LD_FILE) -Map=$(@:.elf=.map) --cref
|
LDFLAGS = -nostdlib -T $(LD_FILE) -Map=$(@:.elf=.map) --cref
|
||||||
LIBS =
|
LIBS =
|
||||||
|
|
||||||
|
# Remove uncalled code from the final image.
|
||||||
|
CFLAGS += -fdata-sections -ffunction-sections
|
||||||
|
LDFLAGS += --gc-sections
|
||||||
|
|
||||||
# Debugging/Optimization
|
# Debugging/Optimization
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -g -DPENDSV_DEBUG
|
CFLAGS += -g -DPENDSV_DEBUG
|
||||||
COPT = -O0
|
COPT = -O0
|
||||||
else
|
else
|
||||||
CFLAGS += -fdata-sections -ffunction-sections
|
|
||||||
COPT += -Os -DNDEBUG
|
COPT += -Os -DNDEBUG
|
||||||
LDFLAGS += --gc-sections
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# uncomment this if you want libgcc
|
# uncomment this if you want libgcc
|
||||||
|
|
|
@ -115,7 +115,7 @@ void uart_deinit(void) {
|
||||||
STATIC bool uart_init2(pyb_uart_obj_t *uart_obj) {
|
STATIC bool uart_init2(pyb_uart_obj_t *uart_obj) {
|
||||||
USART_TypeDef *UARTx;
|
USART_TypeDef *UARTx;
|
||||||
IRQn_Type irqn;
|
IRQn_Type irqn;
|
||||||
uint32_t GPIO_Pin, GPIO_Pin2;
|
uint32_t GPIO_Pin, GPIO_Pin2 = 0;
|
||||||
uint8_t GPIO_AF_UARTx = 0;
|
uint8_t GPIO_AF_UARTx = 0;
|
||||||
GPIO_TypeDef* GPIO_Port = NULL;
|
GPIO_TypeDef* GPIO_Port = NULL;
|
||||||
GPIO_TypeDef* GPIO_Port2 = NULL;
|
GPIO_TypeDef* GPIO_Port2 = NULL;
|
||||||
|
|
Ładowanie…
Reference in New Issue