bexus_ms_exchange.c 685 B

12345678910111213141516171819202122232425262728
  1. #include "bexus_ms_exchange.h"
  2. /**----------------variables---------------------------*/
  3. struct Dataset *dataset_tx;
  4. uint32_t last_exchanged=0;
  5. /**-----------------------------------------------------*/
  6. /**------------------functions--------------------------*/
  7. void Data_Exchange_Init(void){
  8. //memcpy(&Dataset_Slave[buff_sensor_data_index], rx_buf, sizeof(struct Dataset));
  9. }
  10. void Data_Exchange(void){
  11. if(millis()-last_exchanged >= 10){
  12. dataset_tx = &Dataset_Master[buff_sensor_data_index];
  13. HAL_UART_Transmit_DMA(&huart3,(uint8_t*)dataset_tx,sizeof(struct Dataset));
  14. last_exchanged=millis();
  15. }
  16. }
  17. /**-----------------------------------------------------*/