screenshot of my code and error data
This is my main.c file
#include "services_initialisations_prototype.h"
#include "services_functions_prototype.h"
void main(void)
{
initSfr();
while(1){
updateMatrix(404, 1);
}
return;
}
this is my services_initialisations_prototype.h
#ifndef XC_HEADER_TEMPLATE_H
#define XC_HEADER_TEMPLATE_H
#include <xc.h> // include processor files - each processor file is guarded.
#include <stdint.h>
//these are my function declarations
extern void initInterrupt();
extern void initIoc();
extern void initAdc();
extern void initTimer2();
extern void initSfr();
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* XC_HEADER_TEMPLATE_H */
this is my services_functions_prototype.h
#ifndef XC_HEADER_TEMPLATE_H
#define XC_HEADER_TEMPLATE_H
#include <xc.h> // include processor files - each processor file is guarded.
#include <stdint.h>
//these are my function declarations
extern void updateMatrix(int, int);
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* XC_HEADER_TEMPLATE_H */
When I try to include two header files in MPLAB X IDE version 4.05, it seems like it is not identifying the second header file. i tried swapping the order, but still the second one is not detected.
The services_initialisation_prototype.h contains initialisations of SFRs and services_functions_prototype.h contains prototypes of other functions. these functions are independent of each other.
when i compile, it is showing that
function updateMatrix() is declared as implicit int. conflicting declarations for variable _updateMatrix()
which shows that the header file services_functions_prototype is not identified.
the screenshot attached shows the code in services_functions_prototype.h in grey color, and it seems that part of code is not executed.
When I copied the whole declarations from header file to my main file, it is working perfectly fine.