CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Get warning by compiler graphic.c example

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
The Puma



Joined: 23 Apr 2004
Posts: 227
Location: The Netherlands

View user's profile Send private message

Get warning by compiler graphic.c example
PostPosted: Thu Nov 08, 2007 5:03 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 08, 2007 5:24 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 9:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 11:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 11:41 am     Reply with quote

What you must do is use Google.
Quote:
s1d13305 SED1335 part number
The Puma



Joined: 23 Apr 2004
Posts: 227
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 12:21 pm     Reply with quote

In my opinion it is the same
The Puma



Joined: 23 Apr 2004
Posts: 227
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Nov 10, 2007 5:20 am     Reply with quote

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







PostPosted: Sat Nov 10, 2007 5:33 am     Reply with quote

PortD
Look at the first line of the 'sendbyte' routine.

Best Wishes
The Puma



Joined: 23 Apr 2004
Posts: 227
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Nov 10, 2007 5:36 am     Reply with quote

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







PostPosted: Sat Nov 10, 2007 6:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Nov 10, 2007 6:19 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Nov 10, 2007 7:59 am     Reply with quote

It did't work Sad Sad

Only the whole screen of pixel and other strange pattern
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group