verzweifelter Versuch es zu reparieren, back to master

This commit is contained in:
2021-02-28 10:42:44 +01:00
parent e8f9455c17
commit c46e5dbb3b
2 changed files with 8 additions and 3 deletions

View File

@ -66,5 +66,5 @@ void networkInit() {
networkImplInit(); networkImplInit();
config = getConfig(); config = getConfig();
schAdd(networkSecondsHandler, NULL, 1000000, 1000); schAdd(networkSecondsHandler, NULL, 0, 1000);
} }

View File

@ -45,6 +45,8 @@ enum {
} sntpState = SNTP_STATE_IDLE; } sntpState = SNTP_STATE_IDLE;
uint64_t seconds; uint64_t seconds;
/*
static void networkSntpEngine(void *handle) { static void networkSntpEngine(void *handle) {
static uint16_t retryCount = 0; static uint16_t retryCount = 0;
@ -58,7 +60,6 @@ static void networkSntpEngine(void *handle) {
coloredMsg(LOG_BLUE, "nes, failed to resolve ntp server"); coloredMsg(LOG_BLUE, "nes, failed to resolve ntp server");
sntpState = SNTP_STATE_ERROR; sntpState = SNTP_STATE_ERROR;
} else { } else {
/*
socket(SNTP_SOCK, Sn_MR_UDP, NTP_PORT, 0); socket(SNTP_SOCK, Sn_MR_UDP, NTP_PORT, 0);
retryCount = 0; retryCount = 0;
uint8_t sockState = getSn_SR(SNTP_SOCK); uint8_t sockState = getSn_SR(SNTP_SOCK);
@ -74,7 +75,6 @@ static void networkSntpEngine(void *handle) {
coloredMsg(LOG_BLUE, "nes, socket in unexpected state: %d", sockState); coloredMsg(LOG_BLUE, "nes, socket in unexpected state: %d", sockState);
sntpState = SNTP_STATE_ERROR; sntpState = SNTP_STATE_ERROR;
} }
*/
} }
break; break;
case SNTP_STATE_RECV: case SNTP_STATE_RECV:
@ -112,8 +112,11 @@ static void networkSntpEngine(void *handle) {
coloredMsg(LOG_BLUE, "nes, unexpected state"); coloredMsg(LOG_BLUE, "nes, unexpected state");
} }
} }
*/
uint64_t networkSntpQuery() { uint64_t networkSntpQuery() {
/*
uint64_t res = 0; uint64_t res = 0;
if (sntpState == SNTP_STATE_IDLE) { if (sntpState == SNTP_STATE_IDLE) {
sntpState = SNTP_STATE_START; sntpState = SNTP_STATE_START;
@ -125,6 +128,8 @@ uint64_t networkSntpQuery() {
res = seconds; res = seconds;
} }
return res; return res;
*/
return 0;
} }