在初始化ST7789并口驱动时,一直卡死了在了队列接收中:ESP_LOGI("i2s_write_data","xQueueReceive start1") 和ESP_LOGI("i2s_write_data","xQueueReceive end1")之间的 xQueueReceive(i2s_lcd_obj->event_queue, (void *)&event, portMAX_DELAY)中
代码如下:
static void i2s_write_data(i2s_lcd_obj_t *i2s_lcd_obj, uint8_t *data, size_t len)
{
int event = 0;
int x = 0, y = 0, left = 0, cnt = 0;
if (len <= 0) {
ESP_LOGE(TAG, "wrong len!");
return;
}
lcd_dma_set_int(i2s_lcd_obj);
uint32_t half_buffer_size = i2s_lcd_obj->dma_half_buffer_size;
cnt = len / half_buffer_size;
// Start signal
xQueueSend(i2s_lcd_obj->event_queue, &event, 0);
// Process a complete piece of data, ping-pong operation
for (x = 0; x < cnt; x++) {
uint8_t *out = (uint8_t*)i2s_lcd_obj->dma[(x % 2) * i2s_lcd_obj->dma_half_node_cnt].buf;
uint8_t *in = data;
if (i2s_lcd_obj->swap_data) {
uint8_t *out1 = out + 1;
uint8_t *in1 = in + 1;
for (y = 0; y < half_buffer_size;) {
out1[y] = in[y];
out[y] = in1[y];
y += 2;
out1[y] = in[y];
out[y] = in1[y];
y += 2;
}
} else {
memcpy(out, in, half_buffer_size);
}
data += half_buffer_size;
xQueueReceive(i2s_lcd_obj->event_queue, (void *)&event, portMAX_DELAY);
lcd_i2s_start(i2s_lcd_obj->i2s_dev, ((uint32_t)&i2s_lcd_obj->dma[(x % 2) * i2s_lcd_obj->dma_half_node_cnt]) & 0xfffff, half_buffer_size);
}
left = len % half_buffer_size;
// Process remaining incomplete segment data
if (left) {
uint8_t *out = (uint8_t*)i2s_lcd_obj->dma[(x % 2) * i2s_lcd_obj->dma_half_node_cnt].buf;
uint8_t *in = data;
cnt = left - left % 2;
if (cnt) {
if (i2s_lcd_obj->swap_data) {
for (y = 0; y < cnt; y+=2) {
out[y+1] = in[y+0];
out[y+0] = in[y+1];
}
} else {
memcpy(out, in, cnt);
}
}
if (left % 2) {
out[cnt] = in[cnt];
}
lcd_dma_set_left(i2s_lcd_obj, x, left);
xQueueReceive(i2s_lcd_obj->event_queue, (void *)&event, portMAX_DELAY);
lcd_i2s_start(i2s_lcd_obj->i2s_dev, ((uint32_t)&i2s_lcd_obj->dma[(x % 2) * i2s_lcd_obj->dma_half_node_cnt]) & 0xfffff, left);
}
ESP_LOGI("i2s_write_data","xQueueReceive start1");
xQueueReceive(i2s_lcd_obj->event_queue, (void *)&event, portMAX_DELAY);
ESP_LOGI("i2s_write_data","xQueueReceive end1");
}
有没有遇到这种情况的啊?
ST7789 并口驱动初始化卡死
Moderator: ESP_Bob
Return to “ESP IoT Solution 中文讨论版”
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 19 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.