Browse Source

bsp: nxp/mcx/mcxa/frdm-mcxa156: Add LED blinking demo.

Add LED blinking demo to align with other BSPs.

Signed-off-by: Yilin Sun <imi415@imi.moe>
Yilin Sun 3 months ago
parent
commit
8b482aec54
1 changed files with 7 additions and 2 deletions
  1. 7 2
      bsp/nxp/mcx/mcxa/frdm-mcxa156/applications/main.c

+ 7 - 2
bsp/nxp/mcx/mcxa/frdm-mcxa156/applications/main.c

@@ -29,10 +29,15 @@ int main(void)
     rt_kprintf("using gcc, version: %d.%d\n", __GNUC__, __GNUC_MINOR__);
     rt_kprintf("using gcc, version: %d.%d\n", __GNUC__, __GNUC_MINOR__);
 #endif
 #endif
 
 
+    rt_kprintf("MCXA156 HelloWorld\r\n");
+    rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);  /* Set GPIO as Output */
+
     while (1)
     while (1)
     {
     {
-        rt_thread_mdelay(1000);               /* Delay 1S */
-              rt_kprintf("MCXA156 HelloWorld\r\n");
+        rt_pin_write(LED_PIN, PIN_HIGH);    /* Set GPIO output 1 */
+        rt_thread_mdelay(500);               /* Delay 500mS */
+        rt_pin_write(LED_PIN, PIN_LOW);     /* Set GPIO output 0 */
+        rt_thread_mdelay(500);               /* Delay 500mS */
     }
     }
 }
 }