40 lines
678 B
C
40 lines
678 B
C
#include "stm32f10x.h"
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "GPIO.h"
|
|
#include "UART.h"
|
|
#include "TIMER.h"
|
|
#include "Girouette.h"
|
|
#include "Pwm_voile.h"
|
|
|
|
char MyChar;
|
|
|
|
//MyGPIO_Struct_TypeDef PA5; //PA5 LED
|
|
//MyGPIO_Struct_TypeDef PC13; //PC13 Bouton
|
|
|
|
void UART_RX_IT (void)
|
|
{
|
|
MyChar=UART_receive();
|
|
}
|
|
|
|
int main ( void )
|
|
{
|
|
MyGPIO_Struct_TypeDef GPIOA5;
|
|
GPIOA5.GPIO = GPIOA;
|
|
GPIOA5.GPIO_Conf = Out_Ppull;
|
|
GPIOA5.GPIO_Pin = 5;
|
|
MyGPIO_Init (&GPIOA5);
|
|
|
|
init_girouette();
|
|
init_pwm_voile();
|
|
|
|
MyUART_init();
|
|
MyUART_ActiveIT(1, &UART_RX_IT); //mode permet d'activer soit l'interruption sur TX
|
|
while(1)
|
|
{
|
|
Test_tour_girouette();
|
|
//Orientation_voiles();
|
|
}
|
|
}
|
|
|
|
|