I get that compilation error because of this line which intended to increase the pointer by 0x200 (to point to the next segment)
Flash_ptr = Flash_ptr + (unsigned char *) 0x200;
I'v seen this but I didn't use any illegal symbol!
P.S. The initialization of the pointer:
unsigned char * Flash_ptr = (unsigned char *) 0x20000;
You can't add two pointers. You can add an integer to a pointer, and you can subtract two pointers to get an integer difference, but adding two pointers makes no sense. To solve your problem therefore you just need to remove the cast:
Flash_ptr = Flash_ptr + 0x200;
This increments Flash_ptr
by 0x200 elements, but since Flash_ptr
is of type unsigned char *
then this just translates to an increment of 0x200 bytes.
In order to make this part of a loop and check for an upper bound you would do something like this:
while (Flash_ptr < (unsigned char *)0x50000) // loop until Flash_ptr >= 0x50000
{
// ... do something with Flash_ptr ...
Flash_ptr += 0x200;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With