EmbeddedRelated.com
Forums

A compiler problem.Is it because the C Program or CWSEHC12..

Started by caoshyh August 27, 2004
I am using the CodeWarrior Development Studio Special Edition for
HCS12 write a simple program for the MCU of MC9S12DP256B using the
HCS12 software stationery of stationary-k79x.In the Project manager
window I removed several MCU peripheral definition and add two files
( "PllDrv.h,PllDrv.c" )in the "Drive" floder.Below is the program:
1,main.c
#include "main.h"
#include"PllDrv.h"
void main ( )
{ tU08 Cnt;
tU08 a=0x1;
InitPll();
Regs .portb.byte =0xff;
Regs .ddrb.byte =0xff; //Set the portb output
for(Cnt0;Cnt>0;Cnt--) {
Regs .portb.byte = ~a;
WaitDlyMs(500);
a=a<<1;
if(a==0){
a=0x1;
}
}
//Insert Application Software Here.
for (;; )
}

2,PllDrv.c
#include "PllDrv.h"
//**************************************************************
//; Subroutine WaitDmS - A programmable delay in mS.
//; Req. Subs: Dly1ms
//;************************************************************** /
#define TC1MS 5988
void WaitDlyMs( tU16 NubDly ){
//NubDly pass in D is the number of delaying seconds
asm{
pshd ;preserve ACCD
msdlp: jsr dly1ms ;execute 1mS ACCD times
subd #1
bne msdlp
puld ;recover ACCD
bra last
dly1ms: pshx ;preserve IX
ldx #TC1MS ;execute loop TC1MS times
d1mslp: dex
bne d1mslp
pulx ;recover IX
rts
last: nop
}
return;
}
void InitPll( void){
tU08 LockTestCnt;
tU08 Index;
Crg.clksel.byte &= ~PLLSEL;
Crg.pllctl.byte |=PLLON+AUT;
Crg.refdv.byte=1;
Crg.synr.byte=2;
for( LockTestCnt0 ; LockTestCnt>0 ; LockTestCnt-- ) {
WaitDlyMs(1);
Index=Crg.crgflg.byte;
Index &=LOCK;
if(Index>0) {
Crg.clksel.byte |=PLLSEL;
break;
}
}
return;
}

3.PllDrv.h
#ifndef PLLDRV_H /*prevent duplicated includes*/
#define PLLDRV_H
/*Includes*/
#include "projectglobals.h"
/*External Prototypes*/
extern void WaitDlyMs(tU16)
extern void InitPll( void)
#endif /* PLLDRV_H */ Some editor also have been done in the "projectglobals.h " file.I
add severeal lines:
#define CRG
#ifdef CRG
#include "PllDrv.h"
#endif/*CRG*/ The problem is,When I compile the main.c the following error
displays in the erroe and warning window:
[color=yellow][color=black]Error : C1005: Illegal storage class
main.c line 4
Error : C2801: ';' missing
main.c line 4
Error : C1409: Illegal combination of parameterlist and identlist
main.c line 4
Error : C1400: Missing parameter name in function head
main.c line 4
Warning : C1801: Implicit parameter-declaration
main.c line 5
Error : C2801: ';' missing
main.c line 5
Warning : C1420: Result of function-call is ignored
main.c line 4
Error : C1815: tU08 not declared (or typename)
main.c line 5
Error : C2801: ';' missing
main.c line 5
Error : C1815: Cnt not declared (or typename)
main.c line 5
Error : C1815: tU08 not declared (or typename)
main.c line 6
Error : C2801: ';' missing
main.c line 6
Error : C1815: a not declared (or typename)
main.c line 6
Warning : C1801: Implicit parameter-declaration
main.c line 7
Warning : C1420: Result of function-call is ignored
main.c line 7
Warning : C1855: Recursive function call
main.c line 12
Error : C2801: '}' missing
main.c line 22
Error : Compile failed[colorkred]
And when I maker the project the error and warning is:
C1005: Illegal storage class

main.c line 4

Error : C2801: ';' missing

main.c line 4

Error : C1409: Illegal combination of parameterlist and identlist

main.c line 4

Error : C1400: Missing parameter name in function head

main.c line 4

Warning : C1801: Implicit parameter-declaration

main.c line 5

Error : C2801: ';' missing

main.c line 5

Warning : C1420: Result of function-call is ignored

main.c line 4

Error : C1815: tU08 not declared (or typename)

main.c line 5

Error : C2801: ';' missing

main.c line 5

Error : C1815: Cnt not declared (or typename)

main.c line 5

Error : C1815: tU08 not declared (or typename)

main.c line 6

Error : C2801: ';' missing

main.c line 6

Error : C1815: a not declared (or typename)

main.c line 6

Warning : C1801: Implicit parameter-declaration

main.c line 7

Warning : C1420: Result of function-call is ignored

main.c line 7

Warning : C1855: Recursive function call

main.c line 12

Error : C2801: '}' missing

main.c line 22

Error : Compile failed

Error : C1005: Illegal storage class

projectvectors.h line 24

Error : C2801: ';' missing

projectvectors.h line 24

Error : C1409: Illegal combination of parameterlist and identlist

projectvectors.h line 24

Error : C1400: Missing parameter name in function head

projectvectors.h line 24

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 24

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 28

Error : C1830: Modifiable lvalue expected

projectvectors.h line 28

Warning : C1420: Result of function-call is ignored

projectvectors.h line 24

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 28

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 32

Error : C1830: Modifiable lvalue expected

projectvectors.h line 32

Warning : C1420: Result of function-call is ignored

projectvectors.h line 28

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 32

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 36

Error : C1830: Modifiable lvalue expected

projectvectors.h line 36

Warning : C1420: Result of function-call is ignored

projectvectors.h line 32

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 36

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 40

Error : C1830: Modifiable lvalue expected

projectvectors.h line 40

Warning : C1420: Result of function-call is ignored

projectvectors.h line 36

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 40

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 44

Error : C1830: Modifiable lvalue expected

projectvectors.h line 44

Warning : C1420: Result of function-call is ignored

projectvectors.h line 40

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 44

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 48

Error : C1830: Modifiable lvalue expected

projectvectors.h line 48

Warning : C1420: Result of function-call is ignored

projectvectors.h line 44

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 48

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 52

Error : C1830: Modifiable lvalue expected

projectvectors.h line 52

Warning : C1420: Result of function-call is ignored

projectvectors.h line 48

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 52

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 56

Error : C1830: Modifiable lvalue expected

projectvectors.h line 56

Warning : C1420: Result of function-call is ignored

projectvectors.h line 52

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 56

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 60

Error : C1830: Modifiable lvalue expected

projectvectors.h line 60

Warning : C1420: Result of function-call is ignored

projectvectors.h line 56

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 60

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 64

Error : C1830: Modifiable lvalue expected

projectvectors.h line 64

Warning : C1420: Result of function-call is ignored

projectvectors.h line 60

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 64

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 68

Error : C1830: Modifiable lvalue expected

projectvectors.h line 68

Warning : C1420: Result of function-call is ignored

projectvectors.h line 64

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 68

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 72

Error : C1830: Modifiable lvalue expected

projectvectors.h line 72

Warning : C1420: Result of function-call is ignored

projectvectors.h line 68

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 72

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 76

Error : C1830: Modifiable lvalue expected

projectvectors.h line 76

Warning : C1420: Result of function-call is ignored

projectvectors.h line 72

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 76

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 80

Error : C1830: Modifiable lvalue expected

projectvectors.h line 80

Warning : C1420: Result of function-call is ignored

projectvectors.h line 76

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 80

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 84

Error : C1830: Modifiable lvalue expected

projectvectors.h line 84

Warning : C1420: Result of function-call is ignored

projectvectors.h line 80

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 84

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 88

Error : C1830: Modifiable lvalue expected

projectvectors.h line 88

Warning : C1420: Result of function-call is ignored

projectvectors.h line 84

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 88

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 92

Error : C1830: Modifiable lvalue expected

projectvectors.h line 92

Warning : C1420: Result of function-call is ignored

projectvectors.h line 88

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 92

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 96

Error : C1830: Modifiable lvalue expected

projectvectors.h line 96

Warning : C1420: Result of function-call is ignored

projectvectors.h line 92

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 96

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 100

Error : C1830: Modifiable lvalue expected

projectvectors.h line 100

Warning : C1420: Result of function-call is ignored

projectvectors.h line 96

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 100

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 104

Error : C1830: Modifiable lvalue expected

projectvectors.h line 104

Warning : C1420: Result of function-call is ignored

projectvectors.h line 100

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 104

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 108

Error : C1830: Modifiable lvalue expected

projectvectors.h line 108

Warning : C1420: Result of function-call is ignored

projectvectors.h line 104

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 108

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 112

Error : C1830: Modifiable lvalue expected

projectvectors.h line 112

Warning : C1420: Result of function-call is ignored

projectvectors.h line 108

Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT
STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__

projectvectors.h line 112

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 116

Error : C1830: Modifiable lvalue expected

projectvectors.h line 116

Warning : C1420: Result of function-call is ignored

projectvectors.h line 112

C2: Message overflow, skipping ERROR messages Warning : C1801: Implicit parameter-declaration

projectvectors.h line 120

Warning : C1420: Result of function-call is ignored

projectvectors.h line 116

Warning : C1801: Implicit parameter-declaration

projectvectors.h line 124

Warning : C1420: Result of function-call is ignored

projectvectors.h line 120

C2: Message overflow, skipping WARNING messages Error : Compile failed

Error : C1005: Illegal storage class

PllDrv.c line 10

Error : C2801: ';' missing

PllDrv.c line 10

Error : C1409: Illegal combination of parameterlist and identlist

PllDrv.c line 10

Error : C1400: Missing parameter name in function head

PllDrv.c line 10

Error : C1815: tU16 not declared (or typename)

PllDrv.c line 10

Warning : C1855: Recursive function call

PllDrv.c line 10

Error : C2801: ')' missing

PllDrv.c line 10

Error : C1815: NubDly not declared (or typename)

PllDrv.c line 10

Error : C2801: ';' missing

PllDrv.c line 10

Error : C2801: '}' missing

PllDrv.c line 41

Error : Compile failed