Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20622

Share your working BASCOM-AVR code here : MD070SD Display : REPLY

$
0
0
First we meet color byte. This byte processed with [b:62d0102c0f]Color_convert[/b:62d0102c0f] routine after "Else" condition. So, when we meet $AA color is already processed. Moreover, because we had 16-bit interface, color data already exist at [b:62d0102c0f]Data_disp[/b:62d0102c0f] & [b:62d0102c0f]Data_disp_high[/b:62d0102c0f] ports and we don't need to convert color more over. WR=0/WR=1 is enough to send data. By the way, we can replace"Decr Imagesize" out of loop. It will also speed up routine. Added strings marked with "*****************": [code:1:62d0102c0f] Do Read Pixel 'Read the value for the pixel If Pixel = &HAA Then 'BGC file is rle coded &HAA represents this, the byte after &HAA is the number of times that the byte before &HAA wil be repeated Read Repeat 'Byte after &HAA contains the number of times to repeat Repeat = Repeat - 1 For L = 1 To Repeat 'Loop the repeat 'Call Lcd_16data(prevpixel) 'Write the pixel data to the display Wrpin = 0 : Wrpin = 1 '************************* 'Decr Imagesize 'Decrease the bytes still to be processed Next L 'Next repeat loop Imagesize = Imagesize - Repeat '**************************** Else 'It's a regular byte, not LRE encoded Pixelword = Rgb_16(pixel) 'Convert the 8bit pixel to 16bit pixel Call Lcd_16data(pixelword) 'Write the pixel data to the display Prevpixel = Pixelword 'Store the pixel in a temp word, maybe we need it if the next byte is &HAA Decr Imagesize 'Decrease the bytes still to be processed End If Loop Until Imagesize = 0 'Do until all bytes are processed[/code:1:62d0102c0f]

Viewing all articles
Browse latest Browse all 20622

Trending Articles