Capacitive Touch switch with STM8

//Initializes the GPIOx according to the specified parameters
GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode);
//Writes data to the specified GPIO data port
GPIO_Write(GPIO_TypeDef* GPIOx, uint8_t PortVal);   
//Writes high level to the specified GPIO pins
GPIO_WriteHigh(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins);
//Writes low level to the specified GPIO pins
GPIO_WriteLow(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins);
//Writes reverse level to the specified GPIO pins
GPIO_WriteReverse(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins);
//Reads the specified GPIO output data port
GPIO_ReadOutputData(GPIO_TypeDef* GPIOx);
//Reads the specified GPIO input data port
GPIO_ReadInputData(GPIO_TypeDef* GPIOx);
//Reads the specified GPIO input data pin
GPIO_ReadInputPin(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin);
//Configures the external pull-up on GPIOx pins
GPIO_ExternalPullUpConfig(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, FunctionalState NewState);
GPIO_Init(GPIOB,GPIO_PIN_4,GPIO_MODE_IN_FL_NO_IT);    //PB4 as input
GPIO_Init(GPIOD,GPIO_PIN_5,GPIO_MODE_OUT_PP_LOW_FAST);//PD5 as output
#include "stm8s_gpio.h"
main()
{
	GPIO_Init(GPIOD,GPIO_PIN_5,GPIO_MODE_OUT_PP_LOW_FAST);
	GPIO_Init(GPIOB,GPIO_PIN_4,GPIO_MODE_IN_FL_NO_IT);
	while (1)
            {
              if(GPIO_ReadInputPin(GPIOB,GPIO_PIN_4))
              GPIO_WriteHigh(GPIOD,GPIO_PIN_5);
              else GPIO_WriteLow(GPIOD,GPIO_PIN_5);
            }
}
Hardware         : ST-LINK
PORT             : USB
Programming mode : SWIM
Device           : STM8S103F3