Browse Source

Minor changes

tags/v0.2.2.3
Ryan Joseph 11 months ago
parent
commit
518e706f70
3 changed files with 2 additions and 9 deletions
  1. +1
    -1
      zw_common.h
  2. +1
    -1
      zw_displays.cpp
  3. +0
    -7
      zw_otp.cpp

+ 1
- 1
zw_common.h View File

@@ -1,7 +1,7 @@
#ifndef __ZW_COMMON__H__
#define __ZW_COMMON__H__

#define ZEROWATCH_VER "0.2.2.0"
#define ZEROWATCH_VER "0.2.2.3"
#define DEBUG 1

struct ZWAppConfig


+ 1
- 1
zw_displays.cpp View File

@@ -76,7 +76,7 @@ DisplaySpec gDisplays_EZERO[] = {
{-1, -1, nullptr, {nullptr, -1, -1, -1.0, -1, noop, d_def}}};

DisplaySpec gDisplays_ETEST[] = {
{26, 25, nullptr, {"zed:sensor:SPS30:mc_2p5:.list", 0, 5, 0.0, 0, [](int i) { return i / 100; }, d_def}},
{26, 25, nullptr, {"zero:sensor:DHTXX:temperature_fahrenheit:.list", 0, 11, 0.0, 0, noop, d_tempf}},
{-1, -1, nullptr, {nullptr, -1, -1, -1.0, -1, noop, d_def}}};

DisplaySpec *zwdisplayInit(String &hostname)


+ 0
- 7
zw_otp.cpp View File

@@ -11,8 +11,6 @@ static const uint8_t fudgeTableLen = 10;
// to generate anew, use ./scripts/otp-generate.pl
bool otpCheck(uint16_t otp)
{
dprint("[OTP] A: %d\n", otp);
dprint("[OTP] I: %ld\n", micros());
auto div = (unsigned long)1e6 * 60 * OTP_WINDOW_MINUTES;
auto now = micros();

@@ -23,17 +21,12 @@ bool otpCheck(uint16_t otp)
}

auto internalChecker = micros() / div;
dprint("[OTP] 0: %ld\n", internalChecker);

internalChecker += fudgeTable[internalChecker % fudgeTableLen];
dprint("[OTP] D: %ld\n", internalChecker);

for (int i = 0; i < gHostname.length(); i++)
{
internalChecker += gHostname.charAt(i);
dprint("[OTP] %d: %ld (+= %d)\n", i, internalChecker, (int)gHostname.charAt(i));
}

dprint("[OTP] F: %d\n", (uint16_t)internalChecker);
return (uint16_t)internalChecker == otp;
}

Loading…
Cancel
Save