nbus_master_module.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * nbus_master_module.c
  3. *
  4. * Created on: Nov 12, 2023
  5. * Author: juraj
  6. */
  7. #include "nbus_master_module.h"
  8. #include "nbus_types.h"
  9. #if MODULE_MASTER == 1
  10. void nbus_master_unicastToModuleSet(nBus_TypeDef *nbus)
  11. {
  12. }
  13. void nbus_master_unicastToModuleGet(nBus_TypeDef *nbus)
  14. {
  15. // case CMD_SYNC:
  16. {
  17. if (nbus->rx_length < 11)
  18. {
  19. return;
  20. }
  21. // RTC_TimeTypeDef sTime = {0};
  22. // RTC_DateTypeDef sDate = {0};
  23. // sTime.Hours = nbus->rx_buffer[7];
  24. // sTime.Minutes = nbus->rx_buffer[8];
  25. // sTime.Seconds = nbus->rx_buffer[9];
  26. // sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
  27. // sTime.StoreOperation = RTC_STOREOPERATION_RESET;
  28. // HAL_RTC_SetTime(nbus->periph->rtc, &sTime, RTC_FORMAT_BCD);
  29. // sDate.WeekDay = nbus->rx_buffer[6];
  30. // sDate.Date = nbus->rx_buffer[5];
  31. // sDate.Month = nbus->rx_buffer[4];
  32. // sDate.Year = nbus->rx_buffer[3];
  33. // HAL_RTC_SetDate(nbus->periph->rtc, &sDate, RTC_FORMAT_BCD);
  34. }
  35. // break;
  36. }
  37. #endif