/**
  ******************************************************************************
  * @file    main.c
  * @author  Ac6
  * @version V1.0
  * @date    01-December-2013
  * @brief   Default main function.
  ******************************************************************************
*/

#include <stdint.h>
//#include "stm32l1xx.h"
#include "stm32l1xx_nucleo.h"
#include "stm32l1xx_gpio.h"
#include "stm32l1xx_rcc.h"


int main(void)
{
	GPIO_InitTypeDef gpio;
	RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);

	GPIO_StructInit(&gpio);
	gpio.GPIO_Pin = GPIO_Pin_0;
	gpio.GPIO_Mode = GPIO_Mode_OUT;
	gpio.GPIO_OType = GPIO_OType_PP;
	gpio.GPIO_PuPd = GPIO_PuPd_UP;
	gpio.GPIO_Speed = GPIO_Speed_40MHz;
	GPIO_Init(GPIOC, &gpio);

	while(1)
	 {

		static int led_state=0;

		GPIO_WriteBit(GPIOC, GPIO_Pin_0, led_state ? Bit_SET : Bit_RESET);
		led_state = !led_state;
		GPIO_WriteBit(GPIOC, GPIO_Pin_0, led_state ? Bit_SET : Bit_RESET);


	 }
}
