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

error 66 compile problem pointer

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



Joined: 05 May 2015
Posts: 47

View user's profile Send private message Send e-mail

error 66 compile problem pointer
PostPosted: Tue Aug 25, 2015 1:33 pm     Reply with quote

Hello there is an error in this code.

"*** Error 66 "main.c" Line 108(39,43): Previous identifier must be a pointer"

PIC18F46K20
MPLAB X 3.0v
CCS 4.130v

can you help me?

thanks!

Code:


// defined(__PCH__)
//#include <18F452.h>
#include <18F46K20.h>
#include "string.h"
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)
//#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, BITS=8, PARITY = N,ERRORS, stream=PC)


//definiciones del Programa
#define LEDRojo1 PIN_A0     //anodo1 del led rojo
#define LEDRojo2 PIN_A1     //anodo2 del led rojo
#define LEDVerde1 PIN_C2    //anodo2 del led rojo
#define LEDVerde2 PIN_C3    //anodo2 del led rojo
#define SENSOR PIN_A2
#define FOTO PIN_E0     //RELE para la camara de fotos
#define k 0.022         //constante para cambio de unidades  (Km/hora, M/seg, etc)
#define LOW 0
#define HIGH 1

#define INTS_PER_SECOND 10         // (10000000/(4*4*65536))


//funciones prototipo

byte Selecciona( char, int);


//Variables globales
char palabra[14];// = "PROMETEC.NET  " ;

int num=0, len=0, fil=0;
float tiempo=1, medicion=0;  //tiempo entre cada medicion. Debe ser menor o igual a 1 segundo
//long rise,fall,pulse_width,count=0;
byte F;

int seconds;      // A running seconds counter
int int_count;    // Number of interrupts left before a second has elapsed


const byte P[8] = { 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x40 };
const byte R[8] = { 0x78, 0x44, 0x44, 0x78, 0x70, 0x58, 0x4C, 0x46 };
const byte O[8] = { 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C };
const byte M[8] = { 0x66, 0x7E, 0x5A, 0x42, 0x42, 0x42, 0x42, 0x42 };
const byte E[8] = { 0x7C, 0x40, 0x40, 0x78, 0x78, 0x40, 0x40, 0x7C };
const byte T[8] = { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 };
const byte C[8] = { 0x7c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C };
const byte N[8] = { 0x42, 0x62, 0x72, 0x5A, 0x4E, 0x46, 0x42, 0x42 };
const byte dot[8]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06 };
const byte sp[8]= { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };


#int_timer1                        // This function is called every time
                                         // timer 1 overflows (65535->0), which is
void  TIMER1_isr(void)
{                                   // approximately 19 times per second for
    if(--int_count==0) {           // this program.
      ++seconds;
      int_count = INTS_PER_SECOND;
     
      fil++;
     
    }
}


void main(void)
{
   
    SET_TRIS_B( 0xFF ); // pone B0, B1, B2 , B3 B4, B5, B6 y B7 como salidas
 


    int_count = INTS_PER_SECOND;
    setup_timer_1(T1_INTERNAL | T1_DIV_BY_4);
    set_timer1(0);
    enable_interrupts(INT_TIMER1);
    enable_interrupts(GLOBAL);
    strcpy(palabra,"TEMPOME  ");
   
    len = strlen(palabra); // Calcula la longitus de s
 
    while(num < len)
    {
        F = Selecciona( palabra[num], fil);
        output_B(F);
       
        if(fil % 8 == 1)
            num++;
    }

}


byte Selecciona( char c, int fila)
{
    if ( c == 'P')          return( P[fila]) ;
    if ( c == 'R')          return( R[fila]) ;
    if ( c == 'O')          return( O[fila]);
    if ( c == 'M')          return( M[fila]);
    if ( c == 'E')          return( E[fila]);
    if ( c == 'T')          return( T[fila]);
    if ( c == 'C')          return( C[fila]);   // problem
    if ( c == 'N')          return( N[fila]);
    if ( c == '.')          return( dot[fila]);
    if ( c == ' ')          return( sp[fila]);
}




Last edited by sebalitter on Tue Aug 25, 2015 2:06 pm; edited 1 time in total
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Aug 25, 2015 2:04 pm     Reply with quote

Code:

C[[color=orange]fila[/color]]);   // problem


i quite agree with the compiler.
this does not compile "above the neck" for me either.

what do you intend? Sad Shocked
sebalitter



Joined: 05 May 2015
Posts: 47

View user's profile Send private message Send e-mail

error 66 compile problem pointer
PostPosted: Tue Aug 25, 2015 2:08 pm     Reply with quote

asmboy wrote:
Code:

C[[color=orange]fila[/color]]);   // problem


i quite agree with the compiler.
this does not compile "above the neck" for me either.

what do you intend? Sad Shocked


I was trying to remark the problem in this forum.
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Tue Aug 25, 2015 2:13 pm     Reply with quote

PASS_STRINGS="IN_RAM"

Otherwise a pointer cannot be constructed to a const.

A search here will find all about this, and several explanations of 'why' (down to the actual architecture of the PIC).

I'd have expected it to error earlier, but the error locations given by the compiler are often 'strange'....
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