Other Parts Discussed in Thread: MSP430G2332
Hello, I ran a search for this compilation error and most of the results were relating to CCS, which is why I'm posting here rather than C++.
Two weeks ago I dug out some old code I wrote a couple of years ago. I built it and flashed it to a MSP430G2332 without trouble. I'm trying to do the exact same again today, but I get these compile errors with description "#41 expected an identifier". I get one such error for each time I declare most "extern" pointers in my header.h file, another identical error for each time these pointers are defined (globally) in main.cpp, and another (different) error for each time the code tries to access this pointer (description of the different error is: "#76 operand of "*" must be a pointer").
I've tried copying all the source code into a brand new project. No change.
From reading the other posts on people who get this error, it seems solving is a case-by-case problem. Could anyone help me work out where I start to solve this. Unfortunately the code is commercially sensitive so I can't upload it, but I've pasted some extracts of the code that the errors are pointing to below:
Pointer declaration in header.h:
extern unsigned int *CAL_ADC_15T85;
This results in an error with description "#41 expected an identifier".
Pointer definition in main.cpp (global definition - outside of any function):
unsigned int *CAL_ADC_15T85 = (unsigned int *) 0x10E4;
This results in an error with description "#41 expected an identifier".
Attempted usage of the pointer inside a function:
shutdownTemp = ( (float) shutdownTemp_uncalib - 30 ) * ( *CAL_ADC_15T85 - *CAL_ADC_15T30 ) / ( 85 - 30 ) + *CAL_ADC_15T30 + 0.5;
This results in an error with description "#76 operand of "*" must be a pointer".
There are two particularly distinctive things to note about this problem:
- The errors occur on all pointers that point to calibration data in "Segment A". A pointer that points to a memory address outside Segment A is not affected by this error.
- Two weeks ago I successfully build and flashed this code without any trouble. I've not changed anything in the code since. It's the first time I see these errors.
I'm using CCS version 6.1.2.00015, on Windows 10. Please let me know if there's any other information I can provide. Many thanks.