![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Versão estável sem DMA e FFT. 128 amostras.
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
Codes/ntpc.cpp
- Committer:
- rebonatto
- Date:
- 2016-01-05
- Revision:
- 0:fac116e94d44
File content as of revision 0:fac116e94d44:
#include "ntpc.h" void ntpc::ntpc_Thread(void const* arg) { printf("\r\nTrhead NTP client\r\n"); while (true) { ntpcDo(); wait(30); } } void ntpc::ntpcDo() { printf("Pegando NTP...\r\n"); if (ntpClient.setTime("ntp.ubuntu.com") == 0) { printf("NTP OK!\r\n"); time_t ctTime; ctTime = time(NULL); printf("Setando para hora (UTC): %s\r\n", ctime(&ctTime)); } else { printf("NTP Erro!\r\n"); } }