Compare commits
No commits in common. "1b3ff2c0b6fc7b798ad883cc3edb3fb301064327" and "89850bfc2f6bf437076e24ad581b36f963c64fad" have entirely different histories.
1b3ff2c0b6
...
89850bfc2f
2 changed files with 12 additions and 13 deletions
|
|
@ -1,7 +1,4 @@
|
|||
#include "emetteur_rf.h"
|
||||
#include <stdio.h>
|
||||
|
||||
char buf[100];
|
||||
|
||||
void emetteur_rf_init(void){
|
||||
|
||||
|
|
@ -37,19 +34,22 @@ void emetteur_rf_init(void){
|
|||
LL_USART_Init(USART1,&My_LL_Usart_Init_Struct);
|
||||
LL_USART_Enable(USART1);
|
||||
|
||||
}
|
||||
/*int periph_speed;
|
||||
if (uart_port==USART1) periph_speed = 36000000;
|
||||
if (uart_port==USART2) periph_speed = 72000000;
|
||||
if (uart_port==USART3) periph_speed = 72000000;
|
||||
|
||||
LL_USART_SetBaudRate(uart_port, periph_speed, baudrate);
|
||||
*/}
|
||||
|
||||
|
||||
|
||||
|
||||
void emetteur_send_bytes(char* buf, int len){
|
||||
|
||||
LL_GPIO_SetOutputPin(GPIOA,LL_GPIO_PIN_11);
|
||||
for(int i = 0; i < len; i++){
|
||||
LL_GPIO_SetOutputPin(GPIOA,LL_GPIO_PIN_11);
|
||||
LL_USART_TransmitData8(USART1, buf[i]);
|
||||
while(!LL_USART_IsActiveFlag_TXE(USART1));
|
||||
}
|
||||
LL_GPIO_ResetOutputPin(GPIOA,LL_GPIO_PIN_11);
|
||||
}
|
||||
|
||||
void emetteur_send_message(int rouli_bon, int alimentation_bon, float angle_voile){
|
||||
int len = sprintf(buf, "Alim bon: %d, Rouli bon: %d, Angle de voile: %2f\r\n", alimentation_bon, rouli_bon, angle_voile);
|
||||
emetteur_send_bytes(buf, len);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
void emetteur_rf_init(void);
|
||||
void emetteur_send_bytes(char* buf, int len);
|
||||
void emetteur_send_message(int rouli_bon, int alimentation_bon, float angle_voile);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue