mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 21:18:13 +08:00
多行宏
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#define HTTP_CONTENT_HTML_ZIP "text/html\r\nContent-Encoding: gzip"
|
#define HTTP_CONTENT_HTML_ZIP "text/html\r\nContent-Encoding: gzip"
|
||||||
|
|
||||||
#define app_httpd_log(M, ...) custom_log("apphttpd", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__)
|
#define app_httpd_log(M, ...) do { custom_log("apphttpd", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#define HTTPD_HDR_DEFORT (HTTPD_HDR_ADD_SERVER|HTTPD_HDR_ADD_CONN_CLOSE|HTTPD_HDR_ADD_PRAGMA_NO_CACHE)
|
#define HTTPD_HDR_DEFORT (HTTPD_HDR_ADD_SERVER|HTTPD_HDR_ADD_CONN_CLOSE|HTTPD_HDR_ADD_PRAGMA_NO_CACHE)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "http_server/app_httpd.h"
|
#include "http_server/app_httpd.h"
|
||||||
#include "timed_task/timed_task.h"
|
#include "timed_task/timed_task.h"
|
||||||
|
|
||||||
#define os_log(format, ...) custom_log("TC1", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("TC1", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
char rtc_init = 0; //sntp校时成功标志位
|
char rtc_init = 0; //sntp校时成功标志位
|
||||||
uint32_t total_time = 0;
|
uint32_t total_time = 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
#define os_log(format, ...) custom_log("FUNCTION", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("FUNCTION", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#include "TimeUtils.h"
|
#include "TimeUtils.h"
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
|
|
||||||
#define app_log(M, ...) custom_log("APP", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__)
|
#define app_log(M, ...) do { custom_log("APP", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__) } while(0)
|
||||||
#define mqtt_log(M, ...) custom_log("MQTT", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__)
|
#define mqtt_log(M, ...) do { custom_log("MQTT", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mico.h"
|
#include "mico.h"
|
||||||
@@ -210,7 +210,7 @@ OSStatus user_mqtt_init(void)
|
|||||||
require_noerr_string(err, exit, "ERROR: Unable to start the mqtt client worker thread.");
|
require_noerr_string(err, exit, "ERROR: Unable to start the mqtt client worker thread.");
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (kNoErr != err) app_log("ERROR, app thread exit err: %d", err);
|
if (kNoErr != err) app_log("ERROR2, app thread exit err: %d kNoErr[%d]", err, kNoErr);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
|
|
||||||
#if OTA_DEBUG
|
#if OTA_DEBUG
|
||||||
#define ota_server_log(M, ...) custom_log("OTA", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__)
|
#define ota_server_log(M, ...) do { custom_log("OTA", M, ##__VA_ARGS__); web_log(M, ##__VA_ARGS__) } while(0)
|
||||||
#else
|
#else
|
||||||
#define ota_server_log(M, ...)
|
#define ota_server_log(M, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
#define os_log(format, ...) custom_log("OTA", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("OTA", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#include "mico.h"
|
#include "mico.h"
|
||||||
#include "ota_server/ota_server.h"
|
#include "ota_server/ota_server.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
#define os_log(format, ...) custom_log("RTC", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("RTC", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "user_gpio.h"
|
#include "user_gpio.h"
|
||||||
@@ -92,7 +92,7 @@ OSStatus user_rtc_init(void)
|
|||||||
0x1000, 0);
|
0x1000, 0);
|
||||||
require_noerr_string(err, exit, "ERROR: Unable to start the rtc thread.");
|
require_noerr_string(err, exit, "ERROR: Unable to start the rtc thread.");
|
||||||
|
|
||||||
if (kNoErr != err) os_log("ERROR, app thread exit err: %d", err);
|
if (kNoErr != err) os_log("ERROR1, app thread exit err: %d kNoErr[%d]", err, kNoErr);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
#define os_log(format, ...) custom_log("SNTP", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("SNTP", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
//#include "user_gpio.h"
|
//#include "user_gpio.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
#define os_log(format, ...) custom_log("KEY", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("KEY", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "user_gpio.h"
|
#include "user_gpio.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
#define os_log(format, ...) custom_log("OTA", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("OTA", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
#include "TimeUtils.h"
|
#include "TimeUtils.h"
|
||||||
|
|
||||||
#include "mico.h"
|
#include "mico.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
#define os_log(format, ...) custom_log("UDP", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("UDP", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mqtt_server/user_function.h"
|
#include "mqtt_server/user_function.h"
|
||||||
@@ -29,7 +29,7 @@ OSStatus user_udp_init(void)
|
|||||||
0x1000, 0);
|
0x1000, 0);
|
||||||
require_noerr_string(err, exit, "ERROR: Unable to start the rtc thread.");
|
require_noerr_string(err, exit, "ERROR: Unable to start the rtc thread.");
|
||||||
|
|
||||||
if (kNoErr != err) os_log("ERROR, app thread exit err: %d", err);
|
if (kNoErr != err) os_log("ERROR3, app thread exit err: %d kNoErr[%d]", err, kNoErr);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "mqtt_server/user_function.h"
|
#include "mqtt_server/user_function.h"
|
||||||
#include "http_server/web_log.h"
|
#include "http_server/web_log.h"
|
||||||
|
|
||||||
#define os_log(format, ...) custom_log("WIFI", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
#define os_log(format, ...) do { custom_log("WIFI", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
char wifi_status = WIFI_STATE_NOCONNECT;
|
char wifi_status = WIFI_STATE_NOCONNECT;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user