rename flash_ to flash_nrf5x_
This commit is contained in:
		| @@ -47,7 +47,7 @@ | ||||
| static uint32_t _fl_addr = FLASH_CACHE_INVALID_ADDR; | ||||
| static uint8_t _fl_buf[FLASH_PAGE_SIZE] __attribute__((aligned(4))); | ||||
|  | ||||
| void flash_flush(void) | ||||
| void flash_nrf5x_flush(void) | ||||
| { | ||||
|   if ( _fl_addr == FLASH_CACHE_INVALID_ADDR ) return; | ||||
|  | ||||
| @@ -64,20 +64,20 @@ void flash_flush(void) | ||||
|   _fl_addr = FLASH_CACHE_INVALID_ADDR; | ||||
| } | ||||
|  | ||||
| void flash_write (uint32_t dst, void const *src, int len) | ||||
| void flash_nrf5x_write (uint32_t dst, void const *src, int len) | ||||
| { | ||||
|   uint32_t newAddr = dst & ~(FLASH_PAGE_SIZE - 1); | ||||
|  | ||||
|   if ( newAddr != _fl_addr ) | ||||
|   { | ||||
|     flash_flush(); | ||||
|     flash_nrf5x_flush(); | ||||
|     _fl_addr = newAddr; | ||||
|     memcpy(_fl_buf, (void *) newAddr, FLASH_PAGE_SIZE); | ||||
|   } | ||||
|   memcpy(_fl_buf + (dst & (FLASH_PAGE_SIZE - 1)), src, len); | ||||
| } | ||||
|  | ||||
| void flash_erase(uint32_t addr, uint32_t bytes) | ||||
| void flash_nrf5x_erase(uint32_t addr, uint32_t bytes) | ||||
| { | ||||
|   uint32_t page_count = bytes/FLASH_PAGE_SIZE; | ||||
|   if ( bytes%FLASH_PAGE_SIZE ) page_count++; | ||||
|   | ||||
| @@ -47,8 +47,8 @@ | ||||
| #endif | ||||
|  | ||||
| //void flash_erase(uint32_t page_addr); | ||||
| void flash_write (uint32_t dst, void const *src, int len); | ||||
| void flash_flush(void); | ||||
| void flash_nrf5x_write (uint32_t dst, void const *src, int len); | ||||
| void flash_nrf5x_flush(void); | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  } | ||||
|   | ||||
| @@ -287,7 +287,7 @@ int write_block(uint32_t block_no, uint8_t *data, bool quiet/*, WriteState *stat | ||||
|           led_blink_fast(true); | ||||
|         } | ||||
|      | ||||
|         flash_write(bl->targetAddr, bl->data, bl->payloadSize); | ||||
|         flash_nrf5x_write(bl->targetAddr, bl->data, bl->payloadSize); | ||||
|     } | ||||
|  | ||||
|     if (state && bl->numBlocks) { | ||||
| @@ -307,7 +307,7 @@ int write_block(uint32_t block_no, uint8_t *data, bool quiet/*, WriteState *stat | ||||
|             } | ||||
|             if (state->numWritten >= state->numBlocks) { | ||||
|                 // flush last blocks | ||||
|                 flash_flush(); | ||||
|                 flash_nrf5x_flush(); | ||||
|  | ||||
|                 uf2_write_complete(state->numBlocks); | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user