@@ -184,9 +184,7 @@ int SPIFBlockDevice::init()
184
184
185
185
186
186
/* *************************** Parse Basic Parameters Table ***********************************/
187
- if (_sfdp_parse_basic_param_table (callback (this , &SPIFBlockDevice::_spi_send_read_sfdp_command),
188
- _sfdp_info.bptbl .addr ,
189
- _sfdp_info.bptbl .size ) < 0 ) {
187
+ if (_sfdp_parse_basic_param_table (callback (this , &SPIFBlockDevice::_spi_send_read_sfdp_command), _sfdp_info) < 0 ) {
190
188
tr_error (" init - Parse Basic Param Table Failed" );
191
189
status = SPIF_BD_ERROR_PARSING_FAILED;
192
190
goto exit_point;
@@ -624,11 +622,11 @@ spif_bd_error SPIFBlockDevice::_spi_send_general_command(int instruction, bd_add
624
622
/* ********* SFDP Parsing and Detection Functions *********/
625
623
/* ********************************************************/
626
624
int SPIFBlockDevice::_sfdp_parse_basic_param_table (Callback<int (bd_addr_t , void *, bd_size_t )> sfdp_reader,
627
- uint32_t basic_table_addr, size_t basic_table_size )
625
+ mbed::sfdp_hdr_info &sfdp_info )
628
626
{
629
627
uint8_t param_table[SFDP_BASIC_PARAMS_TBL_SIZE]; /* Up To 20 DWORDS = 80 Bytes */
630
628
631
- int status = sfdp_reader (basic_table_addr , param_table, basic_table_size );
629
+ int status = sfdp_reader (sfdp_info. bptbl . addr , param_table, sfdp_info. bptbl . size );
632
630
if (status != SPIF_BD_ERROR_OK) {
633
631
tr_error (" init - Read SFDP First Table Failed" );
634
632
return -1 ;
@@ -655,14 +653,14 @@ int SPIFBlockDevice::_sfdp_parse_basic_param_table(Callback<int(bd_addr_t, void
655
653
_erase_instruction = SPIF_SE;
656
654
657
655
// Set Page Size (SPI write must be done on Page limits)
658
- _page_size_bytes = _sfdp_detect_page_size (param_table, basic_table_size );
656
+ _page_size_bytes = _sfdp_detect_page_size (param_table, sfdp_info. bptbl . size );
659
657
660
658
// Detect and Set Erase Types
661
- _sfdp_detect_erase_types_inst_and_size (param_table, basic_table_size , _erase4k_inst, _sfdp_info .smptbl );
659
+ _sfdp_detect_erase_types_inst_and_size (param_table, sfdp_info. bptbl . size , _erase4k_inst, sfdp_info .smptbl );
662
660
_erase_instruction = _erase4k_inst;
663
661
664
662
// Detect and Set fastest Bus mode (default 1-1-1)
665
- _sfdp_detect_best_bus_read_mode (param_table, basic_table_size , _read_instruction);
663
+ _sfdp_detect_best_bus_read_mode (param_table, sfdp_info. bptbl . size , _read_instruction);
666
664
667
665
return 0 ;
668
666
}
0 commit comments