Skip to content

Commit

Permalink
selftest crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Sep 22, 2024
1 parent c79e356 commit a951dd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sim/Controller_DHT11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
#include "Text.h"

extern "C" bool SIM_ReadDHT11(int pin, byte *data) {
CSimulation *s = g_sim->getSim();
data[0] = data[1] = data[2] = data[3] = data[4] = 0;
// temp 19
data[2] = 19;
// humidity 67
data[0] = 67;
data[1] = 0;
if (g_sim == 0)
return true;
CSimulation *s = g_sim->getSim();
if (s == 0)
return true;
TArray<CControllerDHT11 *> dhts = s->findControllersOfType<CControllerDHT11>();
Expand Down

0 comments on commit a951dd2

Please sign in to comment.