We don't have an actual EEPROM, so we need to be extra careful about minimizing writes. Instead of writing when a commit is requested, we update a time to actually commit. That way, if we receive multiple requests to commit in that timeframe, we'll hold off until the user is done sending changes. */
| 39 | of writing when a commit is requested, we update a time to actually commit. That way, if we receive multiple requests |
| 40 | to commit in that timeframe, we'll hold off until the user is done sending changes. */ |
| 41 | void FlashPROM::commit() |
| 42 | { |
| 43 | while (is_spin_locked(flashLock)); |
| 44 | if (flashWriteAlarm != 0) |
| 45 | cancel_alarm(flashWriteAlarm); |
| 46 | flashWriteAlarm = add_alarm_in_ms(EEPROM_WRITE_WAIT, writeToFlash, writeCache, true); |
| 47 | } |
| 48 | |
| 49 | void FlashPROM::reset() |
| 50 | { |