Skip to content

Commit 748c342

Browse files
committed
Address Copilot comments
1 parent b2cc0f5 commit 748c342

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
@@ -788,7 +788,7 @@ ifeq ($(TARGET),kinetis_kl26)
788788
OBJS+=\
789789
$(MCUXPRESSO_DRIVERS)/drivers/fsl_clock.o \
790790
$(MCUXPRESSO_DRIVERS)/drivers/fsl_flash.o
791-
ifeq ($(DEBUG_UART),1)
791+
ifneq (,$(filter 1,$(DEBUG_UART) $(UART_FLASH)))
792792
OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_lpsci.o
793793
endif
794794
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
@@ -663,7 +663,7 @@ ifeq ($(TARGET),kinetis_kl26)
663663
$(MCUXPRESSO_DRIVERS)/drivers/fsl_clock.o \
664664
$(MCUXPRESSO_DRIVERS)/drivers/fsl_gpio.o \
665665
$(MCUXPRESSO_DRIVERS)/drivers/fsl_flash.o
666-
ifeq ($(DEBUG_UART),1)
666+
ifneq (,$(filter 1,$(DEBUG_UART) $(UART_FLASH)))
667667
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_lpsci.o
668668
endif
669669
LDFLAGS+=--specs=nosys.specs

0 commit comments

Comments
 (0)