Skip to content

Commit fda8668

Browse files
mattia-moffadanielinux
authored andcommitted
Address Copilot comments
1 parent dc6cfaa commit fda8668

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

arch.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ ifeq ($(TARGET),kinetis_kl26)
799799
OBJS+=\
800800
$(MCUXPRESSO_DRIVERS)/drivers/fsl_clock.o \
801801
$(MCUXPRESSO_DRIVERS)/drivers/fsl_flash.o
802-
ifeq ($(DEBUG_UART),1)
802+
ifneq (,$(filter 1,$(DEBUG_UART) $(UART_FLASH)))
803803
OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_lpsci.o
804804
endif
805805
endif

hal/kinetis_kl26.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int flash_init_done = 0;
3434
/* UART driver forward declarations - implementation at end of file */
3535
int uart_init(uint32_t bitrate, uint8_t data, char parity, uint8_t stop);
3636
int uart_tx(const uint8_t c);
37-
int uart_rx(uint8_t *c, int len);
37+
int uart_rx(uint8_t *c);
3838
#ifdef DEBUG_UART
3939
void uart_write(const char *buf, unsigned int len);
4040
#endif
@@ -161,7 +161,8 @@ int RAMFUNCTION hal_flash_write(uint32_t address, const uint8_t *data, int len)
161161

162162
while (len > 0) {
163163
if ((len < 4) || (address & 0x03)) {
164-
uint8_t aligned_word[4];
164+
uint32_t aligned_word_w;
165+
uint8_t *aligned_word = (uint8_t *)&aligned_word_w;
165166
uint32_t address_align = address & ~0x03U;
166167
uint32_t start_off = address - address_align;
167168
uint32_t i;
@@ -170,7 +171,7 @@ int RAMFUNCTION hal_flash_write(uint32_t address, const uint8_t *data, int len)
170171
aligned_word[i] = data[w++];
171172
if (memcmp(aligned_word, empty_word, 4) != 0) {
172173
if (FLASH_Program(&pflash, address_align,
173-
(uint32_t *)aligned_word, 4)
174+
&aligned_word_w, 4)
174175
!= kStatus_FLASH_Success)
175176
return -1;
176177
}
@@ -257,9 +258,8 @@ int uart_tx(const uint8_t c)
257258
return 1;
258259
}
259260

260-
int uart_rx(uint8_t *c, int len)
261+
int uart_rx(uint8_t *c)
261262
{
262-
(void)len;
263263
if (LPSCI_GetStatusFlags(UART0) & kLPSCI_RxDataRegFullFlag) {
264264
*c = LPSCI_ReadByte(UART0);
265265
return 1;

test-app/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ ifeq ($(TARGET),kinetis_kl26)
671671
$(MCUXPRESSO_DRIVERS)/drivers/fsl_clock.o \
672672
$(MCUXPRESSO_DRIVERS)/drivers/fsl_gpio.o \
673673
$(MCUXPRESSO_DRIVERS)/drivers/fsl_flash.o
674-
ifeq ($(DEBUG_UART),1)
674+
ifneq (,$(filter 1,$(DEBUG_UART) $(UART_FLASH)))
675675
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_lpsci.o
676676
endif
677677
LDFLAGS+=--specs=nosys.specs

0 commit comments

Comments
 (0)