
==============================================================================

// Independent watchdog IWDG1 timer test
//
// IWDG1 must be set up in MX
// USART3 must be set up in MX
// the three leds and the blue button (PC13) must be set up in MX

======== USER CODE 0 =========================================================

#include <stdio.h>

int __io_putchar (int ch)
{
	  HAL_UART_Transmit(&huart3, (uint8_t *)&ch, 1, 1000);
	  return ch;
}
 
======== USER CODE 2 =========================================================
  
  printf("starting...\n");
  
======== USER CODE 3 =========================================================
  
	  HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0,1);
	  HAL_Delay(400);
	  HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0,0);
	  HAL_GPIO_WritePin(GPIOE,GPIO_PIN_1,1);
	  HAL_Delay(200);
	  HAL_GPIO_WritePin(GPIOE,GPIO_PIN_1,0);
	  HAL_GPIO_WritePin(GPIOB,GPIO_PIN_14,1);
	  HAL_Delay(400);
	  HAL_GPIO_WritePin(GPIOB,GPIO_PIN_14,0);

	  HAL_IWDG_Refresh(&hiwdg1);

	  // let us simulate a s/w bug
	  if(HAL_GPIO_ReadPin(GPIOC,GPIO_PIN_13))
		  while(1);
		
==============================================================================
