I would like to ask you why in the following code the compiler doesn't give an error? This is the flash.h file:
#ifndef _FLASH_H_
#define _FLASH_H_
#define BANK_A 0
#define BANK_B 1
#define BANK_C 3
#define FLASH_IS_BUSY (FCTL3 & BUSY)//FCTL3 and BUSY are defined in msp430f5438a.
#endif
And this is the main.c file:
#include "flash.h"
#include <msp430f5438a.h>
void main(void)
{
while(1)
{
;
}
}
The problem is that I don't understand how the compiler doesn't give an error at this line:
#define FLASH_IS_BUSY (FCTL3 & BUSY)
Since there is no way (according to my grasp) the compiler to know what FCTL3 and BUSY mean. These both macros are defined into the msp430f5438a.h as follows:
#define FCTL3 (*((unsigned char*)0x0144u))
#define BUSY 0x01
But the flash.h is included before msp430f5438a.h How the compiler resolves those symbols: FCTL3 and BUSY?