[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #36905] SNTP problem with SNTP_STARTUP_DELAY symbol
From: |
Freddie Chopin |
Subject: |
[lwip-devel] [bug #36905] SNTP problem with SNTP_STARTUP_DELAY symbol |
Date: |
Fri, 20 Jul 2012 19:04:16 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11 |
URL:
<http://savannah.nongnu.org/bugs/?36905>
Summary: SNTP problem with SNTP_STARTUP_DELAY symbol
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: freddie_chopin
Submitted on: Fri 20 Jul 2012 07:04:15 PM GMT
Category: Contrib
Severity: 3 - Normal
Item Group: Faulty Behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: 1.4.0
_______________________________________________________
Details:
This is about file sntp.c
When I try to define SNTP_STARTUP_DELAY symbol as any function (let that be
rand()) it gives me compiler error:
lwIP/lwIP_Apps/apps/sntp/sntp.c: In function 'sntp_init':
lwIP/lwIP_Apps/apps/sntp/sntp.c:696:5: error: missing binary operator before
token "("
on line:
#if SNTP_STARTUP_DELAY
The solution I've found is to define the symbol as a numeric non-zero value
(for the "#if") and add another symbol SNTP_STARTUP_DELAY_FUNC used in this
line:
sys_timeout((u32_t)SNTP_STARTUP_DELAY_FUNC, sntp_request, NULL);
This way I have two defines:
#ifndef SNTP_STARTUP_DELAY
#define SNTP_STARTUP_DELAY rand
#define SNTP_STARTUP_DELAY_FUNC ((rand() % (4 * 60 * 1000)) + (60 *
1000))
#endif
I don't know whether it's possible to use current code and define original
symbol to be some function - probably not.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?36905>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [bug #36905] SNTP problem with SNTP_STARTUP_DELAY symbol,
Freddie Chopin <=