Fixed multiplier issue
This commit is contained in:
parent
26c909ac8d
commit
d04706f9d1
3 changed files with 6 additions and 8 deletions
|
|
@ -1,14 +1,14 @@
|
|||
#ifndef HALCONFIGURATION_H
|
||||
#define HALCONFIGURATION_H
|
||||
|
||||
#define ENABLE_DEBUG // comment out to disable debug
|
||||
//#define ENABLE_DEBUG // comment out to disable debug
|
||||
|
||||
#define TIMER_MILLISECOND 60*1000 // poling in minutes
|
||||
#define INDICATOR_PIN 13 // diode
|
||||
|
||||
|
||||
// POWER CONSUMPTION SENSOR
|
||||
#define POWERCON_ENABLED // comment out to disable sensor
|
||||
//#define POWERCON_ENABLED // comment out to disable sensor
|
||||
#define POWERCON_SENSOR SensorPhotocell()
|
||||
#define POWERCON_PROTOCOL ProtocolOregon(11, 186)
|
||||
#define POWER_TIMER_MULTIPLIER 1
|
||||
|
|
|
|||
|
|
@ -80,11 +80,10 @@ void timerInterruptFunc()
|
|||
void loop()
|
||||
{
|
||||
digitalWrite(INDICATOR_PIN, HIGH);
|
||||
//noInterrupts();
|
||||
|
||||
// Send power consumption
|
||||
#ifdef POWERCON_ENABLED
|
||||
if(timerMultiplier == POWER_TIMER_MULTIPLIER)
|
||||
if(timerMultiplier % POWER_TIMER_MULTIPLIER == 0)
|
||||
{
|
||||
static PowerData powerData;
|
||||
powerSensor->read(powerData); // not needed, only here for future use
|
||||
|
|
@ -95,7 +94,7 @@ void loop()
|
|||
|
||||
// Handle temperature sensor
|
||||
#ifdef TEMPERATURE_ENABLED
|
||||
if(timerMultiplier == TEMPERATURE_TIMER_MULTIPLIER)
|
||||
if(timerMultiplier % TEMPERATURE_TIMER_MULTIPLIER == 0)
|
||||
{
|
||||
static TemperatureData tempData;
|
||||
tempSensor->read(tempData);
|
||||
|
|
@ -106,7 +105,7 @@ void loop()
|
|||
|
||||
// Handle light sensor
|
||||
#ifdef LIGHT_ENABLED
|
||||
if(timerMultiplier == LIGHT_TIMER_MULTIPLIER)
|
||||
if(timerMultiplier % LIGHT_TIMER_MULTIPLIER == 0)
|
||||
{
|
||||
static LightData lightData;
|
||||
lightSensor->read(lightData);
|
||||
|
|
@ -115,7 +114,6 @@ void loop()
|
|||
}
|
||||
#endif
|
||||
|
||||
//interrupts();
|
||||
digitalWrite(INDICATOR_PIN, LOW);
|
||||
|
||||
DEBUG("Sleeping");
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ void Interrupt::handleWatchDogInterrupt()
|
|||
wdt_disable();
|
||||
if (wdtTime <= 0)
|
||||
return;
|
||||
DEBUGF("WDT interrupt, time=%d, timeLeft=%d", wdtTime, wdtTimeLeft);
|
||||
DEBUGF("WDT interrupt, time=%u, timeLeft=%ld", wdtTime, wdtTimeLeft);
|
||||
|
||||
if (wdtTimeLeft <= 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue