diff --git a/software/app/application.cpp b/software/app/application.cpp index c674405..9980e94 100644 --- a/software/app/application.cpp +++ b/software/app/application.cpp @@ -44,6 +44,10 @@ void updateSensorHub() { hub.Update(); } +void updateRectangle(){ + mylight.RectangleUpdate(); +} + void ready() { WifiAccessPoint.config("Sensus", "", AUTH_OPEN, false, 3); hub.Start(); @@ -92,10 +96,10 @@ void init() { WifiEvents.onStationDisconnect(STADisconnect); WifiEvents.onStationGotIP(STAGotIP); cWebInterface::GetInstance()->StartServer(); - - procTimer.initializeMs(HUB_PERIOD, updateSensorHub).start(); - mylight.SetCurrent(500); + mylight.SetCurrent(1000); mylight.RectangleUpdate(); + //rectangleTimer.initializeUs(RECT_PERIOD, updateRectangle).start(); + procTimer.initializeMs(HUB_PERIOD, updateSensorHub).start(); } void STADisconnect(String ssid, uint8_t ssid_len, uint8_t bssid[6], uint8_t reason) { diff --git a/software/app/dac101c085.cpp b/software/app/dac101c085.cpp index a0227de..094dd04 100644 --- a/software/app/dac101c085.cpp +++ b/software/app/dac101c085.cpp @@ -80,7 +80,6 @@ uint8_t cDAC101C085::WriteSettings(uint16_t settings) Wire.write( (uint8_t) (settings >> 8) ); // Most significant byte Wire.write( (uint8_t) (settings & 0xFF) ); // Least significant byte error = Wire.endTransmission(); - Serial.println(settings); return I2CError(error); // Pass to error parser } diff --git a/software/include/defines.h b/software/include/defines.h index 5e1d681..5d88db1 100644 --- a/software/include/defines.h +++ b/software/include/defines.h @@ -13,6 +13,6 @@ #include "hardware.h" -#define DEBUG_LEVEL 1 +#define DEBUG_LEVEL 0 #endif /* APP_HARDWARE_H_ */ diff --git a/software/include/hardware.h b/software/include/hardware.h index 0aa1a0a..a9ded74 100644 --- a/software/include/hardware.h +++ b/software/include/hardware.h @@ -25,6 +25,7 @@ static const uint16_t RESOLUTION_DAC = 1024; static const int HUB_PERIOD = 5; static const int ADC_TIMEBASE = 250; static const int ADC_PERIOD = 5; +static const int RECT_PERIOD = 2500; // in us #define LED_PIN 2 // GPIO2