mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Merge pull request #1184 from oliverschmidt/master
Adjusted retro target clock to "new" DNS resolver.
This commit is contained in:
commit
5f6a672e23
@ -61,7 +61,7 @@ typedef int32_t s32_t;
|
||||
#define HAVE_SNPRINTF
|
||||
#define snprintf(buf, len, ...) sprintf(buf, __VA_ARGS__)
|
||||
|
||||
#define CLOCK_CONF_SECOND 2
|
||||
#define CLOCK_CONF_SECOND 4
|
||||
typedef unsigned short clock_time_t;
|
||||
|
||||
typedef unsigned short uip_stats_t;
|
||||
|
@ -45,11 +45,8 @@ clock_time(void)
|
||||
* of overhead for cc65 targets.
|
||||
* On the other hand we want to avoid wrapping around frequently so the idea
|
||||
* is to reduce the clock resolution to the bare minimum. This is defined by
|
||||
* the TCP/IP stack using a 1/2 second periodic timer. So CLOCK_CONF_SECOND
|
||||
* needs to be defined at least as 2.
|
||||
* The value 2 works out especially nicely as it allows us to implement the
|
||||
* clock frequency devider below purely in (32 bit) integer arithmetic based
|
||||
* on the educated guess of CLK_TCK being an even value. */
|
||||
* the DNS resolver using a 1/4 second timer. So CLOCK_CONF_SECOND needs to
|
||||
* be defined at least as 4. */
|
||||
return clock() / (CLK_TCK / CLOCK_CONF_SECOND);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -63,7 +63,7 @@ clock_update(void)
|
||||
static unsigned int count;
|
||||
|
||||
count += tick;
|
||||
if(count > 2000) {
|
||||
if(count > 1000) {
|
||||
count = 0;
|
||||
++time;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user