@@ -199,7 +199,9 @@ esp_err_t esp_lcd_new_i80_bus(const esp_lcd_i80_bus_config_t *bus_config, esp_lc
199199 (uint32_t )lcd_ll_get_interrupt_status_reg (bus -> hal .dev ),
200200 LCD_LL_EVENT_TRANS_DONE , i80_lcd_default_isr_handler , bus , & bus -> intr );
201201 ESP_GOTO_ON_ERROR (ret , err , TAG , "install interrupt failed" );
202- lcd_ll_enable_interrupt (bus -> hal .dev , LCD_LL_EVENT_TRANS_DONE , false); // disable all interrupts
202+ PERIPH_RCC_ATOMIC () {
203+ lcd_ll_enable_interrupt (bus -> hal .dev , LCD_LL_EVENT_TRANS_DONE , false); // disable all interrupts
204+ }
203205 lcd_ll_clear_interrupt_status (bus -> hal .dev , UINT32_MAX ); // clear pending interrupt
204206 // install DMA service
205207 bus -> max_transfer_bytes = bus_config -> max_transfer_bytes ;
@@ -215,8 +217,10 @@ esp_err_t esp_lcd_new_i80_bus(const esp_lcd_i80_bus_config_t *bus_config, esp_lc
215217 lcd_ll_set_swizzle_mode (bus -> hal .dev , LCD_LL_SWIZZLE_AB2BA );
216218 // number of data cycles is controlled by DMA buffer size
217219 lcd_ll_enable_output_always_on (bus -> hal .dev , true);
218- // enable trans done interrupt
219- lcd_ll_enable_interrupt (bus -> hal .dev , LCD_LL_EVENT_TRANS_DONE , true);
220+ PERIPH_RCC_ATOMIC () {
221+ // enable trans done interrupt
222+ lcd_ll_enable_interrupt (bus -> hal .dev , LCD_LL_EVENT_TRANS_DONE , true);
223+ }
220224 // trigger a quick "trans done" event, and wait for the interrupt line goes active
221225 // this could ensure we go into ISR handler next time we call `esp_intr_enable`
222226 lcd_periph_trigger_quick_trans_done_event (bus );
0 commit comments