mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_variable_on_stack_bug_in_seg_slave_example' into 'master'
spi_slave_hd: fix stack variable bug in seg_slave example Closes IDFGH-5420 See merge request espressif/esp-idf!16356
This commit is contained in:
commit
44d7b3a636
@ -290,14 +290,14 @@ void app_main(void)
|
||||
uint8_t init_value[SOC_SPI_MAXIMUM_BUFFER_SIZE] = {0x0};
|
||||
spi_slave_hd_write_buffer(SLAVE_HOST, 0, init_value, SOC_SPI_MAXIMUM_BUFFER_SIZE);
|
||||
|
||||
uint32_t send_buf_size = 5000;
|
||||
spi_slave_hd_write_buffer(SLAVE_HOST, SLAVE_MAX_TX_BUF_LEN_REG, (uint8_t *)&send_buf_size, 4);
|
||||
static uint32_t send_buf_size = 5000;
|
||||
spi_slave_hd_write_buffer(SLAVE_HOST, SLAVE_MAX_TX_BUF_LEN_REG, (uint8_t *)&send_buf_size, sizeof(send_buf_size));
|
||||
|
||||
uint32_t recv_buf_size = 120;
|
||||
spi_slave_hd_write_buffer(SLAVE_HOST, SLAVE_MAX_RX_BUF_LEN_REG, (uint8_t *)&recv_buf_size, 4);
|
||||
static uint32_t recv_buf_size = 120;
|
||||
spi_slave_hd_write_buffer(SLAVE_HOST, SLAVE_MAX_RX_BUF_LEN_REG, (uint8_t *)&recv_buf_size, sizeof(recv_buf_size));
|
||||
|
||||
uint32_t slave_ready_flag = SLAVE_READY_FLAG;
|
||||
spi_slave_hd_write_buffer(SLAVE_HOST, SLAVE_READY_FLAG_REG, (uint8_t *)&slave_ready_flag, 4);
|
||||
spi_slave_hd_write_buffer(SLAVE_HOST, SLAVE_READY_FLAG_REG, (uint8_t *)&slave_ready_flag, sizeof(slave_ready_flag));
|
||||
|
||||
xTaskCreate(sender, "sendTask", 4096, &send_buf_size, 1, NULL);
|
||||
xTaskCreate(receiver, "recvTask", 4096, &recv_buf_size, 1, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user