浏览代码

Исправил, теперь компилиться

Vladimir N. Shilov 9 年之前
父节点
当前提交
3e82c993ab
共有 1 个文件被更改,包括 12 次插入52 次删除
  1. 12 52
      app/application.cpp

+ 12 - 52
app/application.cpp

@@ -7,8 +7,8 @@
 #include "../include/configuration.h" // application configuration
 ///////////////////////////////////////////////////////////////////
 
-#include "webserver.h"
 #include "max7219.h"
+#include "webserver.h"
 
 DHT dht(DHT_PIN, DHT22);
 
@@ -18,7 +18,8 @@ Timer displayTimer;
 
 bool state = false;
 // Sensors string values
-String StrT, StrRH, StrHI, StrCR, StrCF, StrTime;
+String StrT, StrRH, StrHI, StrCR, StrCF;
+String oldStrTime, StrTime;
 String StrVDD, StrADC;
 
 // date and time
@@ -29,14 +30,14 @@ HttpClient thingSpeak;
 
 /* FTPServer ftp; */
 
-void process(void);
-//void showValues(void);
-void connectOk(void);
-void connectFail(void);
+void process();
+//void showValues();
+void connectOk();
+void connectFail();
 void onDataSent(HttpClient& client, bool successful);
-void sendData(void);
+void sendData();
 void onNtpReceive(NtpClient& client, time_t timestamp);
-void showTime(void);
+void showTime();
 
 NtpClient ntpClient ("ntps1-0.cs.tu-berlin.de", 60, onNtpReceive);
 
@@ -84,9 +85,8 @@ void init()
 	displayTimer.initializeMs(500, showTime).start();
 }
 
-void showTime(void)
+void showTime()
 {
-	static String oldStrTime;
 	static uint16_t oldHour, oldMinute;
 
 	StrTime = SystemClock.getSystemTimeString();
@@ -139,39 +139,6 @@ void showTime(void)
 
 }
 
-/*
-void showValues(void)
-{
-	Serial.print("Date & Time: ");
-	Serial.println(SystemClock.getSystemTimeString());
-
-	Serial.print("Temperature: ");
-	Serial.print(StrT);
-	Serial.println("*C");
-
-	Serial.print("Humidity: ");
-	Serial.print(StrRH);
-	Serial.println("%");
-
-	Serial.print("Heatindex: ");
-	Serial.print(StrHI);
-	Serial.println("*C");
-
-	Serial.print("Comfort: ");
-	Serial.print(StrCR);
-	Serial.print("% - ");
-	Serial.println(StrCF);
-
-	Serial.print("ADC value: ");
-	Serial.println(StrADC);
-
-	Serial.print("VDD value: ");
-	Serial.println(StrVDD);
-
-	Serial.println("");
-}
-*/
-
 void process()
 {
 	float t = dht.readTemperature() + ActiveConfig.AddT;
@@ -226,19 +193,11 @@ void process()
 
 	StrADC = String(system_adc_read());
 	StrVDD = String(system_get_vdd33());
-/*
-	if (!serialTimer.isStarted())
-		serialTimer.initializeMs(20000, showValues).start();
-	// îáíîâëåíèå âûâîäà -- ðàç â 20 ñåê. îáíîâëåíèå äàííûõ -- ðàç â ìèíóòó.
-*/
 }
 
 /*
 void startFTP()
 {
-	if (!fileExist("index.html"))
-		fileSetContent("index.html", "<h3>Please connect to FTP and upload files from folder 'web/build' (details in code)</h3>");
-
 	// Start FTP server
 	ftp.listen(21);
 	ftp.addUser("user", "resu"); // FTP account
@@ -303,7 +262,8 @@ void onDataSent(HttpClient& client, bool successful)
 
 void sendData()
 {
-	if (thingSpeak.isProcessing()) return; // We need to wait while request processing was completed
+	// We need to wait while request processing was completed
+	if (thingSpeak.isProcessing()) return;
 
 	thingSpeak.downloadString("http://api.thingspeak.com/update?key=26WYU9LJCBC3AE1X&field1=" + StrT + "&field2=" + StrRH + "&field3=" + StrHI, onDataSent);
 }