* @brief Writes the current content of the RAM buffer to anywhere in flash. * Will need to read, modify & write. * * @param flash_start_address address to start writing to * @param length number of bytes to write * @param ram_buffer_start_address optional start address for the data * that's being written to flash */
| 116 | * that's being written to flash |
| 117 | */ |
| 118 | void Flash::write(uint16_t flash_start_address, uint16_t length, uint16_t ram_buffer_start_address) |
| 119 | { |
| 120 | // For devices with 128kiB or more, and data is stored in far progmem |
| 121 | #ifdef RAMPZ |
| 122 | if(_far_flash_array_addr != 0x0000) |
| 123 | { |
| 124 | urflashWrite(_ram_array + ram_buffer_start_address, (uintpgm_t)_far_flash_array_addr + flash_start_address, length); |
| 125 | } |
| 126 | // For devices with where flash space is allocated in near progmem, <64kiB |
| 127 | else |
| 128 | #endif |
| 129 | { |
| 130 | urflashWrite(_ram_array + ram_buffer_start_address, (uintpgm_t)_flash_array + flash_start_address, length); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * @brief Writes the current content of the RAM buffer to a flash page |
nothing calls this directly
no test coverage detected