![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
V4
Fork of Thread_Communication_V4_fortest by
Diff: main.cpp
- Revision:
- 17:aa585f901750
- Parent:
- 16:f30928e622a2
- Child:
- 18:728fddea6d9c
diff -r f30928e622a2 -r aa585f901750 main.cpp --- a/main.cpp Sat Jan 06 18:05:43 2018 +0000 +++ b/main.cpp Sat Jan 06 19:44:43 2018 +0000 @@ -127,8 +127,12 @@ if (evt.status == osEventMail) { mail_t *mail = (mail_t*)evt.value.p; - - sprintf(data_buffer[sample_h],"%s, %2.2f, %4.2f, %.4f\n\r", mail->Time_Date, mail->temp_Value, mail->press_Value, mail->LDR_Value); + char sample_time[21]; + int rTime = mail->Time_Date; + time((time_t*)rTime); + sample_epoch = localtime((time_t*)rTime); + strftime(sample_time, 21,"%d/%m/%Y, %X", sample_epoch); + sprintf(data_buffer[sample_h],"%s, %2.2f, %4.2f, %.4f\n\r", sample_time, mail->temp_Value, mail->press_Value, mail->LDR_Value); mail_FIFO.free(mail); } @@ -195,14 +199,14 @@ mail_LCD.put(mail); mail_t *mail1 = mail_FIFO.alloc(); - strcpy(mail1->Time_Date, (char*)TIME); + mail1->Time_Date = raw_time; mail1->LDR_Value = LDR; mail1->temp_Value = TEMP; mail1->press_Value = PRES; mail_FIFO.put(mail); mail_t *mail2 = mail_Network.alloc(); - strcpy(mail2->Time_Date, (char*)TIME); + mail1->Time_Date = raw_time; mail2->LDR_Value = LDR; mail2->temp_Value = TEMP; mail2->press_Value = PRES;