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<<ch);
-
+ DWDMA_MASK_TFR = (1 << (ch+8)) | (1<<ch);
}
@@ -200,7 +216,7 @@ void create_llp(void)
llp_setup((void *)FBADDR(0,i), (void*)(&LCD_BUFF+((i%4)*LCD_WIDTH/2)), &(scr_llp[i]), LCD_WIDTH/2);
/* this seems to work with 2,3 and 4 dunno why is this */
- llp_end(&scr_llp[LCD_HEIGHT-4]);
+ llp_end(&scr_llp[LCD_HEIGHT-1]);
}
void lcdif_init(enum lcdif_mode_t mode)
@@ -213,6 +229,7 @@ void lcdif_init(enum lcdif_mode_t mode)
void lcd_update()
{
+ update_count++;
lcd_set_gram_area(0, 0, LCD_WIDTH, LCD_HEIGHT);
lcdctrl_bypass(0);
@@ -223,5 +240,5 @@ void lcd_update()
MCU_CTRL=(1<<1)|(1<<2)|(1<<5);
- while (DWDMA_CTL_L(0) & (1<<27));
+ //while (DWDMA_CTL_L(0) & (1<<27));
}