Jump to content
43oh

TDHofstetter

Members
  • Content Count

    5
  • Joined

  • Last visited

Reputation Activity

  1. Like
    TDHofstetter got a reaction from RobG in 2.2" 320x240 Color LCD Booster Pack   
    Yep, definitely set to 16MHz (G2553); CCS recognizes the #define.
     
    EDIT: There's an improvement - I modified your clearScreen() a little, and got some better performance:
    void clearScreen(u_char blackWhite) {     setArea(0, 0, getScreenWidth() - 1, getScreenHeight() - 1);     setBackgroundColor(blackWhite ? 0x0000 : 0xFFFF);     u_int w = getScreenWidth();     u_int h = getScreenHeight();     u_int Y = w;     while (h != 0) {         Y = w;         while (Y != 0) {             writeData(bgColorHighByte);             writeData(bgColorLowByte);             Y--;         }         h--;     } } Note that I'm not calling getScreenWidth() on each h; instead, I'm using a single stored value.
     
    EDIT II: It's a very SLIGHT improvement - all it's doing is eliminating one call (which eliminates some stack activity), but it's an improvement.
     
    EDIT III: Got it. Your code is pretty tight, Rob... so I changed things a little by using only the upper 180 (of 240) pixel rows, wiping it with fillRect instead of clearScreen. Now I'm barely within my 150fpm (2.5fps) frame rate design limit. Now it's time to do the COOL stuff.    8)
     
    I can use the lower 60 rows for other stuff, like a once-per-frame textual display.
×
×
  • Create New...