#!/bin/sh PROJ="${1?'project'}" OPENOCD=openocd # location of OpenOCD Board .cfg files (only used with 'make flash-target') # # This path is from Ubuntu 14.04. # OPENOCD_BOARD_DIR=/usr/share/openocd/scripts/board # Configuration (cfg) file containing programming directives for OpenOCD # # If you are using an STLINK v2.0 from an STM32 F4 DISCOVERY board, # set this variable to "stm32f4discovery.cfg". # # If you are using an STLINK v2.1 from an STM32 F4 NUCLEO board, # set this variable to "st_nucleo_f401re.cfg". # # If you are using something else, look for a matching configuration file in # the OPENOCD_BOARD_DIR directory. # OPENOCD_PROC_FILE=stm32f4discovery.cfg #OPENOCD_PROC_FILE=st_nucleo_f4.cfg $OPENOCD -f $OPENOCD_BOARD_DIR/$OPENOCD_PROC_FILE -c "program $PROJ.elf verify reset exit" STM32 avalanche noise entropy sourcegit repositories
aboutsummaryrefslogblamecommitdiff
path: root/src/led-test/main.c
blob: b5f15c99df81eb456b5ff9651b541a55b89f9181 (plain) (tree)






























                                                             
/*
 * Blink the four LEDs on the rev08/rev09 board in a pattern.
 */
#include "stm_init.h"

#define DELAY() HAL_Delay(125)

void toggle_led(uint32_t times, uint32_t led_pin)
{
  uint32_t i;

  for (i = 0; i < times; i++) {
    HAL_GPIO_TogglePin(LED_PORT, led_pin);
    DELAY();
  }
}

int
main()
{
  stm_init();

  while (1)
  {
    toggle_led(2, LED_BLUE);
    toggle_led(2, LED_GREEN);
    toggle_led(2, LED_YELLOW);
    toggle_led(2, LED_RED);
  }

}