Jump to content

moscowbob

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by moscowbob

  1. Hi Joel,

    Below are the results of testing the macros against each other.

    PURE GREEN
    =============
    r = 0,
    g = 255
    b = 0
    
    rgb565 = RGB2COLOR(r, g, b)
    = 0x07E0
    --------->
    
    
    TEST 1 - (((c) & 0x007E)>>3)
    =============
    r1 = RED_OF(rgb565)
    = 0
    
    g1 = GREEN_OF(rgb565)  *
    = 12
    
    b1 = BLUE_OF(rgb565)
    = 0
    
    rgb565_1 = RGB2COLOR(r1, g1, b1)
    = 0x0060
    ---------> Incorrect
    
    
    TEST 2 - (((c) & 0x07E0)>>3)
    ============
    r2 = RED_OF(rgb565)
    = 0
    
    g2 = GREEN_OF(rgb565)  *
    = 252
    
    b2 = BLUE_OF(rgb565)
    = 0
    
    rgb565_2 = RGB2COLOR(r2, g2, b2)
    = 0x07E0
    ---------> Matches pure green original

     

  2. Hi,

    I think there is an error in gdisp_colors.h file line 219 which cause anti-alias font to display incorrectly.

    #define GREEN_OF(c)            (((c)&0x007E)>>3) should read

    #define GREEN_OF(c)            (((c)&0x07E0)>>3)

    Regards

×
×
  • Create New...