MCPcopy Create free account
hub / github.com/OpenStickCommunity/GP2040-CE / commit

Method commit

lib/FlashPROM/src/FlashPROM.cpp:41–47  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

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. */
41void 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
49void FlashPROM::reset()
50{

Callers 1

saveMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected