]> Git Repo - esp-hosted.git/blobdiff - esp/esp_driver/network_adapter/main/spi_slave_api.c
Merge branch 'spi_slace_c3' into 'master'
[esp-hosted.git] / esp / esp_driver / network_adapter / main / spi_slave_api.c
index 0f7b11b5025c582b24ed3406de672d2d0d0c5ad3..cdc91ab7e2eaf204dca825d87310acdc07eb92fc 100644 (file)
@@ -163,8 +163,7 @@ static int is_valid_trans_buffer(uint8_t *trans_buf)
        len = le16toh(header->len);
        offset = le16toh(header->offset);
 
-       if (!len || (len > SPI_BUFFER_SIZE) ||
-            (offset != sizeof(struct esp_payload_header))) {
+       if (!len || (len > SPI_BUFFER_SIZE)) {
                return pdFALSE;
        }
 
@@ -269,7 +268,7 @@ static int process_spi_rx(interface_buffer_handle_t *buf_handle)
        len = le16toh(header->len);
        offset = le16toh(header->offset);
 
-       if (!len || (len > SPI_BUFFER_SIZE) || (offset != sizeof(struct esp_payload_header))) {
+       if (!len || (len > SPI_BUFFER_SIZE)) {
                return -1;
        }
 
@@ -277,7 +276,7 @@ static int process_spi_rx(interface_buffer_handle_t *buf_handle)
        buf_handle->if_type = header->if_type;
        buf_handle->if_num = header->if_num;
        buf_handle->free_buf_handle = esp_spi_read_done;
-       buf_handle->payload_len = le16toh(header->len) + sizeof(struct esp_payload_header);
+       buf_handle->payload_len = le16toh(header->len) + offset;
        buf_handle->priv_buffer_handle = buf_handle->payload;
 
        ret = xQueueSend(spi_rx_queue, buf_handle, portMAX_DELAY);
This page took 0.024005 seconds and 4 git commands to generate.