diff --git a/firmware/target/arm/rk27xx/debug-rk27xx.c b/firmware/target/arm/rk27xx/debug-rk27xx.c index 5c2d356..994ae78 100644 --- a/firmware/target/arm/rk27xx/debug-rk27xx.c +++ b/firmware/target/arm/rk27xx/debug-rk27xx.c @@ -43,6 +43,8 @@ extern unsigned long sd_debug_time_rd; extern unsigned long sd_debug_time_wr; +extern int updating, update_count, intr_count; + bool dbg_hw_info(void) { int line; @@ -65,6 +67,13 @@ bool dbg_hw_info(void) line++; _DEBUG_PRINTF("sd_debug_time_rd: %d", sd_debug_time_rd); _DEBUG_PRINTF("sd_debug_time_wr: %d", sd_debug_time_wr); + + _DEBUG_PRINTF("updating: %d", updating); + _DEBUG_PRINTF("intr_count: %d", intr_count); + _DEBUG_PRINTF("update_count: %d", update_count); + _DEBUG_PRINTF("diff: %d", update_count - intr_count); + + lcd_update(); switch(button_get_w_tmo(HZ/20)) { diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.c b/firmware/target/arm/rk27xx/lcdif-rk27xx.c index fd683c4..f1f950f 100644 --- a/firmware/target/arm/rk27xx/lcdif-rk27xx.c +++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.c @@ -26,6 +26,18 @@ #include "cpu.h" #include "lcdif-rk27xx.h" +int updating = 0; +int intr_count = 0; +int update_count = 0; + +void INT_DWDMA(void) +{ + DWDMA_CLEAR_TFR |= 1; + + updating = 0; + intr_count++; +} + unsigned int lcd_data_transform(unsigned int data) { @@ -127,6 +139,8 @@ static void dwdma_init(void) DWDMA_DMA_CHEN = 0xf00; DWDMA_CLEAR_BLOCK = 0x0f; DWDMA_DMA_CFG = 1; /* global enable */ + INTC_IECR |= (1<<25); + INTC_IMR |= (1<<25); } /* dwdma linked list struct */ @@ -157,6 +171,7 @@ static void llp_setup(void *src, void *dst, struct llp_t *llp, uint32_t size) (2<<4) | (3<<11) | (3<<14) | + 1 | (1<<27) | (1<<28); } @@ -176,6 +191,7 @@ static void dwdma_start(uint8_t ch, struct llp_t *llp, uint8_t handshake) (1<<23) | (1<<17) | (2<<1) | + 1 | (2<<4) | (3<<11) | (3<<14) | @@ -187,7 +203,7 @@ static void dwdma_start(uint8_t ch, struct llp_t *llp, uint8_t handshake) DWDMA_CFG_H(ch) = (handshake<<11)|(1<<2); DWDMA_SGR(ch) = (13<<20); DWDMA_DMA_CHEN = (0x101<