* @brief Writes the data stored in the flash buffer to the flash memory * * @param page_number Page number to write */
| 58 | * @param page_number Page number to write |
| 59 | */ |
| 60 | void Flash::write_page(uint8_t page_number) |
| 61 | { |
| 62 | // Write one last time if we have an odd number of bytes in the buffer |
| 63 | if(!(flash_index & 0x01)) |
| 64 | fill_page(page_number, 0x00); |
| 65 | |
| 66 | uint8_t old_sreg = SREG; |
| 67 | cli(); |
| 68 | boot_page_write(flash_space + page_number * SPM_PAGESIZE); |
| 69 | boot_spm_busy_wait(); |
| 70 | SREG = old_sreg; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @brief Reads a byte from the flash memory |
nothing calls this directly
no outgoing calls
no test coverage detected