mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-12 00:10:14 +00:00
examples: hello: Show CPU index when running in SMP mode
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
59b763add4
commit
715517b1a0
1 changed files with 10 additions and 0 deletions
|
|
@ -40,6 +40,10 @@
|
|||
#include <nuttx/config.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
# include <nuttx/arch.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -50,6 +54,12 @@
|
|||
|
||||
int main(int argc, FAR char *argv[])
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
uint32_t cpu = up_cpu_index();
|
||||
|
||||
printf("Hello, World from CPU%d !!\n", cpu);
|
||||
#else
|
||||
printf("Hello, World!!\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue