diff --git a/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c b/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c index f4e8759f..6c3184e9 100644 --- a/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c +++ b/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c @@ -45,7 +45,7 @@ void mqtt_demo_task(void) - /* OLED显示日志 */ + /* OLED鏄剧ず鏃ュ織 */ OLED_ShowString(0, 2, (uint8_t*)"connecting...", 16); /** @@ -75,7 +75,7 @@ void mqtt_demo_task(void) printf("MQTT: %s\n", state == MQTT_STATE_CONNECTED ? "CONNECTED" : "DISCONNECTED"); } - /* 开始订阅topic */ + /* 寮濮嬭闃卼opic */ size = snprintf(report_reply_topic_name, TOPIC_NAME_MAX_SIZE, "$thing/down/property/%s/%s", product_id, device_name); if (size < 0 || size > sizeof(report_reply_topic_name) - 1) { @@ -87,14 +87,14 @@ void mqtt_demo_task(void) printf("module mqtt sub success\n"); } - memset(report_topic_name, sizeof(report_topic_name), 0); + memset(report_topic_name, 0, sizeof(report_topic_name)); size = snprintf(report_topic_name, TOPIC_NAME_MAX_SIZE, "$thing/up/property/%s/%s", product_id, device_name); if (size < 0 || size > sizeof(report_topic_name) - 1) { printf("pub topic content length not enough! content size:%d buf size:%d", size, (int)sizeof(report_topic_name)); } - /* 创建邮箱 */ + /* 鍒涘缓閭 */ tos_mail_q_create(&mail_q, pm2d5_value_pool, 3, sizeof(pm2d5_data_u)); HAL_NVIC_DisableIRQ(USART3_4_IRQn); @@ -105,18 +105,18 @@ void mqtt_demo_task(void) } while (1) { - /* 通过接收邮件来读取数据 */ + /* 閫氳繃鎺ユ敹閭欢鏉ヨ鍙栨暟鎹 */ HAL_NVIC_EnableIRQ(USART3_4_IRQn); tos_mail_q_pend(&mail_q, (uint8_t*)&pm2d5_value, &mail_size, TOS_TIME_FOREVER); HAL_NVIC_DisableIRQ(USART3_4_IRQn); - //收到之后打印信息 + //鏀跺埌涔嬪悗鎵撳嵃淇℃伅 printf("\r\n\r\n\r\n"); for (i = 0; i < 13; i++) { printf("data[%d]:%d ug/m3\r\n", i+1, pm2d5_value.data[i]); } - //显示PM2.5的值 + //鏄剧ずPM2.5鐨勫 OLED_Clear(); sprintf(str, "PM1.0:%4d ug/m3", pm2d5_value.pm2d5_data.data1); OLED_ShowString(0,0,(uint8_t*)str,16); @@ -124,7 +124,7 @@ void mqtt_demo_task(void) OLED_ShowString(0,2,(uint8_t*)str,16); - /* 上报值 */ + /* 涓婃姤鍊 */ memset(payload, 0, sizeof(payload)); snprintf(payload, sizeof(payload), REPORT_DATA_TEMPLATE, pm2d5_value.pm2d5_data.data2); @@ -144,7 +144,7 @@ void application_entry(void *arg) { char *str = "TencentOS-tiny"; - /* 初始化OLED */ + /* 鍒濆鍖朞LED */ OLED_Init(); OLED_Clear(); OLED_ShowString(0, 0, (uint8_t*)str, 16);