Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

switch ,case of c function

Status
Not open for further replies.

lgeorge123

Full Member level 2
Joined
Jun 13, 2004
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Hong Kong
Activity points
1,403
In the following code , if the c variable is tft , is tmp variable is
tmp = tmp | CLCDC_LCDTIMING2_CPL(cgdatptr->pixels_per_line - 1) ????


/* Compute clocks per line based on panel type */
switch (c)
{
case MONO_4BIT:
/* Clocks per line is a quarter of pixels per line */
tmp = tmp | CLCDC_LCDTIMING2_CPL((cgdatptr->pixels_per_line / 4) - 1);
break;

case MONO_8BIT:
/* Clocks per line is an eighth of pixels per line */
tmp = tmp | CLCDC_LCDTIMING2_CPL((cgdatptr->pixels_per_line / 8) - 1);
break;

case CSTN:
/* CSTN Clocks per line (* 3 / 8) */
tmp = tmp | CLCDC_LCDTIMING2_CPL(((cgdatptr->pixels_per_line * 3) / 8) - 1);
break;

case TFT:
case ADTFT:
case HRTFT:
default:
/* Clocks per line and pixels per line are the same */
tmp = tmp | CLCDC_LCDTIMING2_CPL(cgdatptr->pixels_per_line - 1);
break;
}
 

Well i'm not sure if those case's will drop to default (they should, never tried something like that), but from syntax you have posted there is no reason to use those case's anyway cause all of those are equal to default, so this way it just make confusion..
 

The tmp variable takes the value
tmp = tmp | CLCDC_LCDTIMING2_CPL(cgdatptr->pixels_per_line - 1)
if c value is different from MONO_4BIT, or MONO_8BIT or CSTN
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top