Guest User

Untitled

a guest
Jun 21st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c
  2. index b3e8f0e..39b1509 100644
  3. --- a/firmware/target/arm/lcd-c200_c200v2.c
  4. +++ b/firmware/target/arm/lcd-c200_c200v2.c
  5. @@ -78,15 +78,19 @@ static inline void lcd_wait_write(void)
  6. }
  7.  
  8. /* send LCD data */
  9. -static void lcd_send_data(const fb_data *data, int width)
  10. +static void lcd_send_pixel(const fb_data data)
  11. {
  12. - while(width--)
  13. - {
  14. - lcd_wait_write();
  15. - LCD1_DATA = *data >> 8;
  16. - lcd_wait_write();
  17. - LCD1_DATA = *data++ & 0xff;
  18. - }
  19. + lcd_wait_write();
  20. + LCD1_DATA = data >> 8;
  21. + lcd_wait_write();
  22. + LCD1_DATA = data & 0xff;
  23. +}
  24. +
  25. +static inline void lcd_send_data(const fb_data *data, int width)
  26. +{
  27. + do {
  28. + lcd_send_pixel(*data++);
  29. + } while(--width);
  30. }
  31.  
  32. /* send LCD command */
  33. @@ -131,12 +135,16 @@ static inline void lcd_delay(int delay)
  34. /* send LCD data */
  35. static void lcd_send_data(const fb_data *data, int width)
  36. {
  37. - while(width--)
  38. - {
  39. + do {
  40. DBOP_DOUT = *data << 8 | *data >> 8;
  41. data++;
  42. - while ((DBOP_STAT & (1<<10)) == 0);
  43. - }
  44. +
  45. + /* Wait if push fifo is full */
  46. + while ((DBOP_STAT & (1<<6)) != 0);
  47. + } while(--width);
  48. +
  49. + /* While push fifo is not empty */
  50. + while ((DBOP_STAT & (1<<10)) == 0);
  51. }
  52.  
  53. /* send LCD command */
Add Comment
Please, Sign In to add comment