diff --git a/features/nfc/nfc/NFCEEPROMDriver.h b/features/nfc/nfc/NFCEEPROMDriver.h index 0b5a75c824..b1fbd00e89 100644 --- a/features/nfc/nfc/NFCEEPROMDriver.h +++ b/features/nfc/nfc/NFCEEPROMDriver.h @@ -131,7 +131,7 @@ public: /** * Get the maximum memory size addressable by the EEPROM. */ - virtual size_t get_max_size() = 0; + virtual size_t read_max_size() = 0; /** * Start a session of operations (reads, writes, erases, size gets/sets). @@ -139,7 +139,7 @@ public: * to disable the RF interface or abort the transaction if it's being used. * This method should complete asynchronously by calling has_started_session(). */ - virtual void start_session() = 0; // This could lock the chip's RF interface + virtual void start_session(bool force = true) = 0; // This could lock the chip's RF interface /** * End a session. diff --git a/features/nfc/source/nfc/NFCEEPROM.cpp b/features/nfc/source/nfc/NFCEEPROM.cpp index 32ce0167e4..6106c3b879 100644 --- a/features/nfc/source/nfc/NFCEEPROM.cpp +++ b/features/nfc/source/nfc/NFCEEPROM.cpp @@ -61,7 +61,7 @@ void NFCEEPROM::write_ndef_message() ac_buffer_dup(&_ndef_buffer_reader, ac_buffer_builder_buffer(ndef_msg_buffer_builder(ndef_message()))); // Check that NDEF message is not too big - if (ac_buffer_reader_readable(&_ndef_buffer_reader) > _driver->get_max_size()) { + if (ac_buffer_reader_readable(&_ndef_buffer_reader) > _driver->read_max_size()) { handle_error(NFC_ERR_BUFFER_TOO_SMALL); return; } @@ -158,7 +158,7 @@ void NFCEEPROM::on_session_started(bool success) } _current_op = nfc_eeprom_erase_write_max_size; - _driver->write_size(_driver->get_max_size()); + _driver->write_size(_driver->read_max_size()); break; default: @@ -379,9 +379,9 @@ void NFCEEPROM::continue_write() void NFCEEPROM::continue_erase() { - if (_eeprom_address < _driver->get_max_size()) { + if (_eeprom_address < _driver->read_max_size()) { // Continue erasing - _driver->erase_bytes(_eeprom_address, _driver->get_max_size() - _eeprom_address); + _driver->erase_bytes(_eeprom_address, _driver->read_max_size() - _eeprom_address); } else { // Now update size _current_op = nfc_eeprom_erase_write_0_size;