parent
d41d080a70
commit
7df870c77c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,11 @@ |
||||
.page-home #rssi-perc:after { |
||||
padding-left: dist(-4); |
||||
content: '%'; |
||||
font-size: fsize(-1); |
||||
} |
||||
|
||||
.page-home #rssi-dbm:after { |
||||
padding-left: dist(-4); |
||||
content: 'dBm'; |
||||
font-size: fsize(-1); |
||||
} |
@ -0,0 +1,38 @@ |
||||
#include <esp8266.h> |
||||
|
||||
volatile uint32_t uptime = 0; |
||||
|
||||
static ETSTimer prUptimeTimer; |
||||
|
||||
static void uptimeTimerCb(void *arg) |
||||
{ |
||||
uptime++; |
||||
} |
||||
|
||||
void uptime_timer_init(void) |
||||
{ |
||||
os_timer_disarm(&prUptimeTimer); |
||||
os_timer_setfn(&prUptimeTimer, uptimeTimerCb, NULL); |
||||
os_timer_arm(&prUptimeTimer, 1000, 1); |
||||
} |
||||
|
||||
void uptime_str(char *buf) |
||||
{ |
||||
u32 a = uptime; |
||||
u32 days = a / 86400; |
||||
a -= days * 86400; |
||||
|
||||
u32 hours = a / 3600; |
||||
a -= hours * 3600; |
||||
|
||||
u32 mins = a / 60; |
||||
a -= mins * 60; |
||||
|
||||
u32 secs = a; |
||||
|
||||
if (days > 0) { |
||||
sprintf(buf, "%ud %02u:%02u:%02u", days, hours, mins, secs); |
||||
} else { |
||||
sprintf(buf, "%02u:%02u:%02u", hours, mins, secs); |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
#ifndef UPTIME_H |
||||
#define UPTIME_H |
||||
|
||||
#include <esp8266.h> |
||||
|
||||
extern volatile uint32_t uptime; |
||||
|
||||
void uptime_timer_init(void); |
||||
|
||||
/** Print uptime to a buffer. Should be at least 20 long. */ |
||||
void uptime_str(char *buf); |
||||
|
||||
#endif // UPTIME_H
|
Loading…
Reference in new issue