* @brief Writes the current content of the RAM buffer to a flash page * * @param flash_page_number page number to write the buffer to */
| 137 | * @param flash_page_number page number to write the buffer to |
| 138 | */ |
| 139 | void Flash::write_page(uint16_t flash_page_number) |
| 140 | { |
| 141 | // For devices with 128kiB or more, and data is stored in far progmem |
| 142 | #ifdef RAMPZ |
| 143 | if(_far_flash_array_addr != 0x0000) |
| 144 | { |
| 145 | urbootPageWrite(_ram_array, (progmem_t)(_far_flash_array_addr + SPM_PAGESIZE * flash_page_number)); |
| 146 | } |
| 147 | // For devices with where flash space is allocated in near progmem, <64kiB |
| 148 | else |
| 149 | #endif |
| 150 | { |
| 151 | urbootPageWrite(_ram_array, (progmem_t)(_flash_array + SPM_PAGESIZE * flash_page_number)); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * @brief Reads a flash page and write its content to the RAM buffer |
nothing calls this directly
no test coverage detected