This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

undefined identifier in for loop

I created a new project and I defined a delay function using two for loops in my project. When I want to build the project I receive 6 errors. The variables of the for loops can't be defined for some reasons. If I write for( uint8_t count =0; count<UINT16_MAX; count++) I get the errors, but if I define count not in the for loop and use it in the loop I don't receive any errors. I actually never had this problem at my previous project and I didn't changed the code or settings during creating the project, nevertheless when I create a new project I encounter this problem

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "lpc17xx_gpio.h"
const uint8_t segmentTable[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
void Delaylow ()
{
for(uint16_t count=0; count<UINT16_MAX; count++)
for(uint8_t count2=0;count2<20; count2++)
{
}
}
int main ()
{
FIO_ByteSetDir(1,2,0xFF,1);
GPIO_SetDir(0,(1<<1)|(1<<2)|(1<<3),1);
GPIO_SetDir(0,(1<<16),0);
GPIO_ClearValue(0,(1<<3));
GPIO_SetValue(0,(1<<2));
GPIO_SetValue(0,(1<<1));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.

I added the C file of my code.

Thanks in advance

0