cancel
Showing results for 
Search instead for 
Did you mean: 

creating header in a project

edgarmedina20
Associate II
Posted on April 01, 2014 at 19:22

Hello everybody, I have a problem in a project, I want to compilate a code, it has worked correctly in another project ( but the another project is not mine), the code is a simple delay. Here is the body of my code.

delay.h:

&sharpinclude ''stm32f4xx.h''

line 3: void Delay_ms(unsigned long int nCount);

line 4: void Delay_us(unsigned long int nCount);

delay.c:

&sharpinclude ''delay.h''

unsigned int D;

void Delay_ms(unsigned long int nCount)

{

  D=23999;

  while(nCount!=0){D--;if(D==0){D=23999;nCount--;}}

}

void Delay_us(unsigned long int nCount)

{

  D=24;

  while(nCount!=0){D--;if(D==0){D=24;nCount--;}}

}

And the MAIN.C code:

&sharpinclude ''stm32f4xx.h''

&sharpinclude ''stm32f4xx_rcc.h''

&sharpinclude ''stm32f4xx_gpio.h''

&sharpinclude ''stm32f4xx_tim.h''

&sharpinclude ''stm32f4xx_usart.h''

&sharpinclude ''stm32f4xx_adc.h''

&sharpinclude <stdio.h>

&sharpinclude ''delay.h''

...

void adc_configure(){...}

void usart_configure(){...}

void GPIO_configure(){...}

int main(void) {

...

...

  Delay_us(10);

while(1)

{

Delay_ms(250);

...

Delay_ms(250);

...

}

}

My code is very large and have others problems, but Why I have this error? or How I could solve that?

 read the part about the delay in the build output, because the others error are similar, I have other code, but different project and In that project the code compile without any error :S

Thanks.

Build target 'TFT'

compiling Main.C...

delay.h(3): error:  &sharp130: expected a ''{''

MyTFT1963.h(19): warning:  &sharp12-D: parsing restarts here after previous syntax error

MyTFT1963.h(20): warning:  &sharp177-D: variable ''X'' was declared but never referenced

MyTFT1963.h(21): warning:  &sharp177-D: variable ''Y'' was declared but never referenced

MyTFT1963.h(22): error:  &sharp77-D: this declaration has no storage class or type specifier

MyTFT1963.h(22): error:  &sharp77-D: this declaration has no storage class or type specifier

MyTFT1963.h(197): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(198): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(199): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(200): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(201): error:  &sharp757: variable ''pPoint'' is not a type name

Main.C(149): error:  &sharp20: identifier ''myTouch'' is undefined

Main.C(149): error:  &sharp20: identifier ''PREC_EXTREME'' is undefined

compiling AsciiLib.c...

AsciiLib.c(4): error:  &sharp130: expected a ''{''

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(8): warning:  &sharp174-D: expression has no effect

AsciiLib.c(10): error:  &sharp65: expected a '';''

AsciiLib.c(10): error:  &sharp29: expected an expression

AsciiLib.c(568): warning:  &sharp12-D: parsing restarts here after previous syntax error

AsciiLib.c(568): error:  &sharp65: expected a '';''

AsciiLib.c(1180): error:  &sharp20: identifier ''ASCII16x24'' is undefined

AsciiLib.c(1182): error:  &sharp247: function ''GetASCIICode6'' has already been defined

compiling delay.c...

compiling MyTFT1963.c...

delay.h(3): error:  &sharp130: expected a ''{''

MyTFT1963.h(19): warning:  &sharp12-D: parsing restarts here after previous syntax error

MyTFT1963.h(20): warning:  &sharp177-D: variable ''X'' was declared but never referenced

MyTFT1963.h(21): warning:  &sharp177-D: variable ''Y'' was declared but never referenced

MyTFT1963.h(22): error:  &sharp77-D: this declaration has no storage class or type specifier

MyTFT1963.h(22): error:  &sharp77-D: this declaration has no storage class or type specifier

MyTFT1963.h(197): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(198): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(199): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(200): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.h(201): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.c(140): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.c(191): warning:  &sharp223-D: function ''Delay_ms'' declared implicitly

MyTFT1963.c(297): error:  &sharp20: identifier ''LCD_REG'' is undefined

MyTFT1963.c(302): error:  &sharp20: identifier ''LCD_RAM'' is undefined

MyTFT1963.c(307): error:  &sharp20: identifier ''LCD_REG'' is undefined

MyTFT1963.c(308): error:  &sharp20: identifier ''LCD_RAM'' is undefined

MyTFT1963.c(355): error:  &sharp20: identifier ''LCD_RAM'' is undefined

MyTFT1963.c(968): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.c(986): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.c(989): warning:  &sharp174-D: expression has no effect

MyTFT1963.c(989): error:  &sharp65: expected a '';''

MyTFT1963.c(1006): error:  &sharp20: identifier ''First'' is undefined

MyTFT1963.c(1010): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.c(1017): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.c(1023): error:  &sharp757: variable ''pPoint'' is not a type name

MyTFT1963.c(1028): error:  &sharp757: variable ''pPoint'' is not a type name

Target not created

#delay-header-create
1 REPLY 1
Posted on April 01, 2014 at 19:35

Something amiss in stm32f4xx.h?

''unsigned long int'' also seems a bit of a mouthful

Always start with the first error, the other may be a result of the compiler attempting to resynchronize itself.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..