File tree Expand file tree Collapse file tree 2 files changed +38
-8
lines changed
bsp/stm32/stm32mp157a-st-discovery Expand file tree Collapse file tree 2 files changed +38
-8
lines changed Original file line number Diff line number Diff line change 1212#include <rtdevice.h>
1313#include <board.h>
1414
15- /* defined the LD8 pin: PD11 */
16- #define LED8_PIN GET_PIN(D, 11 )
15+ /* defined the LD7 pin: PH7 */
16+ #define LED7_PIN GET_PIN(H, 7 )
1717
1818int main (void )
1919{
2020 int count = 1 ;
21- /* set LD8 pin mode to output */
22- rt_pin_mode (LED8_PIN , PIN_MODE_OUTPUT );
21+ /* set LD7 pin mode to output */
22+ rt_pin_mode (LED7_PIN , PIN_MODE_OUTPUT );
2323
2424 while (count ++ )
2525 {
26- rt_pin_write (LED8_PIN , PIN_HIGH );
26+ rt_pin_write (LED7_PIN , PIN_HIGH );
2727 rt_thread_mdelay (500 );
28- rt_pin_write (LED8_PIN , PIN_LOW );
28+ rt_pin_write (LED7_PIN , PIN_LOW );
2929 rt_thread_mdelay (500 );
3030 }
3131
Original file line number Diff line number Diff line change @@ -234,8 +234,6 @@ int rt_hw_openamp_init(void)
234234 openamp_init ();
235235
236236 rt_hw_openamp_register (& dev_openamp , "openamp" , 0 , NULL );
237-
238- rt_console_set_device ("openamp" );
239237
240238 return RT_EOK ;
241239}
@@ -289,4 +287,36 @@ static int creat_openamp_thread(void)
289287}
290288INIT_APP_EXPORT (creat_openamp_thread );
291289
290+ #ifdef FINSH_USING_MSH
291+
292+ static int console (int argc , char * * argv )
293+ {
294+ rt_err_t result = RT_EOK ;
295+
296+ if (argc > 1 )
297+ {
298+ if (!strcmp (argv [1 ], "set" ))
299+ {
300+ rt_kprintf ("console change to %s\n" , argv [2 ]);
301+ rt_console_set_device (argv [2 ]);
302+ finsh_set_device (argv [2 ]);
303+ }
304+ else
305+ {
306+ rt_kprintf ("Unknown command. Please enter 'console' for help\n" );
307+ result = - RT_ERROR ;
308+ }
309+ }
310+ else
311+ {
312+ rt_kprintf ("Usage: \n" );
313+ rt_kprintf ("console set <name> - change console by name\n" );
314+ result = - RT_ERROR ;
315+ }
316+ return result ;
317+ }
318+ MSH_CMD_EXPORT (console , set console name );
319+
320+ #endif /* FINSH_USING_MSH */
321+
292322#endif
You can’t perform that action at this time.
0 commit comments