From 43846001be8b5b2d792fc072ccd24c5645289ff2 Mon Sep 17 00:00:00 2001 From: james <1943357252@qq.com> Date: Wed, 31 Jul 2024 00:35:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E7=AB=AF=E7=BB=99=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E6=9D=BF=E5=8F=91=E9=80=81=E6=8C=87=E4=BB=A4=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=B0=8F=E7=81=AF=E7=BF=BB=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Day5/mqtt.c | 2 ++ applications/main.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Day5/mqtt.c b/Day5/mqtt.c index 0968293..92e44ea 100644 --- a/Day5/mqtt.c +++ b/Day5/mqtt.c @@ -51,10 +51,12 @@ static void example_message_arrive(void *pcontext, void *pclient, iotx_mqtt_even rt_pin_mode(GPIO_LED_R, PIN_MODE_OUTPUT); if(rt_pin_read(GPIO_LED_R) == PIN_HIGH) { + // rt_kprintf("LED_R should be ON\n"); rt_pin_write(GPIO_LED_R, PIN_LOW); } else { + // rt_kprintf("LED_R should be OFF\n"); rt_pin_write(GPIO_LED_R, PIN_HIGH); } EXAMPLE_TRACE("Topic : %.*s", topic_info->topic_len, topic_info->ptopic); diff --git a/applications/main.c b/applications/main.c index 7dddfa6..c9732aa 100644 --- a/applications/main.c +++ b/applications/main.c @@ -63,14 +63,14 @@ int main(void) { main_init(); - rt_pin_mode(GPIO_LED_B, PIN_MODE_OUTPUT); - while(1) - { - rt_pin_write(GPIO_LED_B, PIN_HIGH); - rt_thread_mdelay(500); - rt_pin_write(GPIO_LED_B, PIN_LOW); - rt_thread_mdelay(500); - } + // rt_pin_mode(GPIO_LED_B, PIN_MODE_OUTPUT); + // while(1) + // { + // rt_pin_write(GPIO_LED_B, PIN_HIGH); + // rt_thread_mdelay(500); + // rt_pin_write(GPIO_LED_B, PIN_LOW); + // rt_thread_mdelay(500); + // } return 0; }