S
S
Slavka2015-12-21 20:11:35
Microcontrollers
Slavka, 2015-12-21 20:11:35

LPC RTC, does the time setting work crookedly?

void setDateTime(void){
  
  struct typeDateTimeSend DateTime;
  struct tm loc_time;
  DateTime = *((struct typeDateTimeSend*)&OutReport[1]);
  
  led7.setNumLed7(DateTime.dm);
  
  loc_time.tm_sec		=	DateTime.ss;
  loc_time.tm_min		=	DateTime.mm;
  loc_time.tm_hour	=	DateTime.hh;
  loc_time.tm_mday	=	DateTime.dm;
  loc_time.tm_mon		=	DateTime.mh;
  loc_time.tm_year	=	DateTime.yy;

  correct_time_struct(&loc_time);
  correct_data_struct(&loc_time);

}

Here is the function of setting the time via USB, I checked that exactly those bytes are being transferred from the PC to the Device, but after executing this function, the time is not set to the desired one, but is reset to default, although the same skin works if it is registered at the start of the device, which can be The problem is that the data on the PC from the device comes in curves, and they are sent in an osprey with others and only the time is messed up.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question