Workaround for missing realtime_stamp

pull/188/head
beegee-tokyo 8 years ago
parent 0654c1d038
commit a9df22e51f
  1. 4
      Makefile
  2. 2
      syslog/syslog.c
  3. 2
      syslog/syslog.h

@ -101,8 +101,8 @@ LED_SERIAL_PIN ?= 14
# --------------- esp-link modules config options --------------- # --------------- esp-link modules config options ---------------
# Optional Modules mqtt rest socket webserver syslog # Optional Modules mqtt rest socket web-server syslog
MODULES ?= mqtt rest socket webserver syslog MODULES ?= mqtt rest socket web-server syslog
# --------------- esphttpd config options --------------- # --------------- esphttpd config options ---------------

@ -13,6 +13,7 @@
#include "syslog.h" #include "syslog.h"
#include "time.h" #include "time.h"
#include "task.h" #include "task.h"
#include "sntp.h"
extern void * mem_trim(void *m, size_t s); // not well documented... extern void * mem_trim(void *m, size_t s); // not well documented...
@ -401,6 +402,7 @@ syslog_compose(uint8_t facility, uint8_t severity, const char *tag, const char *
// create timestamp: FULL-DATE "T" PARTIAL-TIME "Z": 'YYYY-mm-ddTHH:MM:SSZ ' // create timestamp: FULL-DATE "T" PARTIAL-TIME "Z": 'YYYY-mm-ddTHH:MM:SSZ '
// as long as realtime_stamp is 0 we use tick div 10⁶ as date // as long as realtime_stamp is 0 we use tick div 10⁶ as date
uint32_t realtime_stamp = sntp_get_current_timestamp();
now = (realtime_stamp == 0) ? (se->tick / 1000000) : realtime_stamp; now = (realtime_stamp == 0) ? (se->tick / 1000000) : realtime_stamp;
tp = gmtime(&now); tp = gmtime(&now);

@ -71,7 +71,7 @@ enum syslog_facility {
#define WDEV_NOW() REG_READ(0x3ff20c00) #define WDEV_NOW() REG_READ(0x3ff20c00)
// This variable disappeared from lwip in SDK 2.0... // This variable disappeared from lwip in SDK 2.0...
extern uint32_t realtime_stamp; // 1sec NTP ticker // extern uint32_t realtime_stamp; // 1sec NTP ticker
typedef struct syslog_host_t syslog_host_t; typedef struct syslog_host_t syslog_host_t;
struct syslog_host_t { struct syslog_host_t {

Loading…
Cancel
Save