I realize that you can't teach me "C" here. I have programmed other languages including C#, but the whole include file business is still somewhat mysterious to me, especially when it does not work.
Here is my issue:
My main program stripped:
Code: Select all
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "lcd.h"
main()
{
LCDinit();
} The include file:
Code: Select all
#ifndef _LCD_H_
#define _LCD_H_
#ifdef __cplusplus
extern "C" {
#endif
void LCDClear(void);
void LCDInit(void);
void LCDPrintRow(uint8_t,uint8_t []);
#ifdef __cplusplus
}
#endif
#endif /* _LCD_H_ */And of course there is a a LCD.c file, where LCDInit is defined:
Code: Select all
LCDInit(){
dostuff;
}Whatever I do, and I have played with this for days now, I come back to get:
..\main.c(243): warning: #223-D: function "LCDInit" declared implicitly.
Why is this so? LCD.h is there and can be found.
And when do I have to use the " #ifdef __cplusplus" clause? ( I just stole it from a different file)
Question 2:
in this code I found for the LCD driver, some of the functions were declared "inline" which is a compiler directive that should not make a difference.
I have not managed to compile any inline function without getting "this declaration has no storage or type specifier.