2018-01-23 11:07 PM
I am getting an error while compiling the file.Can any one please help me out.
sdcc -lstm8 -mstm8 --out-fmt-ihx delay.c
?ASlink-Warning-Undefined Global '_GPIO_Init' referenced by module 'delay'
?ASlink-Warning-Undefined Global '_GPIO_WriteLow' referenced by module 'delay'
?ASlink-Warning-Undefined Global '_GPIO_DeInit' referenced by module 'delay'
?ASlink-Warning-Undefined Global '_GPIO_WriteHigh' referenced by module 'delay'
Makefile:16: recipe for target 'delay.ihx' failedmake: *** [delay.ihx] Error 1Thanks & Regards,
Prasad.
2018-01-24 12:44 AM
Would suggest your project is missing the GPIO source files.
2018-01-24 02:37 AM
,
,
Thanks for your reply clive !
But i have included GPIO header file too. I have written a program for an led to be in on state for a long and to be in off state for a short period. I am newer to this controller and the code i have written is below.
♯ include 'stm8s.h'
,
♯ include 'stm8s_gpio.h'volatile void delay(volatile uint32_t t)
,
{,
while(t--),,
}void main( void )
,
{GPIO_DeInit(GPIOB),
,
GPIO_Init(GPIOB, GPIO_PIN_5, GPIO_MODE_OUT_PP_LOW_FAST),,
GPIO_WriteHigh(GPIOB, GPIO_PIN_5),,
delay(2000),,
GPIO_WriteLow(GPIOB, GPIO_PIN_5),,
delay(20000),,
}Can i know what is wrong in this program. Can you please help me out.
2018-01-24 04:02 AM
I got the output with another program.
Thanks & Regards,
Prasad.
2018-01-24 10:01 AM
Include files provide prototypes, not function code.
2018-01-25 12:18 AM
Thanks for your reply, I know that it's basic thing. I have tried program in different manner so i ignored the previous program issues ad errors.