Compiler error when trying to add custom source files.
Hi,
I am a student who has recently started working with STM8s MCU's. Currently I am working with an STM8s207K8 Nucleo 32 development board, I am using STVD along with a cosmic toolchain to program my dev board. I am able to program the microcontroller successfully using the standard peripheral library, however when I am trying to create a custom driver the compiler throws an error stating that it can not open the specific header file, this happens when I try to add the inc and src files to the the already existing SPL files, and when I create a new folder of custom drivers and create two sub folders for inc and src files the compiler throws around 15 errors, I am attaching screenshots of the error here and also pasting the header and source files of the custom UART driver that I am trying to create.
Below is the header file for the UART driver
/********************/
//uart_driver.h
#ifndef UART_H
#define UART_H
/* Initialization */
void uart_init(uint32_t baud_rate);
/* Send Character */
void uart_send_char(uint8_t data);
/* Receive Character */
uint8_t uart_rec_char(void);
#endif
/********************/
Below is the source file for the UART driver
/********************/
//uart_driver.c
#include <uart_driver.h>
/* Initialization */
void uart_init(uint32_t baud_rate)
{
UART3_DeInit();
UART3_Init(baud_rate, UART3_WORDLENGTH_8D, UART3_STOPBITS_1, UART3_PARITY_NO, UART3_MODE_TXRX_ENABLE);
}
/* Send Character */
void uart_send_char(uint8_t data)
{
while (UART3_GetFlagStatus(UART3_FLAG_TXE) == RESET); //Checks if data transmission is stopped
UART3_SendData8(data);
}
/* Receive Character */
uint8_t uart_rec_char(void)
{
uint8_t data;
while (UART3_GetFlagStatus(UART3_FLAG_RXNE) == RESET); //Checks if data is received
data = UART3_ReceiveData8();
return data;
}
/********************/
I would really appreciate it if someone could help me resolve my problem
Thanks
