Skip to content

Commit

Permalink
Adjust to GRNG
Browse files Browse the repository at this point in the history
  • Loading branch information
steadramon committed Aug 7, 2024
1 parent df0ca17 commit 6cbdce7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ESPGeiger/ESPGeiger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifdef ESPGEIGER_HW
#include "src/ESPGHW/ESPGHW.h"
#endif
#include "src/GRand/GRand.h"
#include "src/GRNG/GRNG.h"
#include "src/Counter/Counter.h"
#include "src/ConfigManager/ConfigManager.h"
#include "src/Status.h"
Expand Down Expand Up @@ -71,7 +71,7 @@ SerialOut serialout = SerialOut();
// Global status and counter
Status status;
Counter gcounter = Counter();
GRand grand = GRand();
GRNG grng = GRNG();

NTP_Client ntpclient = NTP_Client();

Expand Down Expand Up @@ -199,7 +199,7 @@ void setup()

arduino_ota_setup(hostName);
delay(500);
grand.begin();
grng.begin();
#ifdef MQTTOUT
mqtt.begin();
#endif
Expand Down Expand Up @@ -233,4 +233,4 @@ void loop()
neopixel.loop(now);
#endif
ArduinoOTA.handle();
}
}
13 changes: 13 additions & 0 deletions ESPGeiger/src/GRNG/GRNG.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "GRNG.h"
#include "../Logger/Logger.h"

GRNG::GRNG() {
};

void GRNG::begin() {
#ifdef ESP8266
randomSeed(RANDOM_REG32);
#else
randomSeed(esp_random());
#endif
}
12 changes: 12 additions & 0 deletions ESPGeiger/src/GRNG/GRNG.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef GRNG_H
#define GRNG_H

#include <Arduino.h>

class GRNG
{
public:
GRNG();
void begin();
};
#endif

0 comments on commit 6cbdce7

Please sign in to comment.