@@ -34,7 +34,7 @@ static int flash_init_done = 0;
3434/* UART driver forward declarations - implementation at end of file */
3535int uart_init (uint32_t bitrate , uint8_t data , char parity , uint8_t stop );
3636int 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
3939void 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 ;
0 commit comments