mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
spi_flash: move buffer check from hal layer to driver layer
Prior to this change, `spi_flash_hal_supports_direct_write` and `spi_flash_hal_supports_direct_read` will check the buffer pointer place, which should be done in driver layer, instead of HAL layer.
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "soc/soc_caps.h"
|
||||
#include "spi_flash_defs.h"
|
||||
@@ -19,6 +11,7 @@
|
||||
#include "esp_log.h"
|
||||
#include "cache_utils.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "esp_memory_utils.h"
|
||||
|
||||
|
||||
#define SPI_FLASH_HAL_MAX_WRITE_BYTES 64
|
||||
@@ -69,6 +62,10 @@ static const spi_flash_host_driver_t esp_flash_gpspi_host = {
|
||||
|
||||
esp_err_t memspi_host_init_pointers(memspi_host_inst_t *host, const memspi_host_config_t *cfg)
|
||||
{
|
||||
if (!esp_ptr_internal(host) && cfg->host_id == SPI1_HOST) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
#if SOC_MEMSPI_IS_INDEPENDENT
|
||||
if (cfg->host_id == SPI1_HOST)
|
||||
host->inst.driver = &esp_flash_default_host;
|
||||
|
||||
Reference in New Issue
Block a user