Untitled

 avatar
unknown
plain_text
13 days ago
761 B
11
Indexable
#include "main.h"
#include "Application_Code.h"
#include <stdio.h>

extern void initialise_monitor_handles(void);

SPI_HandleTypeDef hspi5;

void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_SPI5_Init(void);

int main(void)
{
	initialise_monitor_handles();
    HAL_Init();

    SystemClock_Config();

	MX_GPIO_Init();
	MX_SPI5_Init();
	Application_Init();
#if INTERRUPT
	// I couldn't get 1 ms with the default.
	HAL_SYSTICK_Config(25000000 / 2000000);
#endif
	while (1)
	{
	#if POLLING
	  is_BTN_pressed = Read_BTN_State();
	  HAL_Delay(100);
	  direction = Read_Gyro_Direction();
	  HAL_Delay(100);
	  LED_Go(is_BTN_pressed, direction);
	  HAL_Delay(100);
	#endif
	#if INTERRUPT
	#endif
  }
}
Leave a Comment