MCPcopy Create free account
hub / github.com/MCUdude/MicroCore / write_page

Method write_page

avr/libraries/Flash/src/Flash.cpp:60–71  ·  view source on GitHub ↗

* @brief Writes the data stored in the flash buffer to the flash memory * * @param page_number Page number to write */

Source from the content-addressed store, hash-verified

58 * @param page_number Page number to write
59 */
60void 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected