View previous topic :: View next topic |
Author |
Message |
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
Get warning by compiler graphic.c example |
Posted: Thu Nov 08, 2007 5:03 pm |
|
|
I get this error
>>> Warning 206 "F:\CCS\PICC\User Projects\pg320240d\graphics.h" Line 531(1,1): Variable of this data type is never greater than this constant
Hoiw can i remove this Warning???
Code: | #ifdef LARGE_LCD
void glcd_text57(int16 x, int16 y, char* textptr, int8 size, int1 color)
#else
void glcd_text57(int8 x, int8 y, char* textptr, int8 size, int1 color)
#endif
{
int8 j, k, l, m; // Loop counters
int8 pixelData[5]; // Stores character data
for(; *textptr != '\0'; ++textptr, ++x)// Loop through the passed string
{
if(*textptr < 'S') // Checks if the letter is in the first font array
memcpy(pixelData, FONT[*textptr - ' '], 5);
else if(*textptr <= '~') // Check if the letter is in the second font array
memcpy(pixelData, FONT2[*textptr - 'S'], 5);
else
memcpy(pixelData, FONT[0], 5); // Default to space
// Handles newline and carriage returns
switch(*textptr)
{
case '\n':
y += 7*size + 1;
continue;
case '\r':
x = 0;
continue;
}
--------------------------------------
THIS LINE GIVE THE ERROR
if(x+5*size >= GLCD_WIDTH) // Performs character wrapping
-------------------------------------
{
x = 0; // Set x at far left position
y += 7*size + 1; // Set y at next position down
}
for(j=0; j<5; ++j, x+=size) // Loop through character byte data
{
for(k=0; k < 7; ++k) // Loop through the vertical pixels
{
if(bit_test(pixelData[j], k)) // Check if the pixel should be set
{
for(l=0; l < size; ++l) // These two loops change the
{ // character's size
for(m=0; m < size; ++m)
{
glcd_pixel(x+m, y+k*size+l, color); // Draws the pixel
}
}
}
}
}
}
} |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 08, 2007 5:24 pm |
|
|
Here are some clues about what to do:
Quote: | F:\CCS\PICC\User Projects\pg320240d\graphics.h"
#ifdef LARGE_LCD
void glcd_text57(int16 x, int16 y, char* textptr, int8 size, int1 color)
#else
void glcd_text57(int8 x, int8 y, char* textptr, int8 size, int1 color)
#endif
{
|
|
|
|
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
|
Posted: Fri Nov 09, 2007 9:53 am |
|
|
OK thanks
I insert this and it works now
Code: | #define LARGE_LCD 1 |
|
|
|
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
|
Posted: Fri Nov 09, 2007 11:04 am |
|
|
An question, the included driver is for the SED1335 chipset
my lcd use an s1d13305 chipset
Must i change something to get it to work? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Nov 09, 2007 11:41 am |
|
|
What you must do is use Google.
Quote: | s1d13305 SED1335 part number |
|
|
|
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
|
Posted: Fri Nov 09, 2007 12:21 pm |
|
|
In my opinion it is the same |
|
|
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
|
Posted: Sat Nov 10, 2007 5:20 am |
|
|
Last question about the supplied driver
Where must i connect the data bus on what PIC port
The rd,wr,ao,cs,rst pins are defined, but not the data bus |
|
|
Ttelmah Guest
|
|
Posted: Sat Nov 10, 2007 5:33 am |
|
|
PortD
Look at the first line of the 'sendbyte' routine.
Best Wishes |
|
|
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
|
Posted: Sat Nov 10, 2007 5:36 am |
|
|
Ttelmah wrote: | PortD
Look at the first line of the 'sendbyte' routine.
Best Wishes |
Ok thx
I can change it to another port, i think this is not a problem
I will put the data to port C
and the control lines to port B
Gives this problems? |
|
|
Ttelmah Guest
|
|
Posted: Sat Nov 10, 2007 6:04 am |
|
|
Shouldn't be any problem. There are about half a dozen places you'll need to change things. Fast_io for this port, the TRIS commands in the read byte routine, the actual data input and output lines. However it should run fine.
Best Wishes |
|
|
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
|
Posted: Sat Nov 10, 2007 6:19 am |
|
|
Ok, i have change the following
Code: | int8 getStatus() {
int8 status;
TGLCD_DATA
output_low(GLCD_CS);
output_low(GLCD_RD);
delay_us(1);
status=input_c();
output_high(GLCD_RD);
output_high(GLCD_CS);
return status;
}
int8 glcd_readByte() {
int8 data;
set_tris_c(0xFF);
output_low(GLCD_CS);
delay_cycles(1);
output_low(GLCD_RD);
delay_cycles(2);
data=input_c();
output_high(GLCD_RD);
output_high(GLCD_CS);
return data;
}
void glcd_sendByte(byte data) {
output_c((data));
output_low(GLCD_CS);
delay_cycles(1);
output_low(GLCD_WR);
delay_cycles(2);
output_high(GLCD_WR);
output_high(GLCD_CS);
}
|
This must be all? |
|
|
The Puma
Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
|
|
Posted: Sat Nov 10, 2007 7:59 am |
|
|
It did't work
Only the whole screen of pixel and other strange pattern |
|
|
|